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

Add telemetry to the authorization and signout message redirect urls,… #529

Merged
merged 1 commit into from
Nov 30, 2016

Conversation

polita
Copy link
Contributor

@polita polita commented Nov 9, 2016

… along with a way to turn it off.

Also added tests for the telemetry parameters and the switch to turn it off.

@polita polita added this to the Next 4.x Release milestone Nov 9, 2016
/// </summary>
private void EnsureTelemetryValues()
{
if (DisableTelemetryParameters)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to remove these parameters? If we called Clone() before EnsureTelemetryValues, only values set by the runtime OR user would be in the message. Adding to the message would be on an instance temporary message. If we make this change, the property could be named: AddTelemetryParameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, if you were guaranteed that Clone was always called before EnsureTelemetryValues. My concern is that, in some future iteration of the code, someone changes the flow to not call Clone first, and then they expect that setting DisableTelemetryValues to true, and then to false, would remove them again. I can see your point though; if you think we shouldn't set up the code to ever remove the parameters, I'm fine with changing it.

@@ -137,12 +139,25 @@ public string CreateAuthenticationRequestUrl()
/// <returns>The uri to use for a redirect.</returns>
public string CreateLogoutRequestUrl()
{
EnsureTelemetryValues();
Copy link
Member

Choose a reason for hiding this comment

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

You may want to consider adding telemetry on the cloned message. Otherwise turning it off, would result in the second message having the parameters.

@polita
Copy link
Contributor Author

polita commented Nov 11, 2016

@brentschmaltz The PR is updated with your suggestions. Thanks...

@polita polita force-pushed the polita/498 branch 2 times, most recently from fc30226 to cd8b274 Compare November 18, 2016 00:29
@polita
Copy link
Contributor Author

polita commented Nov 28, 2016

@brentschmaltz Can you CR?

@polita
Copy link
Contributor Author

polita commented Nov 29, 2016

Updated with CR feedback from 5x change.

/// <summary>
/// Gets or sets whether parameters for the library and version are sent on the query string for all instances of <see cref="OpenIdConnectMessage"/>.
/// </summary>
public static bool EnableTelemetryParametersByDefault = true;
Copy link
Member

Choose a reason for hiding this comment

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

Could you make this a property also :-)

… along with a way to turn it off

Integrate CR feedback

Update unit test for code change

Update with CR suggestion to add telemetry on the newly-cloned message

Update with CR suggestion

Update PR with changes to the design to allow a static switch to turn telemetry off universally

Use the same reflection code we use for .NET Core

Update syntax with feedback from CR

Update with feedback from CR
@polita
Copy link
Contributor Author

polita commented Nov 30, 2016

@brentschmaltz Updated with the same property pattern from 5x using pre-C# 6.0 syntax.

@brentschmaltz
Copy link
Member

:shipit:

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.

3 participants