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

Azure credentials in common format #459

Merged
merged 11 commits into from
Dec 12, 2022

Conversation

kostrse
Copy link
Contributor

@kostrse kostrse commented Sep 8, 2022

ADX datasource currently supports Client Secret and On-Behalf-Of authentication types via own credentials format and implementation of authentication logic.

Other Azure datasources share the same credentials format and reuse shared credentials logic from the Grafana Azure SDK. Features like Managed Identity support are shared via common implementation.

This PR attempts to migrate ADX backend to the new common credentials format (#360) to take advantage of Grafana Azure SDK and potentially support Managed Identity (#362).

Changes:

  • Credentials defined as azcredentials.AzureManagedIdentityCredentials (SDK), azcredentials.AzureClientSecretCredentials (SDK), adxcredentials.AzureClientSecretOboCredentials (ADX), all derived from the common azcredentials.AzureCredentials in Grafana Azure SDK.
  • DatasourceSettings doesn't have fields related to credentials anymore, credentials encapsulated in azcredentials.AzureCredentials.
  • adxcredentials.FromDatasourceData tries first to parse credentials in the new common format and fallbacks to the legacy format.
  • UI/frontend code still doesn't support new credentials format, uses old credentials format, but backend now understands both formats.

This PR doesn't update UI so end user experience doesn't change yet. UI changes will be done separately (#361).

Fixes #360
Related to #362

@kostrse kostrse requested a review from a team as a code owner September 8, 2022 04:27
@CLAassistant
Copy link

CLAassistant commented Sep 8, 2022

CLA assistant check
All committers have signed the CLA.

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 this PR Sergey! My main concern here is that I would much rather have this "new" code in the SDK, even if the OBO implementation is not final rather than having so many special cases here. Is there any major blocker for doing that that I'm missing?

pkg/azuredx/adxauth/adxcredentials/builder.go Outdated Show resolved Hide resolved
pkg/azuredx/adxauth/adxcredentials/builder.go Outdated Show resolved Hide resolved
pkg/azuredx/adxauth/adxcredentials/builder.go Show resolved Hide resolved
pkg/azuredx/adxauth/adxcredentials/credentials.go Outdated Show resolved Hide resolved
pkg/azuredx/adxauth/adxcredentials/builder.go Outdated Show resolved Hide resolved
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 @kostrse! Changes mostly looks good to me but I think there are still some bits we can do in the SDK instead.

@andresmgot
Copy link
Contributor

@kostrse can you merge main here? to address the CI issue

@kostrse
Copy link
Contributor Author

kostrse commented Dec 12, 2022

@kostrse can you merge main here? to address the CI issue

Done.

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!

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 backend to common AzureCredentials
3 participants