vault

package
v0.0.0-...-4892902 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLoginEndpoint = "/v1/auth/flant/login"
	ObtainJWTURL         = "/v1/auth/flant/issue/multipass_jwt/"
)

Variables

View Source
var DefaultScheme = "https"

Functions

func DetectScheme

func DetectScheme(addr string) string

func EnsureScheme

func EnsureScheme(addr string, scheme string) string

func SecretDataGetString

func SecretDataGetString(secret *api.Secret, key string, defaults ...string) string

func SecretDataSetString

func SecretDataSetString(secret *api.Secret, key string, value string)

Types

type Client

type Client struct {
	Server        string
	Scheme        string
	LoginEndpoint string
}

func NewClient

func NewClient(addr string) *Client

func (*Client) CheckPendingLogin

func (c *Client) CheckPendingLogin(token string) (interface{}, error)

func (*Client) LoginWithJWTAndClaims

func (c *Client) LoginWithJWTAndClaims(ctx context.Context, jwt string, claimedRoles []v1.RoleWithClaim) (*api.Secret, error)

LoginWithJWT use JWT to auth in Vault and get session token.

Also it follows redirects and return last used server in Data map of api.Secret object.

func (*Client) PrepareServerAddr

func (c *Client) PrepareServerAddr(server string) string

PrepareServerAddr adds schema to a server address.

func (*Client) RefreshJWT

func (c *Client) RefreshJWT(ctx context.Context, jwt string) (string, error)

RefreshJWT opens a new session with vault using current JWT and obtains a new, "refreshed" JWT.

type RedirectSaverClient

type RedirectSaverClient struct {
	*api.Client
	// contains filtered or unexported fields
}

func NewRedirectSaverClient

func NewRedirectSaverClient(cfg *api.Config) (*RedirectSaverClient, error)

func (*RedirectSaverClient) GetTargetServer

func (c *RedirectSaverClient) GetTargetServer() string

Jump to

Keyboard shortcuts

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