-
Notifications
You must be signed in to change notification settings - Fork 4
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: [CI-12041]: add oidc support #6
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.
Initial review.
I would highly recommend make the flows isolated where either it's an OIDC flow or basic auth flow.
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.
Looks good overall. Let's address the remaining comments.
internal/gcp/tokenutil.go
Outdated
name := "projects/-/serviceAccounts/" + serviceAccountEmail | ||
// rb (request body) specifies parameters for generating an access token. | ||
rb := &iamcredentials.GenerateAccessTokenRequest{ | ||
Scope: []string{"https://www.googleapis.com/auth/cloud-platform"}, |
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.
Use constant here
) | ||
|
||
// decode the token if base64 encoded | ||
decoded, err := base64.StdEncoding.DecodeString(password) |
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.
add back base64 decoding for password . it will break existing flow otherwise
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
Tested changes via end-to-end execution with DLC FF enabled and disabled cases.
Tested the execution on Linux Hosted Machine, with 'PL_GCP_OIDC_AUTHENTICATION` FF enabled for OIDC.
Was able to Build a docker image and push it into the GCR repo using the OIDC auth method.
Below are some screen-shots of the executions.
Able to successfully test the changes, please check the jira for more details.