Skip to content

Commit

Permalink
satellite/console: config flag for max name values length
Browse files Browse the repository at this point in the history
Added new config flag which restricts creating name values with a length more than 100.

Issue:
storj/storj-private#671

Change-Id: I08cdd93d543b838c69400ae0eceb8d3469d3e0f1
  • Loading branch information
VitaliiShpital committed Apr 23, 2024
1 parent beddca4 commit f1cbccf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions satellite/console/config.go
Expand Up @@ -35,6 +35,7 @@ type Config struct {
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"`
MaxNameCharacters int `help:"defines the maximum number of characters allowed for names, e.g. user first/last names and company names" default:"100"`
UsageLimits UsageLimitsConfig
Captcha CaptchaConfig
Session SessionConfig
Expand Down
1 change: 1 addition & 0 deletions satellite/console/consoleweb/config.go
Expand Up @@ -66,6 +66,7 @@ type FrontendConfig struct {
NewAppSetupFlowEnabled bool `json:"newAppSetupFlowEnabled"`
ObjectBrowserKeyNamePrefix string `json:"objectBrowserKeyNamePrefix"`
ObjectBrowserKeyLifetime time.Duration `json:"objectBrowserKeyLifetime"`
MaxNameCharacters int `json:"maxNameCharacters"`
}

// Satellites is a configuration value that contains a list of satellite names and addresses.
Expand Down
1 change: 1 addition & 0 deletions satellite/console/consoleweb/server.go
Expand Up @@ -870,6 +870,7 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque
NewAppSetupFlowEnabled: server.config.NewAppSetupFlowEnabled,
ObjectBrowserKeyNamePrefix: server.config.ObjectBrowserKeyNamePrefix,
ObjectBrowserKeyLifetime: server.config.ObjectBrowserKeyLifetime,
MaxNameCharacters: server.config.MaxNameCharacters,
}

err := json.NewEncoder(w).Encode(&cfg)
Expand Down
3 changes: 3 additions & 0 deletions satellite/satellite-config.yaml.lock
Expand Up @@ -385,6 +385,9 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0
# number of times user can try to login without penalty
# console.login-attempts-without-penalty: 3

# defines the maximum number of characters allowed for names, e.g. user first/last names and company names
# console.max-name-characters: 100

# additional values for Content Security Policy media-src, space separated
# console.media-src-suffix: '*.tardigradeshare.io *.storjshare.io *.storjsatelliteshare.io'

Expand Down
1 change: 1 addition & 0 deletions web/satellite/src/types/config.gen.ts
Expand Up @@ -62,6 +62,7 @@ export class FrontendConfig {
newAppSetupFlowEnabled: boolean;
objectBrowserKeyNamePrefix: string;
objectBrowserKeyLifetime: number;
maxNameCharacters: number;
}

export class MultiCaptchaConfig {
Expand Down

0 comments on commit f1cbccf

Please sign in to comment.