Chore: Add types for OAuth settings in config (#45247)
This commit is contained in:
@@ -65,6 +65,26 @@ export type PreloadPlugin = {
|
||||
version: string;
|
||||
};
|
||||
|
||||
/** Supported OAuth services
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type OAuth =
|
||||
| 'github'
|
||||
| 'gitlab'
|
||||
| 'google'
|
||||
| 'generic_oauth'
|
||||
// | 'grafananet' Deprecated. Key always changed to "grafana_com"
|
||||
| 'grafana_com'
|
||||
| 'azuread'
|
||||
| 'okta';
|
||||
|
||||
/** Map of enabled OAuth services and their respective names
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type OAuthSettings = Partial<Record<OAuth, { name: string }>>;
|
||||
|
||||
/**
|
||||
* Describes all the different Grafana configuration values available for an instance.
|
||||
*
|
||||
@@ -96,7 +116,7 @@ export interface GrafanaConfig {
|
||||
samlEnabled: boolean;
|
||||
autoAssignOrg: boolean;
|
||||
verifyEmailEnabled: boolean;
|
||||
oauth: any;
|
||||
oauth: OAuthSettings;
|
||||
disableUserSignUp: boolean;
|
||||
loginHint: any;
|
||||
passwordHint: any;
|
||||
|
||||
@@ -36,7 +36,7 @@ export * from './live';
|
||||
export * from './variables';
|
||||
export * from './geometry';
|
||||
export { isUnsignedPluginSignature } from './pluginSignature';
|
||||
export { GrafanaConfig, BuildInfo, LicenseInfo, PreloadPlugin } from './config';
|
||||
export { OAuth, OAuthSettings, GrafanaConfig, BuildInfo, LicenseInfo, PreloadPlugin } from './config';
|
||||
export { FeatureToggles } from './featureToggles.gen';
|
||||
export * from './alerts';
|
||||
export * from './slider';
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
GrafanaTheme2,
|
||||
LicenseInfo,
|
||||
MapLayerOptions,
|
||||
OAuthSettings,
|
||||
PanelPluginMeta,
|
||||
PreloadPlugin,
|
||||
systemDateFormats,
|
||||
@@ -48,7 +49,7 @@ export class GrafanaBootConfig implements GrafanaConfig {
|
||||
samlName = '';
|
||||
autoAssignOrg = true;
|
||||
verifyEmailEnabled = false;
|
||||
oauth: any;
|
||||
oauth: OAuthSettings = {};
|
||||
disableUserSignUp = false;
|
||||
loginHint: any;
|
||||
passwordHint: any;
|
||||
|
||||
Reference in New Issue
Block a user