feat(k8s): use secret as shared source for admin private key
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good

This commit is contained in:
2024-03-28 15:53:40 +01:00
parent 35717429a2
commit 7de166765b
18 changed files with 351 additions and 60 deletions

View File

@ -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
}
}