feat(gitlab): Dynamic Client Registration (DCR) for self-hosted instances#123
Closed
jaysomani wants to merge 3 commits into
Closed
feat(gitlab): Dynamic Client Registration (DCR) for self-hosted instances#123jaysomani wants to merge 3 commits into
jaysomani wants to merge 3 commits into
Conversation
…hosted instances Adds registerDynamicClient() and discoverDcrEndpoint() to the GitLab VCS adapter. DCR (RFC 7591) allows Appwrite to auto-register as an OAuth client on self-hosted GitLab instances (18.6+) without requiring manual admin setup. - registerDynamicClient(): POSTs to /oauth/register, returns public PKCE client_id - discoverDcrEndpoint(): checks /.well-known/oauth-authorization-server/api/v4/mcp - Handles all failure cases explicitly (404=old GitLab, 403=disabled, 429=rate limit) - Adds callDcr(), an overridable protected helper for calls outside /api/v4, so unit tests can stub GitLab responses without a real instance or mocking library - Unit tests for all success/failure paths (16 tests, no network dependency) - E2E tests against the docker-compose GitLab 18.10 instance GitLab DCR reference: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197644 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…hosted instances Adds registerDynamicClient() and discoverDcrEndpoint() to the GitLab VCS adapter. DCR (RFC 7591) allows Appwrite to auto-register as an OAuth client on self-hosted GitLab instances (18.6+) without requiring manual admin setup. - registerDynamicClient(): POSTs to /oauth/register, returns public PKCE client_id - discoverDcrEndpoint(): checks /.well-known/oauth-authorization-server/api/v4/mcp - Handles all failure cases explicitly (404=old GitLab, 403=disabled, 429=rate limit) - Adds callDcr(), an overridable protected helper for calls outside /api/v4, so unit tests can stub GitLab responses without a real instance or mocking library - Unit tests for all success/failure paths (16 tests, no network dependency) - E2E tests against the docker-compose GitLab 18.10 instance GitLab DCR reference: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197644 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds DCR support (RFC 7591) for self-hosted GitLab 18.6+ instances.
New methods on the GitLab VCS adapter:
registerDynamicClient(string $endpoint, string $redirectUri): array— registers Appwrite as a public PKCE OAuth client via POST /oauth/register, returns client_id (no secret)discoverDcrEndpoint(string $endpoint): ?string— checks /.well-known/oauth-authorization-server/api/v4/mcp for DCR availability, returns null if unsupportedKey implementation details:
Reference: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/197644