runtime: provide credentials to services (#1817)

* runtime: inject credentials into service

* util/auth: self generate accounts (needed for jwt)

* runtime/kubernetes: add logging for creds

* runtime/kubernetes: serialize secret name

* runtime/kubernetes: remove unused code

* runtime/kubernetes: base64 encode secret

* runtime/kubernetes: remove metadata from secret

* util/kubernetes/client: omit empty secret metadata

* util/kubernetes/client: fix secret template

* util/kubernetes/client: fix secrets

* web: update auth util

* util/auth: fix missing arg

* extend token expiry

* extend token expiry
This commit is contained in:
ben-toogood
2020-07-10 16:25:46 +01:00
committed by GitHub
parent 3480e0a64e
commit 09ec20fded
10 changed files with 128 additions and 23 deletions

View File

@@ -82,6 +82,8 @@ type CreateOptions struct {
Namespace string
// Specify the context to use
Context context.Context
// Credentials for the service to use
Credentials string
}
// ReadOptions queries runtime services
@@ -126,6 +128,13 @@ func CreateContext(ctx context.Context) CreateOption {
}
}
// CreateCredentials sets the credentials to start the service with
func CreateCredentials(user, pass string) CreateOption {
return func(o *CreateOptions) {
o.Credentials = user + ":" + pass
}
}
// WithCommand specifies the command to execute
func WithCommand(cmd ...string) CreateOption {
return func(o *CreateOptions) {