Chore: Add types for OAuth settings in config (#45247)

This commit is contained in:
kay delaney
2022-02-11 13:54:24 +00:00
committed by GitHub
parent aa6cee1072
commit 10cc2fd6bc
4 changed files with 31 additions and 10 deletions
+21 -1
View File
@@ -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;
+1 -1
View File
@@ -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';
+2 -1
View File
@@ -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;