Documentation
¶
Overview ¶
Package jwt provides an implementation of the JWT Auth Method for Vault.
Index ¶
Constants ¶
const DefaultMountPath = "jwt"
DefaultMountPath specifies the default mount path for the JWT Authentication Method.
Variables ¶
var ErrInvalidMountPath = errors.New("invalid auth method mount path specified")
ErrInvalidMountPath is an error, which is returned when configuring Auth to use an invalid mount path for a Vault Authentication Method.
var ErrNoRoleName = errors.New("no role name specified")
ErrNoRoleName is an error, which is returned when no role name was specified when creating a Auth.
var ErrNoToken = errors.New("no token specified")
ErrNoToken is an error, which is returned when Auth is configured with an empty token.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth implements support for the JWT Authentication Method.
func New ¶
New creates a new Auth and configures it with the given options.
The default mount path for the JWT Authentication Method is DefaultMountPath. In order to configure a different mount path for the Authentication Method you can use the WithMountPath option.
The JWT token which will be used for authentication against the Vault Authentication Method login endpoint may be specified either as a string, from path, or via an environment variable. In order to configure the token for authentication use the WithToken, WithTokenFromPath or WithTokenFromEnv options.
type Option ¶
Option is a function which configures Auth.
func WithMountPath ¶
WithMountPath is an Option, which configures Auth to use the given mount path for the Vault Authentication Method.
func WithToken ¶
WithToken is an Option, which configures Auth to use the given token when authenticating against the Vault JWT Authentication Method.
func WithTokenFromEnv ¶
WithTokenFromEnv is an Option, which configures Auth to read the token from the given environment variable.