Get a gist REST API returns 401 #173621
-
Select Topic AreaBug BodyThe Get a gist endpoint (https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28#get-a-gist) used to work without authentication but now fails with status 401. curl -L \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/gists/46a4024f8afa0c13a54b6d6645f7371f
{
"message": "Requires authentication",
"documentation_url": "https://docs.github.com/rest",
"status": "401"
}%We have been relying on this API for the Share via GitHub feature of https://lit.dev/playground/ where a user can sign in to create a (secret) gist of their playground with an authenticated call and can share the link to anyone to view as the request to retrieve the gist could be unauthenticated. This stopped working in the last few days. I'm hoping this as a bug as this used to work and the documentation above does not list 401 as a possible response status, and is in line with general gist access patterns that secret gists are accessible to anyone with a link as described in https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists#about-gists. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
I can confirm the issue also exists for public gists of a user. Invoke-RestMethod -Uri "https://api.github.com/users/StartAutomating/gists"This has been giving me 401s and breaking a build since ~15 hours ago. First Broken Build Attempting to work around it by giving a workflow a GITHUB_TOKEN yields:
Please fix. Will have to disable this feature-set for now. |
Beta Was this translation helpful? Give feedback.
-
|
It is weird/inconsistent that the documentation page (here) says
( I'm experiencing this with my game engine here - increpare/PuzzleScript#1117 - we use anonymous gists for sharing, like the OP (e.g. https://www.puzzlescript.net/play.html?p=79543dee97fb5aaab6a267de31e186b3 no longer works unless you log into github via puzzlescript.net before (EDIT#2 - fixed by moving things to the server) ); requiring people to log in to play games is a non-starter. I guess if this is the new normal I'll have to move a bunch of stuff server-side? ) (EDIT#1: also affects flickgame increpare/flickgame#77 and a few other engines of mine, but only flickgame and puzzlescript are regularly in use) |
Beta Was this translation helpful? Give feedback.
-
|
According to the API docs, changing authentication requirements should only happen with a new API version: https://docs.github.com/en/rest/about-the-rest-api/breaking-changes?apiVersion=2022-11-28 Since the API has been stable for some time, I'm hopeful this is a bug and will be fixed quickly. (Another puzzlescript user here - this issue causes dozens of my games to be unplayable.) |
Beta Was this translation helpful? Give feedback.
-
|
Found a similar behaviour when fetching this endpoint: const response = await fetch(
`https://api.github.com/app-manifests/${code}/conversions`,
{
method: 'POST',
headers: {
'Accept': 'application/vnd.github+json',
'Content-Type': 'application/json',
},
}
);Until yesterday worked just fine without token. we are following the manifest flow to register a GitHub App. Suddenly it returns Unauthorized: {
"message": "Requires authentication",
"documentation_url": "https://docs.github.com/rest",
"status": "401"
}Funny enough if you add a github token without any permissios in the requests works fine as before. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
The issue, as stated in the first post, appears to be resolved. |
Beta Was this translation helpful? Give feedback.
The issue, as stated in the first post, appears to be resolved.
Ref: https://www.githubstatus.com/incidents/3kjv06tdxxfn