fix(gitea): add write:repository scope to Gitea OAuth#124
Open
AminDhouib wants to merge 1 commit into
Open
Conversation
Gitea's `repo` scope maps to read:repository only, so creating webhooks via POST /api/v1/repos/{owner}/{repo}/hooks fails without write:repository. Add write:repository to all three Gitea OAuth scope locations: the authorize endpoint, the client-side OAuth URL builder, and the gitea table default scopes.
8108331 to
8c28e2c
Compare
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.
Ports Dokploy#4413 by @lamualfa.
Gitea's
repoOAuth scope maps toread:repositoryonly, so creating webhooks (POST /api/v1/repos/{owner}/{repo}/hooks) fails with the current scopes. This addswrite:repositoryto the Gitea OAuth scope in all three locations:apps/dokploy/pages/api/providers/gitea/authorize.ts— server-side OAuth authorize URLapps/dokploy/utils/gitea-utils.ts— client-side OAuth URL builderpackages/server/src/db/schema/gitea.ts—gitea.scopescolumn defaultScope of this port: only the OAuth scope fix. Upstream's PR also introduces an auto-webhook-creation feature (
createGiteaWebhookplus wiring in the application/compose routers); that larger change is intentionally not included here. No DB migration is included — the.default()change requires none (upstream ships no migration either, and the column is not read when building the OAuth request).