Skip to content

CDRIVER-4081 Add support for AssumeRoleWithWebIdentity in AWS Auth #1211

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 15 commits into from
Mar 14, 2023

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Mar 1, 2023

Summary

  • Add support for AssumeRoleWithWebIdentity in AWS Auth

Other improvements

  • Fix length in _mongoc_http_send.
  • Fix size arg in bin_to_hex utility.
  • Ignore NULL for bson_string_free.

AWS tasks were verified in this Evergreen patch build.

Background & Motivation

The specification change is described in DRIVERS-1746.

generate_AWS_ROLE_SESSION_NAME generates a random 32 character hex string to generate AWS_ROLE_SESSION_NAME if needed:

If AWS_ROLE_SESSION_NAME is set, it MUST be used for the RoleSessionName parameter, otherwise a suitable random name can be chosen.

https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html lists the constraints for RoleSessionName:

Length Constraints: Minimum length of 2. Maximum length of 64.
Pattern: [\w+=,.@-]*

Follows pattern of other destroy / free functions in libbson and libmongoc
rename expiration_to_timer to expiration_iso8601_to_timer
`datalen` is capacity of the buffer.
The size argument includes the NULL byte
@kevinAlbs kevinAlbs marked this pull request as ready for review March 1, 2023 18:19
@kevinAlbs kevinAlbs requested a review from eramongodb March 2, 2023 21:12
Copy link
Contributor

@eramongodb eramongodb left a comment

Choose a reason for hiding this comment

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

Feedback regarding double -> int64_t conversion; otherwise, LGTM.

@kevinAlbs kevinAlbs merged commit d838ef2 into mongodb:master Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants