Add Namespace to Auth (#1438)
Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
@@ -73,6 +73,8 @@ type GenerateOptions struct {
|
||||
Roles []string
|
||||
// SecretExpiry is the time the secret should live for
|
||||
SecretExpiry time.Duration
|
||||
// Namespace the account belongs too
|
||||
Namespace string
|
||||
}
|
||||
|
||||
type GenerateOption func(o *GenerateOptions)
|
||||
@@ -91,6 +93,13 @@ func WithRoles(rs ...string) GenerateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithNamespace for the generated account
|
||||
func WithNamespace(n string) GenerateOption {
|
||||
return func(o *GenerateOptions) {
|
||||
o.Namespace = n
|
||||
}
|
||||
}
|
||||
|
||||
// WithSecretExpiry for the generated account's secret expires
|
||||
func WithSecretExpiry(ex time.Duration) GenerateOption {
|
||||
return func(o *GenerateOptions) {
|
||||
|
Reference in New Issue
Block a user