mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Prometheus: Ensure auth config can be switched away from Azure option (#95003)
fix: sanitize jsondata when azure auth disabled
This commit is contained in:
parent
03715f062b
commit
6be787dd47
@ -8,9 +8,15 @@ import { Alert, SecureSocksProxySettings, useTheme2 } from '@grafana/ui';
|
||||
// NEED TO EXPORT THIS FROM GRAFANA/UI FOR EXTERNAL DS
|
||||
import { AzureAuthSettings } from '@grafana/ui/src/components/DataSourceSettings/types';
|
||||
|
||||
import type { AzureCredentials } from './AzureCredentials';
|
||||
|
||||
interface PromOptionsWithCloudAuth extends PromOptions {
|
||||
azureCredentials?: AzureCredentials;
|
||||
}
|
||||
|
||||
type Props = {
|
||||
options: DataSourceSettings<PromOptions, {}>;
|
||||
onOptionsChange: (options: DataSourceSettings<PromOptions, {}>) => void;
|
||||
options: DataSourceSettings<PromOptionsWithCloudAuth, {}>;
|
||||
onOptionsChange: (options: DataSourceSettings<PromOptionsWithCloudAuth, {}>) => void;
|
||||
azureAuthSettings: AzureAuthSettings;
|
||||
sigV4AuthToggleEnabled: boolean | undefined;
|
||||
renderSigV4Editor: React.ReactNode;
|
||||
@ -73,7 +79,7 @@ export const DataSourcehttpSettingsOverhaul = (props: Props) => {
|
||||
const azureAuthOption: CustomMethod = {
|
||||
id: azureAuthId,
|
||||
label: 'Azure auth',
|
||||
description: 'This is Azure auth description',
|
||||
description: 'Authenticate with Azure',
|
||||
component: (
|
||||
<>
|
||||
{azureAuthSettings.azureSettingsUI && (
|
||||
@ -161,6 +167,7 @@ export const DataSourcehttpSettingsOverhaul = (props: Props) => {
|
||||
withCredentials: method === AuthMethod.CrossSiteCredentials,
|
||||
jsonData: {
|
||||
...options.jsonData,
|
||||
azureCredentials: method === azureAuthId ? options.jsonData.azureCredentials : undefined,
|
||||
sigV4Auth: method === sigV4Id,
|
||||
oauthPassThru: method === AuthMethod.OAuthForward,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user