Skip to content

add account id to supproted identity providers#3289

Merged
sbiscigl merged 1 commit intomainfrom
provider-account-id
Feb 10, 2025
Merged

add account id to supproted identity providers#3289
sbiscigl merged 1 commit intomainfrom
provider-account-id

Conversation

@sbiscigl
Copy link
Copy Markdown
Contributor

@sbiscigl sbiscigl commented Feb 7, 2025

Description of changes:

Adds the ability for support identity providers to retrieve Account ID when used.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Aws::String m_secretKey;
Aws::String m_sessionToken;
Aws::Utils::DateTime m_expiration;
Aws::String m_accountId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we make this optional. so that its easy to check validity for the new field. Since this is not a required field

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

expiration is optional and we treat it the same way, so i would prefer to treat this the same rather than introduce crt optional to this

/**
* Initializes object with accessKeyId, secretKey, sessionToken, expiration date and account Id.
*/
AWSCredentials(const Aws::String& accessKeyId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same needs to be extended to AwsCredentialIdentityBase.h and all smithy creds classes for completion

Copy link
Copy Markdown
Contributor Author

@sbiscigl sbiscigl Feb 7, 2025

Choose a reason for hiding this comment

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

we return empty by default in smithy, i dont follow this comment, we only override when it is needed, and it is only needed on AwsCredentialIdentity

return Aws::Crt::Optional<DateTime>();
};

virtual Aws::Crt::Optional<Aws::String> accountId() const {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not return by const reference?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we return expiration by value, why should we make it different for accountId?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's return by value,
yes, it is an additional copy, but it saves us from not being able to override this class with some different implementation that computes account id at runtime only and never stores it as a member variable.

@sbiscigl sbiscigl force-pushed the provider-account-id branch 2 times, most recently from aa73452 to e220a46 Compare February 7, 2025 20:52
@sbiscigl sbiscigl force-pushed the provider-account-id branch from e220a46 to 364f412 Compare February 7, 2025 20:57
@sbiscigl sbiscigl force-pushed the provider-account-id branch from 364f412 to 033416f Compare February 7, 2025 21:03
@sbiscigl sbiscigl force-pushed the provider-account-id branch from 033416f to 4416f82 Compare February 7, 2025 21:20
@sbiscigl sbiscigl marked this pull request as ready for review February 10, 2025 13:59
@sbiscigl sbiscigl merged commit 4012ba9 into main Feb 10, 2025
2 of 3 checks passed
@sbiscigl sbiscigl deleted the provider-account-id branch February 10, 2025 13:59
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