Skip to content

Commit

Permalink
satellite/console: config values for object browser API keys
Browse files Browse the repository at this point in the history
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:
#6854

Change-Id: I33a2b574c3c4fd13ba673a0ec368212c8a23d0f6
  • Loading branch information
VitaliiShpital committed Apr 17, 2024
1 parent 4d20183 commit f94a60d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions satellite/console/config.go
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions satellite/console/consoleweb/config.go
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions satellite/console/consoleweb/server.go
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions satellite/satellite-config.yaml.lock
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions web/satellite/src/types/config.gen.ts
Expand Up @@ -62,6 +62,8 @@ export class FrontendConfig {
plausibleScriptUrl: string;
plausibleDomain: string;
newAppSetupFlowEnabled: boolean;
objectBrowserKeyNamePrefix: string;
objectBrowserKeyLifetime: number;
}

export class MultiCaptchaConfig {
Expand Down

0 comments on commit f94a60d

Please sign in to comment.