fix(cloudcommon): add rbac_policy_refresh_internval_seconds option

Add new option rbac_policy_refresh_interval_seconds to control the
valid duration of a policy cache. The option is introduced at 3.6.
Replace option rbac_policy_sync_period_seconds.
This commit is contained in:
Qiu Jian
2020-12-20 01:30:12 +08:00
parent d819989bc2
commit 792bfe533c
2 changed files with 4 additions and 4 deletions

View File

@@ -94,7 +94,7 @@ func InitAuth(options *common_options.CommonOptions, authComplete auth.AuthCompl
func InitBaseAuth(options *common_options.BaseOptions) {
if options.EnableRbac {
policy.EnableGlobalRbac(
time.Second*time.Duration(options.RbacPolicySyncPeriodSeconds),
time.Second*time.Duration(options.RbacPolicyRefreshIntervalSeconds),
options.RbacDebug,
)
}

View File

@@ -73,9 +73,9 @@ type BaseOptions struct {
NotifyAdminUsers []string `default:"sysadmin" help:"System administrator user ID or name to notify system events, if domain is not default, specify domain as prefix ending with double backslash, e.g. domain\\\\user"`
NotifyAdminGroups []string `help:"System administrator group ID or name to notify system events, if domain is not default, specify domain as prefix ending with double backslash, e.g. domain\\\\group"`
EnableRbac bool `help:"Switch on Role-based Access Control" default:"true"`
RbacDebug bool `help:"turn on rbac debug log" default:"false"`
RbacPolicySyncPeriodSeconds int `help:"policy sync interval in seconds, default half a minute" default:"30"`
EnableRbac bool `help:"Switch on Role-based Access Control" default:"true"`
RbacDebug bool `help:"turn on rbac debug log" default:"false"`
RbacPolicyRefreshIntervalSeconds int `help:"policy refresh interval in seconds, default half a minute" default:"30"`
// RbacPolicySyncFailedRetrySeconds int `help:"seconds to wait after a failed sync, default 30 seconds" default:"30"`
ConfigSyncPeriodSeconds int `help:"service config sync interval in seconds, default 30 minutes" default:"1800"`