-
Couldn't load subscription status.
- Fork 3
Add option to not inject gitlab tokens #769
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
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.
Why not write the logic in internal/revproxy/main.go, in RegisterHandlers() and initializeAuth()? It would be much simpler to follow and understand which middlewares are affected by the change of configuration.
When enableV1Services is false, then you can:
- Skip initialization of:
coreSvcIdTokenAuthdataGitlabAccessTokenAuthgitlabTokenAuthgitlabCliTokenAuthnotebooksGitlabAccessTokenAuth
- Update how the revproxy is initialized in
RegisterHandlers()
internal/revproxy/auth.go
Outdated
| Middleware() echo.MiddlewareFunc | ||
| } | ||
|
|
||
| func NewAuthMiddlewareProvider(ignoreGitlabTokens bool, options ...AuthOption) (AuthMiddlewareProvider, error) { |
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.
If I set ignoreGitlabTokens to true on a middleware that has nothing to do with GitLab, it will skip the auth entirely too, so the way the arguments are named here are an anti-pattern.
internal/config/config.yaml
Outdated
| revproxy: | ||
| renkuBaseUrl: "https://renkulab.io" | ||
| externalGitlabUrl: | ||
| ignoreGitlabTokens: false |
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.
Misnomer: use enableV1Services: false, or use skipGitlabTokens: true
| } | ||
| return srv, url | ||
| } | ||
| // TODO Unused code. Can it be deleted? |
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.
Probably yes. There may have been a test using this in the past.
b8bb8ca to
20d3471
Compare
Thanks for the review. I made the changes around wording to avoid confusion in the names and semantics of some of the variables and parameters. I agree that putting this logic in It looks like I will not be able to complete this task, and, since it overlaps with some tasks you have coming up, feel free to use the changes in this PR, or ignore them and implement it in a different way. |
|
Note: superseded by #770. |
No description provided.