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

Implement BearerTokenChallengeAuthenticationPolicy #18368

Merged
23 commits merged into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/core/Azure.Core/src/Azure.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<ItemGroup>
<Compile Remove="Shared\**\*.cs" />
<Compile Include="Shared\Argument.cs" />
<Compile Include="Shared\AzureCoreSharedEventSource.cs" />
<Compile Include="Shared\AzureKeyCredentialPolicy.cs" />
<Compile Include="Shared\AzureSasCredentialSynchronousPolicy.cs" />
<Compile Include="Shared\Base64Url.cs" />
Expand Down
25 changes: 25 additions & 0 deletions sdk/core/Azure.Core/src/Shared/AzureCoreSharedEventSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Diagnostics.Tracing;

namespace Azure.Core.Diagnostics
{
[EventSource(Name = EventSourceName)]
internal sealed class AzureCoreSharedEventSource : EventSource
{
private const string EventSourceName = "Azure-Core-Shared";
Copy link
Member

Choose a reason for hiding this comment

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

Curious why we actually need / care about a separate source for shared sources, though? Even though the sources are shared, do we feel it's not still part of "Core" as a concept? Or is this more of a case of not muddying the Core event waters?

/cc @pakrym

Copy link
Member Author

Choose a reason for hiding this comment

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

Initially I had this in experimental, so this may not be necessary anymore.


private const int BackgroundRefreshFailedEvent = 19;

private AzureCoreSharedEventSource() : base(EventSourceName, EventSourceSettings.Default, AzureEventSourceListener.TraitName, AzureEventSourceListener.TraitValue) { }

public static AzureCoreSharedEventSource Singleton { get; } = new AzureCoreSharedEventSource();

[Event(BackgroundRefreshFailedEvent, Level = EventLevel.Informational, Message = "Background token refresh [{0}] failed with exception {1}")]
public void BackgroundRefreshFailed(string requestId, string exception)
{
WriteEvent(BackgroundRefreshFailedEvent, requestId, exception);
}
}
}
Loading