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

Common authentication settings UI #529

Merged
merged 21 commits into from
Jan 13, 2023

Conversation

kostrse
Copy link
Contributor

@kostrse kostrse commented Dec 22, 2022

Azure authentication settings UI same as in Azure Monitor and Prometheus datasources.
Supports migration from legacy credentials format.

ADX_Creds

Fixes #361

Migration of client secret

Since secret cannot be migrated, the existing legacy client secret field clientSecret is being preserved and will continued to be used until user updates the value. Once new value set, it will be saved to the new field azureClientSecret.

Users should not notice the fact of migration.

Depends on

For future

The UI code can be moved into a shared JS library and shared between Azure Monitor, Prometheus and Azure Data Explorer.

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Thanks for the PR Sergey! I have several inline comments but in general, I think there are two things that we can do here:

  • Avoid the breaking change for the client secret. This means that we should support a partially migrated config, which is not going to be elegant from the code perspective but it would be nice for users.
  • Remove the default subscription code from this PR. I know this is to refactor this config editor with the Azure Monitor one but we can move that to a different component, so ADX doesn't depend on it.

Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

Nice work on this PR @kostrse. I echo @andresmgot comments but I actually think if we're making this change to better align the current Azure data sources then I would move this work to the Azure React repo. This will allow us to better maintain all common components required for Azure credentials.

Wdyt? cc: @andresmgot

@andresmgot
Copy link
Contributor

Nice work on this PR @kostrse. I echo @andresmgot comments but I actually think if we're making this change to better align the current Azure data sources then I would move this work to the Azure React repo. This will allow us to better maintain all common components required for Azure credentials.

Wdyt? cc: @andresmgot

yes, I believe this is an intermediate step before moving the code to the SDK

@kostrse
Copy link
Contributor Author

kostrse commented Dec 24, 2022

Nice work on this PR @kostrse. I echo @andresmgot comments but I actually think if we're making this change to better align the current Azure data sources then I would move this work to the Azure React repo. This will allow us to better maintain all common components required for Azure credentials.
Wdyt? cc: @andresmgot

yes, I believe this is an intermediate step before moving the code to the SDK

The end goal so to move everything to the shared library.

I would extract Ui to the shared library after Azure Monitor also migrated to the common 'azureCredentials' credentials format. I would look at Azure Monitor after Azure Data Explorer is done.

@kostrse
Copy link
Contributor Author

kostrse commented Jan 6, 2023

I would want OBO to be considered a distinct authentication type, not a subset of App Registration.
One is service identity, another is user identity, substantial difference.

Please let me know what needs to be changed in the wording of the message.
Also, do we need a link to documentation? What would the the best target for it then?

@kostrse kostrse marked this pull request as ready for review January 7, 2023 04:05
@kostrse kostrse requested a review from a team as a code owner January 7, 2023 04:05
Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, I have tested the changes and it's working for me, I just have some minor comments.

src/components/ConfigEditor/AzureCredentialsForm.tsx Outdated Show resolved Hide resolved
src/tracking.ts Outdated Show resolved Hide resolved
@andresmgot
Copy link
Contributor

Please let me know what needs to be changed in the wording of the message.
Also, do we need a link to documentation? What would the the best target for it then?

I think this is fine then, I would just change the text of the link.

Co-authored-by: Andres Martinez Gotor <andres.mgotor@gmail.com>
Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

LGTM, @aangelisc do you want to do a final check too?

BTW, this will break the e2e in main because the UI changes but I can send a quick PR to fix it.

Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

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

This all looks good to me as well. R.E. E2E tests, @kostrse would you be able to re-add the data-testid props that were in the original ConfigEditor? This should be a straightforward change that will ensure the E2E tests do not break. If not we can add another PR for this later 😊

@andresmgot
Copy link
Contributor

This all looks good to me as well. R.E. E2E tests, @kostrse would you be able to re-add the data-testid props that were in the original ConfigEditor? This should be a straightforward change that will ensure the E2E tests do not break. If not we can add another PR for this later blush

There is one extra change needed, apart from the test-id. I have prepared a quick PR we can merge after this.

@andresmgot andresmgot merged commit 57007ca into grafana:main Jan 13, 2023
@andresmgot andresmgot mentioned this pull request Jan 13, 2023
@kostrse kostrse deleted the auth-azure-credentials-ui branch January 13, 2023 15:22
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.

Update frontend to common Azure Authentication UI and AzureCredentials format
3 participants