-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add commitstatus token scope #35383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add commitstatus token scope #35383
Conversation
now what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be also breaking change for CI integrations especially ones automatically creating access tokens and also already created ones will be invalid
I'm unsure about the use of permission units. I may want to reduce scope to access tokens only. And it seems that tokenRequiresScopes
is orthogonal to reqRepoWriter
.
@lafriks, I want to implement this in a way, that write:repo
should be sufficient to write to commit status. write:commitstatus
should be contained within write:repo
permission. This change should enable tokens with more granular scope.
This reverts commit 7c5cc63.
So commitstatus is shown in the UI. I can create tokens with write:commitstatus
. But I'm unable to write with only write:repo
. So it is indeed breaking at this moment.
{"message":"token does not have at least one of required scope(s), required=[write:commitstatus write:repository], token scope=write:repository","url":"http://localhost:3000/api/swagger"}
routers/api/v1/api.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still does not look right as Get method (Combo) should test read rights and Post - write rights
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed. I re-introduced reqRepoWriter
and Reader
middlewares. I'm getting an error that repository permissions are required. So there is something I don't understand in how these middlewares work.
Is there a way to write tests for routing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also what is the difference between unit and token permission?
Uh oh!
There was an error while loading. Please reload this page.
Adds
commitstatus
permission unit to enable more granular permissions for applications with stricter security policies.Resolves #32625
TODO: