Skip to content
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

Update Google client initialisation to use MLP helper method #67

Conversation

deadlycoconuts
Copy link
Contributor

@deadlycoconuts deadlycoconuts commented Mar 28, 2023

What this PR does / why we need it:
With the introduction of a helper method in MLP (caraml-dev/mlp#78) to abstract away the creation of a Google client to append ID tokens to the headers of outgoing requests, that is authenticated with service or user accounts, this PR imports the said helper method and uses it to initialise its Google client.

This ensures that all outgoing requests from the Turing API server contain ID tokens in their headers.

Which issue(s) this PR fixes:

Fixes #

@deadlycoconuts deadlycoconuts added the enhancement New feature or request label Mar 28, 2023
@deadlycoconuts deadlycoconuts self-assigned this Mar 28, 2023
Comment on lines 581 to 585
googleClient, err = idtoken.NewClient(
context.Background(),
defaultCaraMLAudience,
idtoken.WithCredentialsFile(filepath),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be replacing this block with the new method InitGoogleClientFromCredentialsFile introduced in caraml-dev/mlp#79 (after this gets approved and merged) which initialises a Google client a specified file path for both service AND user accounts.

@deadlycoconuts deadlycoconuts requested a review from a team March 29, 2023 02:38
IgnoreStatusCodes: nil,
IgnoreStatusCodes: []int{},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change here is to address this change in behaviour of the unit tests: https://github.com/caraml-dev/xp/actions/runs/4545757610/jobs/8013518375#step:5:233

Copy link
Contributor

@krithika369 krithika369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deadlycoconuts, thanks for also testing out the plugin auth behavior and handling it. LGTM.

@deadlycoconuts deadlycoconuts merged commit 0c31d9a into caraml-dev:main Mar 30, 2023
11 checks passed
@deadlycoconuts deadlycoconuts deleted the update_google_client_initialisation branch March 30, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants