Add context config to the frontend
CodeQL checks / Detect whether code changed (push) Waiting to run Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions Details

This commit is contained in:
Tania B. 2025-10-07 15:47:46 +02:00
parent f4f4b92192
commit 22ed7f4e13
No known key found for this signature in database
GPG Key ID: 59C8B1BB068FA8A4
6 changed files with 6 additions and 2 deletions

View File

@ -302,6 +302,7 @@
"@locker/near-membrane-shared-dom": "0.14.0",
"@msagl/core": "^1.1.19",
"@msagl/parser": "^1.1.19",
"@openfeature/ofrep-web-provider": "^0.3.3",
"@openfeature/web-sdk": "^1.6.1",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/exporter-collector": "0.25.0",

View File

@ -316,6 +316,7 @@ export interface GrafanaConfig {
quickRanges?: TimeOption[];
pluginRestrictedAPIsAllowList?: Record<string, string[]>;
pluginRestrictedAPIsBlockList?: Record<string, string[]>;
openFeatureContext: Record<string, unknown>;
// The namespace to use for kubernetes apiserver requests
namespace: string;

View File

@ -259,6 +259,8 @@ export class GrafanaBootConfig {
listDashboardScopesEndpoint = '';
listScopesEndpoint = '';
openFeatureContext: Record<string, unknown> = {};
constructor(
options: BootData['settings'] & {
bootData: BootData;

View File

@ -24,7 +24,7 @@ export async function initOpenFeature() {
await OpenFeature.setProviderAndWait(ofProvider, {
targetingKey: config.namespace,
namespace: config.namespace,
...config.openFeatureContext,
});
}

View File

@ -40,7 +40,6 @@ func InitOpenFeatureWithCfg(cfg *setting.Cfg) error {
if err != nil {
return fmt.Errorf("failed to initialize OpenFeature: %w", err)
}
// Convert map[string]string to map[string]any for OpenFeature SDK
contextAttrs := make(map[string]any)
for k, v := range cfg.OpenFeature.ContextAttrs {
contextAttrs[k] = v

View File

@ -18257,6 +18257,7 @@ __metadata:
"@msagl/core": "npm:^1.1.19"
"@msagl/parser": "npm:^1.1.19"
"@npmcli/package-json": "npm:^6.0.0"
"@openfeature/ofrep-web-provider": "npm:^0.3.3"
"@openfeature/web-sdk": "npm:^1.6.1"
"@opentelemetry/api": "npm:1.9.0"
"@opentelemetry/exporter-collector": "npm:0.25.0"