Skip to content

GODRIVER-2728: Implement automatic Azure token acquisition callback #1703

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

Merged
merged 85 commits into from
Jul 22, 2024

Conversation

pmeredit
Copy link
Collaborator

Summary

Implement automatic Azure token acquisition callback

Background & Motivation

required by OIDC epic

pmeredit added 30 commits June 11, 2024 18:05
…r OIDC that is probably, maybe, possibly correct
… need to get down to Handshake instead of creating the Authenticator in Handshake as we do now
@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Jul 15, 2024
Copy link
Contributor

API Change Report

No changes found!

@qingyang-hu qingyang-hu requested a review from matthewdale July 15, 2024 18:43
@pmeredit
Copy link
Collaborator Author

@qingyang-hu sorry about the bot request, I was waiting for static analysis before adding reviewers

@@ -1975,6 +1975,31 @@ tasks:
commands:
- func: "run-oidc-auth-test-with-test-credentials"

- name: "oidc-auth-test-azure-latest"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the test is compiled ahead of time and just the compiled exe is ran on the azure vm. This matters more for gcp vm which is far slower, but it's good to be consistent

Comment on lines 212 to 215
var azureResp struct {
AccessToken string `json:"access_token"`
ExpiresOn string `json:"expires_on"`
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional: You can skip the separate integer parsing step by using the ,string struct tag option for ExpiresOn.

E.g.

var azureResp struct {
	AccessToken string `json:"access_token"`
	ExpiresOn   int64  `json:"expires_on,string"`
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, cool!

@pmeredit pmeredit requested a review from matthewdale July 22, 2024 17:02
Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@pmeredit pmeredit merged commit 9a02911 into mongodb:v1 Jul 22, 2024
21 of 22 checks passed
@pmeredit pmeredit deleted the GODRIVER-2728 branch July 22, 2024 20:09
blink1073 pushed a commit to blink1073/mongo-go-driver that referenced this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants