-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
GitHub Personal Access Token not working #801
Comments
Does your token have too many permissions? i.e. Does your token have just the permissions mentioned in the instructions or did you give it everything? |
Every permission. Should I just give it the permissions it says? |
I FIXED IT! THANKS @Daeraxa!! |
I think the Pulsar team should add a warning that you can only add those permissions. |
I was thinking something similar but I'm not sure we know which one (or which combination) is causing it to not work. So it might be possible (useful??) to add more than the minimum. |
Please also regenerate the token, if you haven't already, since those are meant to be secret, and the illustration you provided, which includes the token, can be used to impersonate or "authenticate as" you on GitHub's various services, including github.com. |
So. Here's what I see is happening, after some debugging: It looks like having the token lets you query the GitHub API and look up the token's scopes... and the amount of info GitHub returns to you about the scopes is a bit economical... the returned scopes don't explicitly include every "child" or "nested" scope if you have set a "parent scope" that includes it. So, when folks are setting the parent scope Some options to deal with this:
Warning loudly about excessive scopes would be good, in my view, since honestly I'd rather not have folks out there putting an "if this token leaks, you basically own everything in my account" level of token into the |
I also intend to update the "Make a token" link in the login instructions to point to this: https://github.com/settings/tokens/new?scopes=repo,workflow,user:email,read:org&description=Pulsar%20github%20package It pre-selects exactly the permissions we need, no more no less. |
Having a token with “too many” permissions fail to work is something I'd find completely flummoxing. I wouldn't think “oh, they're just making sure I create a token with minimal permissions”; I'd think something much more fundamental had gone wrong, and I'd probably waste time trying to troubleshoot the issue in places other than the I think we should check for the parent |
We could also explore the impact of not requiring I feel the I do agree that a pretty good and very simple way forward is definitely to also allow |
I agree with this take, any "superset" of a permission should work (even if it isn't a "real" superset as @DeeDeeG describes). Whether it is a good idea or not is another matter - for example if we did want to police this and say "please don't make a god token just for the GH package" then we should be detecting the unecessary scopes and failing with a descriptive error.
Really like this approach but I do also think we need to be detecting those extra scopes and either failing with a useful error or succeeding with "parent" scopes. |
The challenge with giving good feedback on the token is... the O.G. package's UI just seems to do nothing when you enter an "invalid" token. Posting an error message in the console would be easy (I was rather surprised they don't already log anything!). This would be an improvement. One more thing to do even in a quick pass for this issue, I suppose. What would be really nice, given how smooth and inviting the UI appears to be (and is, when the token is accepted)... what would be really nice is some feedback in the UI itself. Maybe a little infobox/popup warning over the text input field? UI wrangling is a bit outside of my familiarity with this package, so I think that would be more of a long-term goal... EDIT: there is supposed to be a message "Your token no longer has sufficient authorizations. Please re-authenticate and generate a new one." shown, seemingly in this exact circumstance. Hopefully we can wire it up properly so that shows... (Long-term goal). EDIT 2: It does show, see gif OP posted above. It just shows on an earlier screen than the actual token input screen. The token input screen should be updated to show feedback about this as well, IMO. The current to-do list for a quick-pass fix, as I see it:
Long term to-dos?:
This is something I'm working up to doing a PR for, once the dust settles a bit on vision for what a good quick-pass PR would look like. EDIT to add: The relevant bits are in |
Thanks in advance for your bug report!
What happened?
I literally CANNOT authorize a GitHub Personal Access Token. Please help.
Pulsar version
Pulsar 1.110.0
Which OS does this happen on?
🪟 Windows
OS details
Windows 11 22H2 22621.2428
Which CPU architecture are you running this on?
x86_64/AMD64
What steps are needed to reproduce this?
Issue reproduced
Additional Information:
The text was updated successfully, but these errors were encountered: