-
Notifications
You must be signed in to change notification settings - Fork 3
fix: use admin token for privatisation #1454
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
Conversation
| import { GitCommitResult } from "@root/types/gitfilesystem" | ||
| import { GitHubRepoInfo, RawGitTreeEntry, RepoState } from "@root/types/github" | ||
|
|
||
| import { E2E_TEST_GH_TOKEN } from "../middlewareServices/AuthenticationMiddlewareService" |
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.
do we actually have this token at run time or is it only during e2e on local
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.
Run time - we currently also use it for pr approval
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.
Not a blocker but The name of the token is very misleading
| // Privatising a repo is restricted to repo admins - an admin token will be inserted in via our axios interceptor | ||
| // Privatising a repo is restricted to repo admins - our main admin token is used | ||
| const headers = { | ||
| Authorization: "", |
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.
How come this was previously empty? Comment seems to say this was injected by the axios interceptor
If we are modifying to inject token here is the interceptor still needed
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.
interceptor always exists, and inserts in the token in cases where it doesn't exist (i.e. all email login actions). normally this is just to catch the github flow, where the user's personal github token wold be used (but they would lack perms)
In this case we're using the admin token for both flows, so no change
Uses our admin token to privatise repos, to fix github's changes to disallow write tokens to change repo status.