-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(app/web): bypass metrics.api.github.overuse
with OAuth
#1171
Conversation
return {login, graphql: octokit.graphql.defaults({headers: {authorization: `token ${token}`}}), rest: new OctokitRest.Octokit({auth: token})} | ||
} | ||
else if (session) | ||
console.debug(`metrics/app/session > unknown session ${session.substring(0, 6)}, using default octokit`) |
Check failure
Code scanning / CodeQL
Log injection
<body> | ||
Redirecting... | ||
<script> | ||
const query = new URLSearchParams(location.search) |
Check failure
Code scanning / CodeQL
SQL database query built from user-controlled sources (experimental)
localStorage.setItem("session.metrics", session) | ||
const to = query.get("to") | ||
if (to) | ||
window.location.href = to |
Check warning
Code scanning / CodeQL
Client-side cross-site scripting
localStorage.setItem("session.metrics", session) | ||
const to = query.get("to") | ||
if (to) | ||
window.location.href = to |
Check warning
Code scanning / CodeQL
Client-side URL redirect
The aim of this PR is to lets users authenticate themselves on a web instance through GitHub with OAuth so they can use their own token (instead of the shared one).
When authenticated, the
metrics.api.github.overuse
restriction would automatically be lifted allowing users to use plugins that consume much more API requests.It could also lead to additional features that would be available only when logged but not sure about this yet.
This PR also brings some UI changes, and also make it clearer which options are supported by the web instance depending on set policy