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

Modify quick pulse code with authentication enabled #1678

Merged
merged 69 commits into from
May 21, 2021

Conversation

kryalama
Copy link
Contributor

@kryalama kryalama commented May 7, 2021

Modify quick pulse code to use azure core httppipeline and have aad authentication enabled


public static void init(AuthenticationType authenticationType, String clientId, String keePassDatabasePath,
String tenantId, String clientSecret, String authorityHost) {
AadAuthentication.instance = new AadAuthentication(authenticationType, clientId, keePassDatabasePath, tenantId,
Copy link
Contributor

Choose a reason for hiding this comment

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

synchronized block?

Copy link
Contributor

Choose a reason for hiding this comment

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

i know this will get called only once.. do we still need to prevent user from creating a new instance of AadAuthentication each time when init is called?

package com.microsoft.applicationinsights.internal.authentication;

public enum AuthenticationType {
UAMI, SAMI, INTELLIJ, VSCODE, CLIENTSECRET
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we document what each type is?

Copy link
Contributor

Choose a reason for hiding this comment

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

link to the azure doc will be helpful.

@lgtm-com
Copy link

lgtm-com bot commented May 13, 2021

This pull request introduces 1 alert when merging 503582d into 83b96b6 - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

@lgtm-com
Copy link

lgtm-com bot commented May 15, 2021

This pull request introduces 1 alert when merging 9c17075 into 83b96b6 - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

@lgtm-com
Copy link

lgtm-com bot commented May 15, 2021

This pull request introduces 1 alert when merging d123841 into 83b96b6 - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

👍


// handle AAD authentication
// TODO handle authentication exceptions
HttpPipelinePolicy authenticationPolicy = AadAuthentication.getInstance().getAuthenticationPolicy();
Copy link
Member

Choose a reason for hiding this comment

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

won't this fail auth not configured? getInstance() throws exception?

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 we call init() only when authentication is enabled. for now I removed the auth enabled check to create the authentication object. But we will end up with object with nullable variables.

@kryalama kryalama requested a review from trask May 18, 2021 21:38
@lgtm-com
Copy link

lgtm-com bot commented May 18, 2021

This pull request introduces 1 alert when merging 8602098 into 1ffad2b - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

did u mean to update the submodule in this PR?

@lgtm-com
Copy link

lgtm-com bot commented May 19, 2021

This pull request introduces 1 alert when merging 857c29f into 1ffad2b - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

@kryalama kryalama requested a review from trask May 19, 2021 21:57
@lgtm-com
Copy link

lgtm-com bot commented May 19, 2021

This pull request introduces 1 alert when merging 36d6e7b into 1ffad2b - view on LGTM.com

new alerts:

  • 1 for Missing space in string literal

@trask
Copy link
Member

trask commented May 19, 2021

@kryalama can you fix the lgtm bot alert above?

@kryalama
Copy link
Contributor Author

@kryalama can you fix the lgtm bot alert above?

Yes will do. Also looking at the failing smoke test.

…t/applicationinsights/smoketest/SpringBootAutoTest.java
try {
delegate = init();
} catch (RuntimeException e) {
initException = e;
Copy link
Contributor

Choose a reason for hiding this comment

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

i am curious to know why not throw here directly and wait for second called of this method then throw at line 42?

@kryalama kryalama merged commit 934bc7b into aad May 21, 2021
@trask trask deleted the kryalama/quickpulseaad branch May 26, 2021 02:42
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