-
Notifications
You must be signed in to change notification settings - Fork 285
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
[POC] AAD: Configuring ServerTelemetryChannel and QuickPulseServiceClient #2220
Closed
Closed
Changes from all commits
Commits
Show all changes
116 commits
Select commit
Hold shift + click to select a range
84eba5c
getting started. defining classes and tests
TimothyMothra 180c039
more tests. currently passing
TimothyMothra d501eef
cleanup
TimothyMothra 5a556d3
saving work in progress
TimothyMothra 2f7f7f8
cleanup
TimothyMothra 9beac17
cleanup
TimothyMothra 14b65b2
cleanup
TimothyMothra 8446075
save work in progress. all tests passing
TimothyMothra 0fe4b8c
cleanup
TimothyMothra 52785bb
change interface to abstract class.
TimothyMothra acb3fd0
cleanup
TimothyMothra 66592c9
working reflection for GetTokenAsync
TimothyMothra 33570ec
cleanup. tests pass
TimothyMothra f181df5
cleanup
TimothyMothra 7b30407
rewriting reflection to fully use Expression.Lambda. tests partially …
TimothyMothra 4e38ac2
cleanup
TimothyMothra 862d3f2
change from Lambda<Func> to LambdaExpression. Tests pass
TimothyMothra ddcbecd
have a working example of aysnc + Expression tree. need to cleanup
TimothyMothra 0a82f7b
this works. tests pass. needs significant cleanup.
TimothyMothra 47ce7e5
significant refactor. cleanup. all tests pass
TimothyMothra 76fd2d7
update scope
TimothyMothra c5e44de
save change to publicapi doc
TimothyMothra 46f35e6
cleanup
TimothyMothra dade297
TokenCredential + QuickPulse
TimothyMothra 2464125
set default in abstract class
TimothyMothra c387eaa
update header key
TimothyMothra 9f5e579
finished mapping out how to set CredentialEnvelope on all TelemetryCh…
TimothyMothra f2ac1d8
update request header. move to constants
TimothyMothra 8a93434
Merge branch 'develop' into tilee/feature_aad
TimothyMothra 159bbc9
update publicapi
TimothyMothra 8061c8c
Merge branch 'tilee/feature_aad' into tilee/feature_aad_w_config
TimothyMothra d43a0a6
sample app and some minor fixes
TimothyMothra 39632eb
fix
TimothyMothra f03f03f
Merge branch 'develop' into tilee/feature_aad
TimothyMothra fe3ad16
Merge branch 'tilee/feature_aad' into tilee/feature_aad_w_config
TimothyMothra 8a498d5
remove sample app
TimothyMothra 67d2780
remove samples app
TimothyMothra 4f2a33d
undo
TimothyMothra 5ad8a6d
fix
TimothyMothra 7940b0f
changing scope
TimothyMothra 740c1d0
merge develop
TimothyMothra e8316e0
merge develop
TimothyMothra e3cefeb
fxcop
TimothyMothra 003873b
Merge branch 'develop' into tilee/feature_aad
TimothyMothra 1ff482a
fix dependencies
TimothyMothra 87876f2
fix dependencies
TimothyMothra 930ef53
Merge branch 'develop' into tilee/feature_aad
TimothyMothra c9735a9
add new project
TimothyMothra b0b4b7e
add .Net v5 to linux build definition
TimothyMothra ca89417
cleanup
TimothyMothra 5a4d63e
testing change to linux definition
TimothyMothra e4050ec
add support for net5.0 to Microsoft.ApplicationInsights.Tests.csproj
TimothyMothra 5773479
fix for TimeSpan cannot be null
TimothyMothra 926a6e7
fix
TimothyMothra 0412341
remove extra test project
TimothyMothra 0bcd87f
cleanup yml
TimothyMothra 57088cb
disabling netcoreapp 2.1 in linux build.
TimothyMothra bbecdd8
Merge branch 'tilee/aad_newtestproject' into tilee/feature_aad
TimothyMothra a7c3462
migrate AAD tests to Base Test project
TimothyMothra 5d6011a
update Endpoints for Ingestion
TimothyMothra edb4e57
merge develop
TimothyMothra d4b0378
moving tests to Base Test project
TimothyMothra a82e321
remove Authentication.Test project
TimothyMothra 393f0a2
remove change to AssemblyInfo
TimothyMothra 0bf32ba
resolving merge conflict
TimothyMothra f1e7a4f
Merge branch 'tilee/feature_aad' into tilee/feature_aad_w_config
TimothyMothra 6d8a741
implementing the ingestion api switch. Needs tests
TimothyMothra 5e3ef5d
Revert "resolving merge conflict"
TimothyMothra dbe07d0
Merge branch 'develop' into tilee/feature_aad
TimothyMothra dc11249
Merge branch 'develop' into tilee/feature_aad
TimothyMothra 7d6ad67
remove Azure.Core dependency
TimothyMothra 2f3b668
cleanup csproj
TimothyMothra 4b9b761
cleanup EOF
TimothyMothra 4cf03ca
cleanup test
TimothyMothra 62bbe38
cleanup. removing abstract class CredentialEnvelope
TimothyMothra aac78ed
fxcop
TimothyMothra d70ce25
merge tilee/feature_aad
TimothyMothra 080220f
merge conflict
TimothyMothra 06132de
resolve merge conflicts
TimothyMothra ad1f387
revert changes to EndpointContainer
TimothyMothra 52d8d2f
merge tilee/feature_aad
TimothyMothra 7bfe41e
add interface ICredentialEnvelope
TimothyMothra 6b00f3b
exception handling
TimothyMothra 957f33f
set ConfigureAwait(true)
TimothyMothra 86deb20
Merge branch 'tilee/feature_aad' into tilee/feature_aad_w_config
TimothyMothra f04ae0f
change to ICredentialEnvelope
TimothyMothra f04d2bd
saving work in progress
TimothyMothra 9c11def
saving work in progress
TimothyMothra a144672
merge develop
TimothyMothra 0fc7613
merge conflicts
TimothyMothra 0c9c2a2
merge conflicts
TimothyMothra fc97568
merge conflict.
TimothyMothra 6acc5bb
fix tests
TimothyMothra 3c1fcae
refactor
TimothyMothra 2053371
AAD: refactor
TimothyMothra 4ecdfc4
change property to internal
TimothyMothra 728081e
Merge branch 'develop' into tilee/aad_refactor
TimothyMothra fc1895a
merge refactor branch
TimothyMothra 8cdfde4
merge conflict
TimothyMothra f7a1d80
Merge branch 'develop' into tilee/feature_aad_w_config
TimothyMothra 2006cad
rename param
TimothyMothra abf9b3c
aad with InMemoryChannel
TimothyMothra 605b597
fix end of line
TimothyMothra cb2163d
configuration tests
TimothyMothra 6d049fb
Transmission tests
TimothyMothra 6e25d92
comments
TimothyMothra b077554
testing fix for InternalOperations
TimothyMothra 7f0f929
fxcop
TimothyMothra eebc0a3
comment about InternalOperations
TimothyMothra 8063dcf
cleanup
TimothyMothra 025ca3c
merge branch tilee/aad_inmemorychannel
TimothyMothra a99b09c
merge conflict
TimothyMothra 0f5dc3f
merge develop
TimothyMothra 11c6a6b
merge conflicts
TimothyMothra 461c9e7
cleanup
TimothyMothra 95f485d
merge develop
TimothyMothra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...icationInsights/Extensibility/Implementation/Authentication/ISupportCredentialEnvelope.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.Authentication | ||
{ | ||
/// <summary> | ||
/// This interface defines a class that accepts the <see cref="Authentication.CredentialEnvelope"/> as a property. | ||
/// </summary> | ||
internal interface ISupportCredentialEnvelope | ||
{ | ||
/// <summary> | ||
/// Gets or sets the <see cref="Authentication.CredentialEnvelope"/>. | ||
/// </summary> | ||
CredentialEnvelope CredentialEnvelope { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
using Microsoft.ApplicationInsights.Common.Extensions; | ||
using Microsoft.ApplicationInsights.Extensibility; | ||
using Microsoft.ApplicationInsights.Extensibility.Implementation; | ||
using Microsoft.ApplicationInsights.Extensibility.Implementation.Authentication; | ||
|
||
internal class TransmissionSender | ||
{ | ||
|
@@ -107,6 +108,15 @@ public virtual int ThrottleWindow | |
} | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the <see cref="CredentialEnvelope"/> which is used for AAD. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of "AAD", suggest "authorization" or "auth-token acquisition". |
||
/// </summary> | ||
/// <remarks> | ||
/// <see cref="ISupportCredentialEnvelope.CredentialEnvelope"/> on <see cref="ServerTelemetryChannel"/> sets <see cref="Transmitter.CredentialEnvelope"/> and then sets <see cref="TransmissionSender.CredentialEnvelope"/> | ||
/// which is used to set <see cref="Transmission.CredentialEnvelope"/> just before calling <see cref="Transmission.SendAsync"/>. | ||
/// </remarks> | ||
internal CredentialEnvelope CredentialEnvelope { get; set; } | ||
|
||
public virtual bool Enqueue(Func<Transmission> transmissionGetter) | ||
{ | ||
bool enqueueSucceded = false; | ||
|
@@ -197,9 +207,11 @@ private async Task StartSending(Transmission transmission) | |
try | ||
{ | ||
TelemetryChannelEventSource.Log.TransmissionSendStarted(acceptedTransmission.Id); | ||
acceptedTransmission.CredentialEnvelope = this.CredentialEnvelope; | ||
|
||
transmissionTask = acceptedTransmission.SendAsync(); | ||
this.inFlightTransmissions.TryAdd(transmission.FlushAsyncId, transmissionTask); | ||
responseContent = await transmissionTask.ConfigureAwait(false); | ||
responseContent = await transmissionTask.ConfigureAwait(false); | ||
} | ||
catch (Exception e) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really need this comment anymore since ISupportCredentialEnvelope is, itself, internal.