> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OAuth Applications Koleksiyonu

`oauthApplications`, web'in bildiği OAuth istemcilerini tutar. Bir belge bir istemcidir. Ayakaleaf Pro'da buraya yalnızca `git-bridge` web modülü yazar: web başlarken `Overleaf Git Bridge` adlı tek bir istemci oluşturur. Şema `services/web/app/src/models/OauthApplication.mjs` dosyasındadır.

#### Alanlar

| Alan | Tür | Anlam | Kaynak |
| - | - | - | - |
| `_id` | ObjectId | İstemci belgesinin id'si. `oauthAccessTokens.oauthApplication_id` ve `oauthAuthorizationCodes.oauthApplication_id` buna işaret eder. | `OauthApplication.mjs:5` |
| `id` | String | İstemci id'si: 64 rastgele küçük harf ve rakam. | `OauthApplication.mjs:7`, `services/web/modules/git-bridge/index.mjs:25` |
| `clientSecret` | String | İstemci gizli anahtarı; `v1.` ve ardından 32 rastgele karakter olarak yazılır. Yalnızca `getClient` okur ve hiçbir şey `getClient` çağırmaz (Notlar'a bakın). | `OauthApplication.mjs:8`, `git-bridge/index.mjs:26` |
| `grants` | Array of String | Grant türleri. git-bridge istemcisinde `['password']` bulunur. Bir token denetlenirken istemciyle birlikte döndürülür (`services/web/modules/oauth2-server/app/src/OAuth2Model.mjs:67-72`). | `OauthApplication.mjs:9`, `git-bridge/index.mjs:27` |
| `name` | String | İstemci adı. git-bridge modülü ve kişisel erişim tokeni kodu istemciyi `Overleaf Git Bridge` adıyla bulur. | `OauthApplication.mjs:10`, `git-bridge/index.mjs:15-16,28` |
| `redirectUris` | Array of String | İzin verilen yönlendirme URI'leri. git-bridge istemcisi için `[]`. | `OauthApplication.mjs:11`, `git-bridge/index.mjs:29` |
| `scopes` | Array of String | İstemcinin kullanabileceği scope'lar. git-bridge istemcisi için `['git_bridge']`. | `OauthApplication.mjs:12`, `git-bridge/index.mjs:30` |
| `pkceEnabled` | Boolean | Yalnızca şemada: bu depodaki hiçbir kod onu yazmaz ve yalnızca kullanılmayan `getClient` okur (`OAuth2Model.mjs:207`). | `OauthApplication.mjs:13` |

#### Kim yazar

| Kod | Ne yapar |
| - | - |
| `git-bridge/index.mjs:9-35` (module `git-bridge`) | `GIT_BRIDGE_ENABLED` `true` olduğunda, bu adda bir istemci yoksa web başlarken `Overleaf Git Bridge` istemcisini oluşturur. |

#### Kim okur

| Kod | Ne yapar |
| - | - |
| `services/web/modules/oauth2-server/app/src/OAuthPersonalAccessTokenManager.mjs:53-61` (module `oauth2-server`) | `Overleaf Git Bridge` istemcisini adıyla bulur ve `_id` değerini her yeni kişisel erişim tokenine kaydeder. İstemci yoksa token oluşturulmaz. |
| `OAuth2Model.mjs:31-39,67-72` (`getAccessToken`) | Bir tokenin istemcisini `oauthApplication_id` üzerinden yükler ve `id` ile `grants` değerlerini döndürür. |
| `OAuth2Model.mjs:185-209,241,275` (`getClient`, `saveToken`, `saveAuthorizationCode`) | İstemcileri `id` ile arar. Bu depoda hiç çalışmaz, Notlar'a bakın. |

#### İndeksler

Yalnızca varsayılan `_id` indeksi vardır. Benzersiz `id_1` indeksi yalnızca `saas` (`20190912145016_create_oauthApplications_indexes.mjs`) ve `server-pro` (`20230502180757_server_pro_oauth_indexes.mjs`) etiketli migration'lardan gelir; Community Edition bunları çalıştırmaz.

#### Notlar

* Web, `@node-oauth/oauth2-server` kütüphanesini yalnızca bearer tokenleri denetlemek için kullanır (`services/web/app/src/Features/Authentication/AuthenticationController.mjs:409-450` içindeki `server.authenticate`); bu da modelin yalnızca `getAccessToken` ve `verifyScope` metotlarını çağırır. `/oauth/token` veya `/oauth/authorize` sunan bir route yoktur, bu yüzden `getClient`, `saveToken` ve `saveAuthorizationCode` hiç çağrılmaz.
* Modül istemciyi önce adıyla arar, sonra oluşturur ve Community Edition'da `name` veya `id` üzerinde benzersiz indeks yoktur. Dolayısıyla aynı adda ikinci bir istemciyi hiçbir şey engellemez. İstemciye ihtiyaç duyan kod, `findOne` hangisini döndürürse onu kullanır.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.