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 more logging and small enhacement to an int test #2680

Merged
merged 2 commits into from
Jun 7, 2021
Merged

Conversation

bgavrilMS
Copy link
Member

Fixes - no work item, need more logging for investigation.

Changes proposed in this request

  • log app config hash code, to be able to tell if requests belong to same app
  • rename DefaultLogger to AppLogger
  • enhance an integration test to use WithAuthority at request level

Testing

Performance impact

//await RunOnBehalfOfTestAsync(aadUser2, false).ConfigureAwait(false);
//await RunOnBehalfOfTestAsync(adfsUser, true).ConfigureAwait(false);
//await RunOnBehalfOfTestAsync(aadUser2, true).ConfigureAwait(false);
//await RunOnBehalfOfTestAsync(aadUser2, false, true).ConfigureAwait(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for commenting these?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, reverting.

private void LogReturnedToken(AuthenticationResult result)
{
if (result.AccessToken != null &&
AuthenticationRequestParameters.RequestContext.Logger.IsLoggingEnabled(LogLevel.Info))
{
int appHashCode = AuthenticationRequestParameters.AppConfig.GetHashCode();
Copy link
Contributor

@pmaytak pmaytak Jun 4, 2021

Choose a reason for hiding this comment

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

  • Maybe rename here and in log below to appConfigHashCode?
  • In which scenario would this hash code be useful?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the hash code is useful to know the instance of confidential client being used to track how many CCA are created.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, just as Neha stated, it's used to differentiate between different CCA objects. It's to be able to tell if ppl are using 1 or more instances of CCA object, as it has cache implications.

Copy link
Member

@trwalke trwalke left a comment

Choose a reason for hiding this comment

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

I think this is a good idea.
LGTM

@bgavrilMS bgavrilMS merged commit 64a098b into master Jun 7, 2021
@bgavrilMS bgavrilMS deleted the bogavril/arli branch June 7, 2021 14:32
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.

4 participants