Skip to content

Commit a9fb18b

Browse files
authored
[Storage] show oauth token in debug log in debug build only (#17986)
1 parent 8ed242c commit a9fb18b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Show OAuth token in debug log in debug build only
22+
- `New-AzStorageContext`
2123

2224
## Version 4.5.0
2325
* Supported DaysAfterLastTierChangeGreaterThan in Management Policy

src/Storage/Storage/Common/AzureSessionCredential.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ public override AccessToken GetToken(TokenRequestContext requestContext, Cancell
5656
{
5757
token = new AccessToken(tokenValue, DateTimeOffset.UtcNow);
5858
});
59+
#if DEBUG
5960
if (this.debugLogWriter != null)
6061
{
6162
this.debugLogWriter("[" + DateTime.Now.ToString() + "] GetToken: " + token.Token);
6263
}
64+
#endif
6365
return token;
6466
}
6567

src/Storage/Storage/Common/Cmdlet/NewAzureStorageContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,9 @@ private string GetTokenStrFromAccessToken(IAccessToken accessToken)
532532
{
533533
tokenStr = tokenValue;
534534
});
535+
#if DEBUG
535536
WriteDebug(DateTime.Now.ToString() + ": token:" + tokenStr);
537+
#endif
536538
return tokenStr;
537539
}
538540

0 commit comments

Comments
 (0)