approle

package module
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MPL-2.0 Imports: 6 Imported by: 128 modules, 100 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRoleAuth

type AppRoleAuth struct {
	// contains filtered or unexported fields
}

func NewAppRoleAuth

func NewAppRoleAuth(roleID string, secretID *SecretID, opts ...LoginOption) (*AppRoleAuth, error)

NewAppRoleAuth initializes a new AppRole auth method interface to be passed as a parameter to the client.Auth().Login method.

For a secret ID, the recommended secure pattern is to unwrap a one-time-use response-wrapping token that was placed here by a trusted orchestrator (https://learn.hashicorp.com/tutorials/vault/approle-best-practices?in=vault/auth-methods#secretid-delivery-best-practices) To indicate that the filepath points to this wrapping token and not just a plaintext secret ID, initialize NewAppRoleAuth with the WithWrappingToken LoginOption.

Supported options: WithMountPath, WithWrappingToken

func (*AppRoleAuth) Login

func (a *AppRoleAuth) Login(ctx context.Context, client *api.Client) (*api.Secret, error)

type LoginOption

type LoginOption func(a *AppRoleAuth) error

func WithMountPath

func WithMountPath(mountPath string) LoginOption

func WithWrappingToken

func WithWrappingToken() LoginOption

type SecretID

type SecretID struct {
	// Path on the file system where the secret ID can be found.
	FromFile string
	// The name of the environment variable containing the application's
	// secret ID.
	FromEnv string
	// The secret ID as a plaintext string value.
	FromString string
}

SecretID is a struct that allows you to specify where your application is storing the secret ID required for login to the AppRole auth method. The recommended secure pattern is to use response-wrapping tokens rather than a plaintext value, by passing WithWrappingToken() to NewAppRoleAuth. https://learn.hashicorp.com/tutorials/vault/approle-best-practices?in=vault/auth-methods#secretid-delivery-best-practices

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL