-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
List currently authorized scopes on 403 #11720
List currently authorized scopes on 403 #11720
Conversation
We cannot be certain that the 403 error is caused by insufficient permissions, so while displaying which scopes should be used also display which scopes are in use.
err = fmt.Errorf("is the account using at least one of the following oauth scopes?: %s", oauthScopes) | ||
authorizedScopes := resp.Header.Get("X-OAuth-Scopes") | ||
if authorizedScopes == "" { | ||
authorizedScopes = "no" |
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.
Personally, I don't like setting the authorizedScopes
to "no"
here...but I can't figure out how to make the message pretty without it. 🤔
Seems fine for me /lgtm |
LGTM label has been added. Git tree hash: 3dd1156bd949bad3d3c3862e872d8e7283cd629a
|
/approve Thanks @nikhita |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nikhita, stevekuznetsov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
We cannot be certain that the 403 error is caused by insufficient permissions, so while displaying which scopes should be used also display which scopes are in use currently so that it's easier to debug.
Ref: #3647 (comment)
Context for this change: peribolos currently fails with:
I haven't really figured out the root cause of the error yet but it seemed weird that the token didn't have the org admin scope....it'd be useful to also list the oauth scopes that the token currently uses so that it's easier to debug in the future.
/cc @stevekuznetsov @cjwagner @fejta @spiffxp