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

rename AccessToken to Secret and expand it's usage #1472

Merged
merged 5 commits into from
Nov 29, 2023

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

Brian Caswell added 3 commits November 27, 2023 18:13
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
19 checks passed
@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