Skip to content

Conversation

demoray
Copy link
Contributor

@demoray demoray commented Nov 27, 2023

This does 3 things:

  1. Renames AccessToken to Secret
  2. Prevents Debug of the AccessToken from actually showing the secret
  3. Starts expanding the use of Secret to other areas, such as client certificates

This does 3 things:
1. Renames `AccessToken` to `Secret`
2. Prevents `Debug` of the `AccessToken` from actually showing the secret
3. Starts expanding the use of `Secret` to other areas, such as client certificates
Copy link
Member

@cataggar cataggar left a comment

Choose a reason for hiding this comment

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

I'm open to this. Is there precedence in any other Azure SDKs or libraries? .NET uses Azure.Core.AccessToken.
https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/src/AccessToken.cs


impl Debug for Secret {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("Secret").field(&"<REDACTED>").finish()
Copy link
Member

Choose a reason for hiding this comment

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

Nice

@demoray
Copy link
Contributor Author

demoray commented Nov 29, 2023

I'm open to this. Is there precedence in any other Azure SDKs or libraries? .NET uses Azure.Core.AccessToken. https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/src/AccessToken.cs

I don't know about wrapping secrets in a fashion like we've done.

As it relates to your link, the AccessToken implementation used in DotNet is what we call TokenResponse, as it includes both the token and an expiration date. It's my intention to rename TokenResponse to AccessToken once this PR lands, as that should impact different places.

@demoray demoray merged commit e7c2845 into Azure:main Nov 29, 2023
@demoray demoray deleted the rename-access-token-to-secret branch November 29, 2023 15:55
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.

2 participants