Documentation ¶
Overview ¶
Package appcreds contains utilities to generate and interact with Aporeto AppCredentials.
Index ¶
- func Create(ctx context.Context, m manipulate.Manipulator, namespace string, ...) error
- func New(ctx context.Context, m manipulate.Manipulator, namespace string, name string, ...) (*gaia.AppCredential, error)
- func NewWithAppCredential(ctx context.Context, m manipulate.Manipulator, template *gaia.AppCredential) (*gaia.AppCredential, error)deprecated
- func NewWithOptions(ctx context.Context, m manipulate.Manipulator, namespace string, name string, ...) (*gaia.AppCredential, error)
- func Renew(ctx context.Context, m manipulate.Manipulator, creds *gaia.AppCredential) (*gaia.AppCredential, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶ added in v1.71.0
func Create(ctx context.Context, m manipulate.Manipulator, namespace string, ac *gaia.AppCredential) error
Create generates a new CSR for the provided app credential and calls the upstream service using the supplied manipulator to provision the app credential. The returned credential will have the private key used to generate the CSR added back as an attribute. An error and a nil app cred reference is returned if CSR generation or the API call to the upstream service failed.
func New ¶
func New(ctx context.Context, m manipulate.Manipulator, namespace string, name string, roles []string, subnets []string) (*gaia.AppCredential, error)
New creates a new *gaia.AppCredential.
func NewWithAppCredential
deprecated
func NewWithAppCredential(ctx context.Context, m manipulate.Manipulator, template *gaia.AppCredential) (*gaia.AppCredential, error)
NewWithAppCredential creates a new *gaia.AppCredential from an *AppCredential
Deprecated: use Create instead
func NewWithOptions ¶ added in v1.77.1
func NewWithOptions(ctx context.Context, m manipulate.Manipulator, namespace string, name string, roles []string, options ...Option) (*gaia.AppCredential, error)
NewWithOptions returns an *gaia.AppCredential according to the provided configuration.
func Renew ¶
func Renew(ctx context.Context, m manipulate.Manipulator, creds *gaia.AppCredential) (*gaia.AppCredential, error)
Renew renews the given appcred.
Types ¶
type Option ¶ added in v1.77.1
type Option func(*config)
An Option can be used to configure a new appcred.
func OptionMaxValidity ¶ added in v1.77.1
OptionMaxValidity configures the appcred to only capable of delivering token with the provided max validity.
func OptionSubnets ¶ added in v1.77.1
OptionSubnets configures the appcred to only work when used from one of the provided subnet.