The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/pkg/api/dtos/frontend_settings.go

284 lines
15 KiB

package dtos
import (
"github.com/grafana/grafana-azure-sdk-go/v2/azsettings"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
)
type FrontendSettingsAuthDTO struct {
AuthProxyEnableLoginToken bool `json:"AuthProxyEnableLoginToken"`
// Deprecated: this is no longer used and will be removed in Grafana 11
OAuthSkipOrgRoleUpdateSync bool `json:"OAuthSkipOrgRoleUpdateSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
SAMLSkipOrgRoleSync bool `json:"SAMLSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
LDAPSkipOrgRoleSync bool `json:"LDAPSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
GoogleSkipOrgRoleSync bool `json:"GoogleSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
GenericOAuthSkipOrgRoleSync bool `json:"GenericOAuthSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
JWTAuthSkipOrgRoleSync bool `json:"JWTAuthSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
GrafanaComSkipOrgRoleSync bool `json:"GrafanaComSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
AzureADSkipOrgRoleSync bool `json:"AzureADSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
GithubSkipOrgRoleSync bool `json:"GithubSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
GitLabSkipOrgRoleSync bool `json:"GitLabSkipOrgRoleSync"`
// Deprecated: this is no longer used and will be removed in Grafana 11
OktaSkipOrgRoleSync bool `json:"OktaSkipOrgRoleSync"`
DisableLogin bool `json:"disableLogin"`
BasicAuthStrongPasswordPolicy bool `json:"basicAuthStrongPasswordPolicy"`
}
type FrontendSettingsBuildInfoDTO struct {
HideVersion bool `json:"hideVersion"`
// A semver-ish version string, such as "11.0.0-12345"
Version string `json:"version"`
// A branded version string to show in the UI, such as "Grafana v11.0.0-12345"
VersionString string `json:"versionString,omitempty"`
Commit string `json:"commit"`
CommitShort string `json:"commitShort"`
Buildstamp int64 `json:"buildstamp"`
Edition string `json:"edition"`
LatestVersion string `json:"latestVersion"`
HasUpdate bool `json:"hasUpdate"`
Env string `json:"env"`
}
type FrontendSettingsLicenseInfoDTO struct {
Expiry int64 `json:"expiry"`
StateInfo string `json:"stateInfo"`
LicenseUrl string `json:"licenseUrl"`
Edition string `json:"edition"`
EnabledFeatures map[string]bool `json:"enabledFeatures"`
// Enterprise-only
TrialExpiry *int64 `json:"trialExpiry,omitempty"`
AppUrl *string `json:"appUrl,omitempty"`
}
type FrontendSettingsAzureDTO struct {
Cloud string `json:"cloud,omitempty"`
Clouds []azsettings.AzureCloudInfo `json:"clouds,omitempty"`
ManagedIdentityEnabled bool `json:"managedIdentityEnabled,omitempty"`
WorkloadIdentityEnabled bool `json:"workloadIdentityEnabled,omitempty"`
UserIdentityEnabled bool `json:"userIdentityEnabled,omitempty"`
UserIdentityFallbackCredentialsEnabled bool `json:"userIdentityFallbackCredentialsEnabled,omitempty"`
AzureEntraPasswordCredentialsEnabled bool `json:"azureEntraPasswordCredentialsEnabled,omitempty"`
}
type FrontendSettingsCachingDTO struct {
Enabled bool `json:"enabled"`
}
type FrontendSettingsRecordedQueriesDTO struct {
Enabled bool `json:"enabled"`
}
type FrontendSettingsReportingDTO struct {
Enabled bool `json:"enabled"`
}
type FrontendSettingsAnalyticsDTO struct {
Enabled bool `json:"enabled"`
}
type FrontendSettingsUnifiedAlertingDTO struct {
Alerting: Loki-based alert state history modal (#66595) * adds alertstatehistory backend config to grafanaBootData * add alertStateHistory api * show different ASH modal when using loki implementation * group log lines by instance (unique set of labels) Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com> * render log lines for each instance Co-Authored-By: Konrad Lalik <konrad.lalik@grafana.com> * Add visual improvements to the log record of state changes * Add values to log records * compute common labels and show unique labels * Add state changes visualization * fix common labels extraction * Code cleanup * Add timespan-based log record view * WIP * scroll to timestamp - poc * Use SortedVector for timestamp field * add conditional accessor for frames * update some of the log formats and styles * Timestamp-based visualization with scrolling * minor improvements * Split Loki's state history viewer into multiple files * Add memoization to prevent graph rerender on filter updates * make chart size shrink when fewer instances * style updates * show warning when instances are hidden * Add basic label-based filtering * Improve label-based filtering * Add regex validation * Improve no instances message when everything was filtered out * Update warning message * Move timeline viewer to a separate file, refactor handling timeline pointer changes * Remove unused component, add comments * Fix test snapshot, fix type error * adds tests for common.ts * Add tests for converting log records into data frames * Add basic component test, fix type guards * Use a constant for timeseries limit * Improve a11y, update component test * Memoize AlertStateTag, migrate from deprecated ArrayVector * Update public/app/features/alerting/unified/components/rules/state-history/common.ts * Move helper hook into a separate file. Add Search input component * Change the limit of visible time series on the timeline * Add LogRecordViewer perf improvements, refactor timeline cursor events tracking * Use callback to pass timeline refs * Add grouping tests for the log record viewer --------- Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2 years ago
MinInterval string `json:"minInterval"`
AlertStateHistoryBackend string `json:"alertStateHistoryBackend,omitempty"`
AlertStateHistoryPrimary string `json:"alertStateHistoryPrimary,omitempty"`
}
// Enterprise-only
type FrontendSettingsLicensingDTO struct {
Slug *string `json:"slug,omitempty"`
LimitBy *string `json:"limitBy,omitempty"`
IncludedUsers *int64 `json:"includedUsers,omitempty"`
LicenseExpiry *int64 `json:"licenseExpiry,omitempty"`
LicenseExpiryWarnDays *int64 `json:"licenseExpiryWarnDays,omitempty"`
TokenExpiry *int64 `json:"tokenExpiry,omitempty"`
IsTrial *bool `json:"isTrial,omitempty"`
TokenExpiryWarnDays *int64 `json:"tokenExpiryWarnDays,omitempty"`
UsageBilling *bool `json:"usageBilling,omitempty"`
ActiveAdminsAndEditors *int64 `json:"activeAdminsAndEditors,omitempty"`
ActiveViewers *int64 `json:"activeViewers,omitempty"`
ActiveUsers *int64 `json:"ActiveUsers,omitempty"`
}
// Enterprise-only
type FrontendSettingsFooterConfigItemDTO struct {
Text string `json:"text"`
Url string `json:"url"`
Icon string `json:"icon"`
Target string `json:"blank"`
}
// Enterprise-only
type FrontendSettingsPublicDashboardConfigDTO struct {
FooterHide bool `json:"footerHide"`
FooterText string `json:"footerText"`
FooterLogo string `json:"footerLogo"`
FooterLink string `json:"footerLink"`
HeaderLogoHide bool `json:"headerLogoHide"`
}
// Enterprise-only
type FrontendSettingsWhitelabelingDTO struct {
Links []FrontendSettingsFooterConfigItemDTO `json:"links"`
LoginTitle string `json:"loginTitle"`
AppTitle *string `json:"appTitle,omitempty"`
LoginLogo *string `json:"loginLogo,omitempty"`
MenuLogo *string `json:"menuLogo,omitempty"`
LoginBackground *string `json:"loginBackground,omitempty"`
LoginSubtitle *string `json:"loginSubtitle,omitempty"`
LoginBoxBackground *string `json:"loginBoxBackground,omitempty"`
LoadingLogo *string `json:"loadingLogo,omitempty"`
HideEdition *bool `json:"hideEdition,omitempty"`
PublicDashboard *FrontendSettingsPublicDashboardConfigDTO `json:"publicDashboard,omitempty"`
}
type FrontendSettingsSqlConnectionLimitsDTO struct {
MaxOpenConns int `json:"maxOpenConns"`
MaxIdleConns int `json:"maxIdleConns"`
ConnMaxLifetime int `json:"connMaxLifetime"`
}
type FrontendSettingsDTO struct {
DefaultDatasource string `json:"defaultDatasource"`
Datasources map[string]plugins.DataSourceDTO `json:"datasources"`
MinRefreshInterval string `json:"minRefreshInterval"`
Panels map[string]plugins.PanelDTO `json:"panels"`
Apps map[string]*plugins.AppDTO `json:"apps"`
AppUrl string `json:"appUrl"`
AppSubUrl string `json:"appSubUrl"`
AllowOrgCreate bool `json:"allowOrgCreate"`
AuthProxyEnabled bool `json:"authProxyEnabled"`
LdapEnabled bool `json:"ldapEnabled"`
JwtHeaderName string `json:"jwtHeaderName"`
JwtUrlLogin bool `json:"jwtUrlLogin"`
LiveEnabled bool `json:"liveEnabled"`
AutoAssignOrg bool `json:"autoAssignOrg"`
VerifyEmailEnabled bool `json:"verifyEmailEnabled"`
SigV4AuthEnabled bool `json:"sigV4AuthEnabled"`
AzureAuthEnabled bool `json:"azureAuthEnabled"`
RbacEnabled bool `json:"rbacEnabled"`
ExploreEnabled bool `json:"exploreEnabled"`
HelpEnabled bool `json:"helpEnabled"`
ProfileEnabled bool `json:"profileEnabled"`
NewsFeedEnabled bool `json:"newsFeedEnabled"`
QueryHistoryEnabled bool `json:"queryHistoryEnabled"`
GoogleAnalyticsId string `json:"googleAnalyticsId"`
GoogleAnalytics4Id string `json:"googleAnalytics4Id"`
GoogleAnalytics4SendManualPageViews bool `json:"GoogleAnalytics4SendManualPageViews"`
RudderstackWriteKey string `json:"rudderstackWriteKey"`
RudderstackDataPlaneUrl string `json:"rudderstackDataPlaneUrl"`
RudderstackSdkUrl string `json:"rudderstackSdkUrl"`
RudderstackConfigUrl string `json:"rudderstackConfigUrl"`
RudderstackIntegrationsUrl string `json:"rudderstackIntegrationsUrl"`
FeedbackLinksEnabled bool `json:"feedbackLinksEnabled"`
ApplicationInsightsConnectionString string `json:"applicationInsightsConnectionString"`
ApplicationInsightsEndpointUrl string `json:"applicationInsightsEndpointUrl"`
DisableLoginForm bool `json:"disableLoginForm"`
DisableUserSignUp bool `json:"disableUserSignUp"`
LoginHint string `json:"loginHint"`
PasswordHint string `json:"passwordHint"`
ExternalUserMngInfo string `json:"externalUserMngInfo"`
ExternalUserMngLinkUrl string `json:"externalUserMngLinkUrl"`
ExternalUserMngLinkName string `json:"externalUserMngLinkName"`
ViewersCanEdit bool `json:"viewersCanEdit"`
AngularSupportEnabled bool `json:"angularSupportEnabled"`
EditorsCanAdmin bool `json:"editorsCanAdmin"`
DisableSanitizeHtml bool `json:"disableSanitizeHtml"`
TrustedTypesDefaultPolicyEnabled bool `json:"trustedTypesDefaultPolicyEnabled"`
CSPReportOnlyEnabled bool `json:"cspReportOnlyEnabled"`
DisableFrontendSandboxForPlugins []string `json:"disableFrontendSandboxForPlugins"`
ExploreDefaultTimeOffset string `json:"exploreDefaultTimeOffset"`
Auth FrontendSettingsAuthDTO `json:"auth"`
BuildInfo FrontendSettingsBuildInfoDTO `json:"buildInfo"`
LicenseInfo FrontendSettingsLicenseInfoDTO `json:"licenseInfo"`
FeatureToggles map[string]bool `json:"featureToggles"`
AnonymousEnabled bool `json:"anonymousEnabled"`
AnonymousDeviceLimit int64 `json:"anonymousDeviceLimit"`
RendererAvailable bool `json:"rendererAvailable"`
RendererVersion string `json:"rendererVersion"`
Image Rendering: Add settings for default width, height and scale (#82040) * Add Image width & height * ability to change default width, height and scale * default ini * Update conf/defaults.ini Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update pkg/setting/setting.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update pkg/setting/setting.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Added docs, changed frontend * Update conf/defaults.ini Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update conf/defaults.ini Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update conf/defaults.ini Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update pkg/api/dtos/frontend_settings.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update pkg/api/frontendsettings.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update pkg/api/render.go Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * add query float 64 * Update packages/grafana-runtime/src/config.ts Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * Update public/app/features/dashboard/components/ShareModal/utils.ts Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> * spacing * fix tests * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> --------- Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
1 year ago
RendererDefaultImageWidth int `json:"rendererDefaultImageWidth"`
RendererDefaultImageHeight int `json:"rendererDefaultImageHeight"`
RendererDefaultImageScale float64 `json:"rendererDefaultImageScale"`
SecretsManagerPluginEnabled bool `json:"secretsManagerPluginEnabled"`
Http2Enabled bool `json:"http2Enabled"`
GrafanaJavascriptAgent setting.GrafanaJavascriptAgent `json:"grafanaJavascriptAgent"`
PluginCatalogURL string `json:"pluginCatalogURL"`
PluginAdminEnabled bool `json:"pluginAdminEnabled"`
PluginAdminExternalManageEnabled bool `json:"pluginAdminExternalManageEnabled"`
PluginCatalogHiddenPlugins []string `json:"pluginCatalogHiddenPlugins"`
PluginCatalogManagedPlugins []string `json:"pluginCatalogManagedPlugins"`
ExpressionsEnabled bool `json:"expressionsEnabled"`
AwsAllowedAuthProviders []string `json:"awsAllowedAuthProviders"`
AwsAssumeRoleEnabled bool `json:"awsAssumeRoleEnabled"`
SupportBundlesEnabled bool `json:"supportBundlesEnabled"`
SnapshotEnabled bool `json:"snapshotEnabled"`
SecureSocksDSProxyEnabled bool `json:"secureSocksDSProxyEnabled"`
ReportingStaticContext map[string]string `json:"reportingStaticContext"`
Azure FrontendSettingsAzureDTO `json:"azure"`
Caching FrontendSettingsCachingDTO `json:"caching"`
RecordedQueries FrontendSettingsRecordedQueriesDTO `json:"recordedQueries"`
Reporting FrontendSettingsReportingDTO `json:"reporting"`
Analytics FrontendSettingsAnalyticsDTO `json:"analytics"`
UnifiedAlertingEnabled bool `json:"unifiedAlertingEnabled"`
UnifiedAlerting FrontendSettingsUnifiedAlertingDTO `json:"unifiedAlerting"`
Oauth map[string]any `json:"oauth"`
SamlEnabled bool `json:"samlEnabled"`
SamlName string `json:"samlName"`
TokenExpirationDayLimit int `json:"tokenExpirationDayLimit"`
Folders: Show dashboards and folders with directly assigned permissions in "Shared" folder (#78465) * Folders: Show folders user has access to at the root level * Refactor * Refactor * Hide parent folders user has no access to * Skip expensive computation if possible * Fix tests * Fix potential nil access * Fix duplicated folders * Fix linter error * Fix querying folders if no managed permissions set * Update benchmark * Add special shared with me folder and fetch available non-root folders on demand * Fix parents query * Improve db query for folders * Reset benchmark changes * Fix permissions for shared with me folder * Simplify dedup * Add option to include shared folder permission to user's permissions * Fix nil UID * Remove duplicated folders from shared list * Folders: Fix fetching empty folder * Nested folders: Show dashboards with directly assigned permissions * Fix slow dashboards fetch * Refactor * Fix cycle dependencies * Move shared folder to models * Fix shared folder links * Refactor * Use feature flag for permissions * Use feature flag * Review comments * Expose shared folder UID through frontend settings * Add frontend type for sharedWithMeFolderUID option * Refactor: apply review suggestions * Fix parent uid for shared folder * Fix listing shared dashboards for users with access to all folders * Prevent creating folder with "shared" UID * Add tests for shared folders * Add test for shared dashboards * Fix linter * Add metrics for shared with me folder * Add metrics for shared with me dashboards * Fix tests * Tests: add metrics as a dependency * Fix access control metadata for shared with me folder * Use constant for shared with me * Optimize parent folders access check, fetch all folders in one query. * Use labels for metrics
2 years ago
SharedWithMeFolderUID string `json:"sharedWithMeFolderUID"`
RootFolderUID string `json:"rootFolderUID"`
GeomapDefaultBaseLayerConfig *map[string]any `json:"geomapDefaultBaseLayerConfig,omitempty"`
GeomapDisableCustomBaseLayer bool `json:"geomapDisableCustomBaseLayer"`
PublicDashboardAccessToken string `json:"publicDashboardAccessToken"`
PublicDashboardsEnabled bool `json:"publicDashboardsEnabled"`
CloudMigrationIsTarget bool `json:"cloudMigrationIsTarget"`
CloudMigrationFeedbackURL string `json:"cloudMigrationFeedbackURL"`
CloudMigrationPollIntervalMs int `json:"cloudMigrationPollIntervalMs"`
DateFormats setting.DateFormats `json:"dateFormats,omitempty"`
LoginError string `json:"loginError,omitempty"`
// The K8s namespace to use for this user
Namespace string `json:"namespace,omitempty"`
PluginsCDNBaseURL string `json:"pluginsCDNBaseURL,omitempty"`
SqlConnectionLimits FrontendSettingsSqlConnectionLimitsDTO `json:"sqlConnectionLimits"`
// Enterprise
Licensing *FrontendSettingsLicensingDTO `json:"licensing,omitempty"`
Whitelabeling *FrontendSettingsWhitelabelingDTO `json:"whitelabeling,omitempty"`
LocalFileSystemAvailable bool `json:"localFileSystemAvailable"`
// Experimental Scope settings
ListScopesEndpoint string `json:"listScopesEndpoint"`
ListDashboardScopesEndpoint string `json:"listDashboardScopesEndpoint"`
}