Files
archie/internal/domain/harnesssecret/context.go
T

17 lines
502 B
Go

package harnesssecret
import "context"
type runCredentialKey struct{}
// WithRunCredential binds a proxy or launcher secret operation to its task grant.
func WithRunCredential(ctx context.Context, credential string) context.Context {
return context.WithValue(ctx, runCredentialKey{}, credential)
}
// RunCredential returns the task grant authorizing a secret operation.
func RunCredential(ctx context.Context) string {
credential, _ := ctx.Value(runCredentialKey{}).(string)
return credential
}