feat(k8s): use secret as shared source for admin private key
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
@ -12,7 +12,8 @@ type Options struct {
|
||||
WriterTokenSecretNamespace string
|
||||
ReaderTokenSecret string
|
||||
ReaderTokenSecretNamespace string
|
||||
PrivateKey string
|
||||
PrivateKeySecret string
|
||||
PrivateKeySecretNamespace string
|
||||
Issuer string
|
||||
Locker lock.Locker
|
||||
LockTimeout time.Duration
|
||||
@ -26,7 +27,8 @@ func NewOptions(funcs ...OptionFunc) *Options {
|
||||
WriterTokenSecretNamespace: "",
|
||||
ReaderTokenSecret: "",
|
||||
ReaderTokenSecretNamespace: "",
|
||||
PrivateKey: "",
|
||||
PrivateKeySecret: "",
|
||||
PrivateKeySecretNamespace: "",
|
||||
Issuer: "",
|
||||
Locker: memory.NewLocker(),
|
||||
LockTimeout: 30 * time.Second,
|
||||
@ -62,9 +64,15 @@ func WithReaderTokenSecretNamespace(namespace string) OptionFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func WithPrivateKey(privateKeyFile string) OptionFunc {
|
||||
func WithPrivateKeySecret(secretName string) OptionFunc {
|
||||
return func(opts *Options) {
|
||||
opts.PrivateKey = privateKeyFile
|
||||
opts.PrivateKeySecret = secretName
|
||||
}
|
||||
}
|
||||
|
||||
func WithPrivateKeySecretNamespace(namespace string) OptionFunc {
|
||||
return func(opts *Options) {
|
||||
opts.PrivateKeySecretNamespace = namespace
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user