---
agent_auth:
  skill: "https://usedarb.com/.well-known/agent-skills/agent-auth/SKILL.md"
  register_uri: "https://usedarb.com/api/agent/claim"
  identity_types_supported:
    - "anonymous"
  anonymous:
    credential_types_supported:
      - "none"
    claim_uri: "https://usedarb.com/api/agent/claim"
  claim_uri: "https://usedarb.com/api/agent/claim"
  public_api:
    auth_required: false
  authorization_servers:
    - "https://accounts.google.com"
  protected_resource_metadata: "https://usedarb.com/.well-known/oauth-protected-resource"
  authorization_server_metadata: "https://usedarb.com/.well-known/oauth-authorization-server"
  documentation: "https://usedarb.com/auth.md"
  credential_types_supported:
    - "oauth2_access_token"
    - "oidc_id_token"
  token_endpoint_auth_methods:
    - "client_secret_post"
    - "client_secret_basic"
  revocation_uri: "https://oauth2.googleapis.com/revoke"
  dynamic_client_registration: false
  registration_type: "manual"
  client_registration_uri: "https://console.cloud.google.com/apis/credentials"
  delegated_agent_access: false
---

# Auth.md

## المصادقة — درب (Darb)

https://usedarb.com

## الخلاصة
| السطح | المصادقة |
|---|---|
| البيانات العامّة (`/api/agent/*` · `/mcp` · ملفّات الاكتشاف) | **لا شيء** — مفتوحة للقراءة |
| ما يخصّ حساب طالبٍ بعينه | **OAuth 2.0 عبر Google** (Firebase Authentication) |

## السطح العامّ
اقرأ مباشرةً بلا رمزٍ ولا مفتاح:

- `GET https://usedarb.com/api/agent/universities`
- `GET https://usedarb.com/api/agent/exams`
- `GET https://usedarb.com/api/agent/calendar`
- `GET https://usedarb.com/api/agent/faq`
- `POST https://usedarb.com/mcp` (JSON-RPC 2.0)

الحدُّ ستّون طلباً في الدقيقة لكل عنوان. الترويسة `Access-Control-Allow-Origin: *`.

## السطح المحميّ
بيانات الطالب — خطّته وأخطاؤه وتقدّمه — لا تخرج من درب إلى وكيلٍ إطلاقاً.
**لا توجد واجهةٌ تُخرجها، ولن توجد.** ما خلف الدخول هو تطبيق الطالب نفسه:
يفتحه هو بهويّته من Google، ولا يُفوَّض وكيلٌ ثالث بقراءته.

- خادم التفويض: `https://accounts.google.com`
- بيانُ الخادم: [`/.well-known/oauth-authorization-server`](https://usedarb.com/.well-known/oauth-authorization-server) (RFC 8414)
- بيانُ المورد المحميّ: [`/.well-known/oauth-protected-resource`](https://usedarb.com/.well-known/oauth-protected-resource) (RFC 9728)
- الرمز يُرسَل: `Authorization: Bearer <Google ID token>`
- النطاقات: `openid` · `email` · `profile`

## تسجيلُ الوكلاء (Agent Registration)
**نوعُ الهويّة `anonymous` ونوعُ الاعتماد `none`.** لا تسجيلَ ولا مفتاح: استدعِ
الواجهةَ العامّة مباشرةً. وللتأكّد آلياً بدل التخمين:

```
GET https://usedarb.com/api/agent/claim
→ {"identity_type":"anonymous","credential_type":"none","granted":true,"credential":null}
```

يُعيد معها قائمةَ العناوين المتاحة وحدَّ الطلبات. لا يُنشئ حساباً ولا يُصدر رمزاً
ولا يرسل بريداً — إنما يخبرك أن البابَ مفتوحٌ أصلاً.

المهارةُ الكاملة: [`agent-auth`](https://usedarb.com/.well-known/agent-skills/agent-auth/SKILL.md)

### أمّا دخولُ Google
فهو **للطالب البشريّ في تطبيقه**، لا لوكيلٍ ينوب عنه. من أراد بناء عميلٍ يدخل
به مستخدمٌ بنفسه: يُنشئ عميلاً يدوياً في
[وحدة اعتماد Google](https://console.cloud.google.com/apis/credentials) — والتسجيلُ
الديناميكي (RFC 7591) غير مدعوم. ولا يوجد — ولن يوجد — تفويضٌ يُدخل وكيلاً إلى
بيانات طالبٍ نيابةً عنه؛ ولذلك `delegated_agent_access` مُطفأ.

```json
{
  "agent_auth": {
    "skill": "https://usedarb.com/.well-known/agent-skills/agent-auth/SKILL.md",
    "register_uri": "https://usedarb.com/api/agent/claim",
    "identity_types_supported": [
      "anonymous"
    ],
    "anonymous": {
      "credential_types_supported": [
        "none"
      ],
      "claim_uri": "https://usedarb.com/api/agent/claim"
    },
    "claim_uri": "https://usedarb.com/api/agent/claim",
    "public_api": {
      "auth_required": false
    },
    "authorization_servers": [
      "https://accounts.google.com"
    ],
    "protected_resource_metadata": "https://usedarb.com/.well-known/oauth-protected-resource",
    "authorization_server_metadata": "https://usedarb.com/.well-known/oauth-authorization-server",
    "documentation": "https://usedarb.com/auth.md",
    "credential_types_supported": [
      "oauth2_access_token",
      "oidc_id_token"
    ],
    "token_endpoint_auth_methods": [
      "client_secret_post",
      "client_secret_basic"
    ],
    "revocation_uri": "https://oauth2.googleapis.com/revoke",
    "dynamic_client_registration": false,
    "registration_type": "manual",
    "client_registration_uri": "https://console.cloud.google.com/apis/credentials",
    "delegated_agent_access": false
  }
}
```

`identity_types` بشريٌّ وحده و`delegated_agent_access` مُطفأ عن قصد: لا يدخل
وكيلٌ نيابةً عن طالبٍ إلى بياناته في درب.

## التواصل
support@usedarb.com · [توثيق الواجهة](https://usedarb.com/docs/api)
