diff --git a/cmd/authmate/main.go b/cmd/authmate/main.go index 04f960dc..9446355e 100644 --- a/cmd/authmate/main.go +++ b/cmd/authmate/main.go @@ -200,8 +200,8 @@ func issueSecret() *cli.Command { Value: "REP 2 IN X CBF 3 SELECT 2 FROM * AS X", }, &cli.StringFlag{ - Name: "session-token", - Usage: "create session token with rules, if the rules are set as 'none', no session tokens will be created", + Name: "session-tokens", + Usage: "create session tokens with rules, if the rules are set as 'none', no session tokens will be created", Required: false, Destination: &sessionTokenFlag, Value: "", @@ -278,7 +278,7 @@ It will be ceil rounded to the nearest amount of epoch.`, sessionRules, skipSessionRules, err := getSessionRules(sessionTokenFlag) if err != nil { - return cli.Exit(fmt.Sprintf("couldn't parse 'session-token' flag: %s", err.Error()), 8) + return cli.Exit(fmt.Sprintf("couldn't parse 'session-tokens' flag: %s", err.Error()), 8) } issueSecretOptions := &authmate.IssueSecretOptions{ diff --git a/cmd/s3-gw/app.go b/cmd/s3-gw/app.go index a2b1f13f..1a274096 100644 --- a/cmd/s3-gw/app.go +++ b/cmd/s3-gw/app.go @@ -61,9 +61,9 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { prmPool pool.InitParameters - reBalance = defaultRebalanceTimer + reBalance = defaultRebalanceInterval conTimeout = defaultConnectTimeout - reqTimeout = defaultRequestTimeout + hckTimeout = defaultHealthcheckTimeout maxClientsCount = defaultMaxClientsCount maxClientsDeadline = defaultMaxClientsDeadline @@ -73,8 +73,8 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { conTimeout = v } - if v := v.GetDuration(cfgRequestTimeout); v > 0 { - reqTimeout = v + if v := v.GetDuration(cfgHealthcheckTimeout); v > 0 { + hckTimeout = v } if v := v.GetInt(cfgMaxClientsCount); v > 0 { @@ -85,7 +85,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { maxClientsDeadline = v } - if v := v.GetDuration(cfgRebalanceTimer); v > 0 { + if v := v.GetDuration(cfgRebalanceInterval); v > 0 { reBalance = v } @@ -106,7 +106,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { prmPool.SetKey(&key.PrivateKey) prmPool.SetNodeDialTimeout(conTimeout) - prmPool.SetHealthcheckTimeout(reqTimeout) + prmPool.SetHealthcheckTimeout(hckTimeout) prmPool.SetClientRebalanceInterval(reBalance) for _, peer := range fetchPeers(l, v) { prmPool.AddNode(peer) diff --git a/cmd/s3-gw/app_settings.go b/cmd/s3-gw/app_settings.go index fee8c9f0..178e2ddb 100644 --- a/cmd/s3-gw/app_settings.go +++ b/cmd/s3-gw/app_settings.go @@ -17,10 +17,10 @@ import ( ) const ( - defaultRebalanceTimer = 15 * time.Second - defaultRequestTimeout = 15 * time.Second - defaultConnectTimeout = 30 * time.Second - defaultShutdownTimeout = 15 * time.Second + defaultRebalanceInterval = 15 * time.Second + defaultHealthcheckTimeout = 15 * time.Second + defaultConnectTimeout = 30 * time.Second + defaultShutdownTimeout = 15 * time.Second defaultMaxClientsCount = 100 defaultMaxClientsDeadline = time.Second * 30 @@ -40,9 +40,9 @@ const ( // Settings. cfgTLSCertFile = "tls.cert_file" // Timeouts. - cfgConnectTimeout = "connect_timeout" - cfgRequestTimeout = "request_timeout" - cfgRebalanceTimer = "rebalance_timer" + cfgConnectTimeout = "connect_timeout" + cfgHealthcheckTimeout = "healthcheck_timeout" + cfgRebalanceInterval = "rebalance_interval" // Caching. cfgObjectsCacheLifetime = "cache.objects.lifetime" @@ -180,9 +180,9 @@ func newSettings() *viper.Viper { flags.String(cfgAddress, "", `address of wallet account`) config := flags.String(cmdConfig, "", "config path") - flags.Duration(cfgRequestTimeout, defaultRequestTimeout, "set gRPC request timeout") - flags.Duration(cfgConnectTimeout, defaultConnectTimeout, "set gRPC connect timeout") - flags.Duration(cfgRebalanceTimer, defaultRebalanceTimer, "set gRPC connection rebalance timer") + flags.Duration(cfgHealthcheckTimeout, defaultHealthcheckTimeout, "set timeout to check node health during rebalance") + flags.Duration(cfgConnectTimeout, defaultConnectTimeout, "set timeout to connect to NeoFS nodes") + flags.Duration(cfgRebalanceInterval, defaultRebalanceInterval, "set rebalance interval") flags.Int(cfgMaxClientsCount, defaultMaxClientsCount, "set max-clients count") flags.Duration(cfgMaxClientsDeadline, defaultMaxClientsDeadline, "set max-clients deadline") diff --git a/config/config.env b/config/config.env index 353f9ee6..ea382a40 100644 --- a/config/config.env +++ b/config/config.env @@ -45,9 +45,9 @@ S3_GW_PPROF=false # Timeout to connect to a node S3_GW_CONNECT_TIMEOUT=30s # Timeout to check node health during rebalance. -S3_GW_REQUEST_TIMEOUT=15s +S3_GW_HEALTHCHECK_TIMEOUT=15s # Interval to check node health -S3_GW_REBALANCE_TIMER=15s +S3_GW_REBALANCE_INTERVAL=15s # Limits for processing of clients' requests S3_GW_MAX_CLIENTS_COUNT=100 diff --git a/config/config.yaml b/config/config.yaml index aae8df7b..2df7697a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -46,10 +46,10 @@ pprof: false # Timeout to connect to a node connect_timeout: 30s -# Timeout to check node health during rebalance. -request_timeout: 15s +# Timeout to check node health during rebalance +healthcheck_timeout: 15s # Interval to check node health -rebalance_timer: 15s +rebalance_interval: 15s # Limits for processing of clients' requests max_clients_count: 100 diff --git a/docs/authmate.md b/docs/authmate.md index 756443f6..cceaa277 100644 --- a/docs/authmate.md +++ b/docs/authmate.md @@ -187,12 +187,12 @@ If bearer rules are not set, a token will be auto-generated with a value: ### Session tokens With session token, there are 3 options: -1. append `--session-token` parameter with your custom rules in json format (as a string or file path). E.g.: +1. append `--session-tokens` parameter with your custom rules in json format (as a string or file path). E.g.: ```shell $ neofs-authmate issue-secret --wallet wallet.json \ --peer 192.168.130.71:8080 \ --gate-public-key 0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf \ ---session-token session.json +--session-tokens session.json ``` where content of `session.json`: ```json @@ -219,7 +219,7 @@ where content of `session.json`: the authmate creates a `SETEACL` session token automatically in case when a user specified the token rule with `PUT` and forgot about the rule with `SETEACL`. -2. append `--session-token` parameter with the value `none` -- no session token will be created +2. append `--session-tokens` parameter with the value `none` -- no session token will be created 3. skip the parameter, and `authmate` will create session tokens with default rules (the same as in `session.json` in example above) diff --git a/docs/configuration.md b/docs/configuration.md index 722ad247..9692b485 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -84,12 +84,12 @@ $ neofs-s3-gw --max_clients_count 150 --max_clients_deadline 1m ### Connection to NeoFS Timeout to connect to NeoFS nodes can be set with `--connect_timeout` (default 30s) -and timeout to check node health during rebalance`--request_timeout` (default 15s). +and timeout to check node health during rebalance`--healthcheck_timeout` (default 15s). -Also, interval to check node health can be specified by `--rebalance_timer` value, default value is 15s. +Also, interval to check node health can be specified by `--rebalance_interval` value, default value is 15s. ```shell -$ neofs-s3-gw --request_timeout 15s --connect_timeout 1m --rebalance_timer 1h +$ neofs-s3-gw --healthcheck_timeout 15s --connect_timeout 1m --rebalance_interval 1h ``` ### Monitoring and metrics