-
Notifications
You must be signed in to change notification settings - Fork 31
feature/api-token-fields #1657
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
base: main
Are you sure you want to change the base?
feature/api-token-fields #1657
Conversation
|
Hey @golanglemonade can you review this. Also sorry for the delayed submission. |
|
@Achiket123 Looks like there are some failing tests after changing the function; can you take a look? |
|
@golanglemonade please see this |
On my list; no need to keep rebasing. I just need to do some testing + verify if we need to have backwards compatibility. Should get to it later today or tomorrow |
Sure, will be taking other issues. |
pkg/middleware/auth/auth.go
Outdated
| // Get access token from the request, if not available then attempt to refresh | ||
| // using the refresh token cookie. | ||
| bearerToken, err := auth.GetBearerToken(c) | ||
| var bearerToken string |
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.
@Achiket123 It looks like you switch to GetBearerToken but then back to this - can you explain why? if it's an issue with the function and the new token format the underlying function in iam should be updated instead.
| } | ||
|
|
||
| func isValidAPIToken(ctx context.Context, dbClient *ent.Client, token string) (*auth.AuthenticatedUser, string, error) { | ||
| t, err := fetchAPITokenFunc(ctx, dbClient, 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.
I was thinking about the best way to roll this out with existing API Tokens and I think we need to have a fallback to the old format - to ensure existing API tokens work and can be migrated. This should mean that we check new format -> if its not the valid format with id + secret -> fallback to old checks -> then error
|



resolves #1475