From f94a60d8979a1dc8af132939bfb0d5651ff805b6 Mon Sep 17 00:00:00 2001 From: Vitalii Date: Tue, 16 Apr 2024 15:27:37 +0300 Subject: [PATCH] satellite/console: config values for object browser API keys Added 2 new config values to operate with object browser related API keys. One is for API key name prefix and the second one is for key expiration date. Issue: https://github.com/storj/storj/issues/6854 Change-Id: I33a2b574c3c4fd13ba673a0ec368212c8a23d0f6 --- satellite/console/config.go | 2 ++ satellite/console/consoleweb/config.go | 2 ++ satellite/console/consoleweb/server.go | 2 ++ satellite/satellite-config.yaml.lock | 6 ++++++ web/satellite/src/types/config.gen.ts | 2 ++ 5 files changed, 14 insertions(+) diff --git a/satellite/console/config.go b/satellite/console/config.go index 19940569e137..eb9502f17359 100644 --- a/satellite/console/config.go +++ b/satellite/console/config.go @@ -33,6 +33,8 @@ type Config struct { SignupActivationCodeEnabled bool `help:"indicates whether the whether account activation is done using activation code" default:"false"` FreeTrialDuration time.Duration `help:"duration for which users can access the system free of charge, 0 = unlimited time trial" default:"0"` VarPartners []string `help:"list of partners whose users will not see billing UI." default:""` + ObjectBrowserKeyNamePrefix string `help:"prefix for object browser API key names" default:".storj-web-file-browser-api-key-"` + ObjectBrowserKeyLifetime time.Duration `help:"duration for which the object browser API key remains valid" default:"72h"` UsageLimits UsageLimitsConfig Captcha CaptchaConfig Session SessionConfig diff --git a/satellite/console/consoleweb/config.go b/satellite/console/consoleweb/config.go index 9fc2e0b565bd..c44a8a3a7ea6 100644 --- a/satellite/console/consoleweb/config.go +++ b/satellite/console/consoleweb/config.go @@ -66,6 +66,8 @@ type FrontendConfig struct { PlausibleScriptUrl string `json:"plausibleScriptUrl"` PlausibleDomain string `json:"plausibleDomain"` NewAppSetupFlowEnabled bool `json:"newAppSetupFlowEnabled"` + ObjectBrowserKeyNamePrefix string `json:"objectBrowserKeyNamePrefix"` + ObjectBrowserKeyLifetime time.Duration `json:"objectBrowserKeyLifetime"` } // Satellites is a configuration value that contains a list of satellite names and addresses. diff --git a/satellite/console/consoleweb/server.go b/satellite/console/consoleweb/server.go index 912556e96fb7..904159e252ed 100644 --- a/satellite/console/consoleweb/server.go +++ b/satellite/console/consoleweb/server.go @@ -872,6 +872,8 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque PlausibleScriptUrl: server.AnalyticsConfig.Plausible.ScriptUrl, DaysBeforeTrialEndNotification: server.config.DaysBeforeTrialEndNotification, NewAppSetupFlowEnabled: server.config.NewAppSetupFlowEnabled, + ObjectBrowserKeyNamePrefix: server.config.ObjectBrowserKeyNamePrefix, + ObjectBrowserKeyLifetime: server.config.ObjectBrowserKeyLifetime, } err := json.NewEncoder(w).Encode(&cfg) diff --git a/satellite/satellite-config.yaml.lock b/satellite/satellite-config.yaml.lock index f273815534a4..050cd56a8073 100644 --- a/satellite/satellite-config.yaml.lock +++ b/satellite/satellite-config.yaml.lock @@ -400,6 +400,12 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0 # how long oauth refresh tokens are issued for # console.oauth-refresh-token-expiry: 720h0m0s +# duration for which the object browser API key remains valid +# console.object-browser-key-lifetime: 72h0m0s + +# prefix for object browser API key names +# console.object-browser-key-name-prefix: .storj-web-file-browser-api-key- + # whether to use object browser pagination # console.object-browser-pagination-enabled: false diff --git a/web/satellite/src/types/config.gen.ts b/web/satellite/src/types/config.gen.ts index 1da704dfedcf..232bbfbef780 100644 --- a/web/satellite/src/types/config.gen.ts +++ b/web/satellite/src/types/config.gen.ts @@ -62,6 +62,8 @@ export class FrontendConfig { plausibleScriptUrl: string; plausibleDomain: string; newAppSetupFlowEnabled: boolean; + objectBrowserKeyNamePrefix: string; + objectBrowserKeyLifetime: number; } export class MultiCaptchaConfig {