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
Renaming Git Provider Token header #1052
Conversation
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.
LGTM
pkg/server/middleware/middleware.go
Outdated
const ( | ||
tokenKey key = iota | ||
GRPCAuthMetadataKey = "grpc-auth" | ||
GitProviderTokenHeader = "X-Git-Provider-Token" |
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.
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.
sounds good, I'll remove the X-
prefix
ui/contexts/AppContext.tsx
Outdated
@@ -52,7 +52,7 @@ function wrapClient<T>(client: any, tokenGetter: () => string): T { | |||
...options, | |||
headers: new Headers({ | |||
...(options.headers || {}), | |||
Authorization: `token ${tokenGetter()}`, | |||
"X-Git-Provider-Token": `token ${tokenGetter()}`, |
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.
Can we make this a const
as well? For computed keys in JS objects:
"X-Git-Provider-Token": `token ${tokenGetter()}`, | |
[gitProviderTokenHeader]: `token ${tokenGetter()}`, |
This is for this PR https://github.com/weaveworks/weave-gitops/pull/965/files#diff-142329b4654445c09cf14ebc4afba7677e064ede74cb549a81e935b414156dd2R248 and the header in there is |
Closes: #971
What changed?
Why?
How did you test it?
Release notes
Documentation Changes