gatekeeper

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTaskId = errors.New("No task id provided.")

Functions

func EnvRequestVaultToken

func EnvRequestVaultToken() (string, error)

func LoadCACert

func LoadCACert(path string) (*x509.CertPool, error)

Loads the certificate from given path and creates a certificate pool from it.

func LoadCAPath

func LoadCAPath(path string) (*x509.CertPool, error)

Loads the certificates present in the given directory or file and creates a certificate pool from it. Assumes that _only_ PEM formatted cert files are present in the given directory. The presence of other files will cause this to fail.

func RequestVaultToken

func RequestVaultToken(taskId string) (string, error)

Types

type Client

type Client struct {
	VaultAddress      string
	GatekeeperAddress string
	HttpClient        *http.Client
}
var DefaultClient *Client

func NewClient

func NewClient(vaultAddress, gatekeeperAddress string, certPool *x509.CertPool) (*Client, error)

func (*Client) GetStatus

func (c *Client) GetStatus() (*GatekeeperStatus, error)

func (*Client) InsecureSkipVerify

func (c *Client) InsecureSkipVerify(skipVerify bool)

func (*Client) IsSealed

func (c *Client) IsSealed() (bool, error)

func (*Client) ReloadPolicies

func (c *Client) ReloadPolicies() (*GatekeeperResponse, error)

func (*Client) RequestVaultToken

func (c *Client) RequestVaultToken(taskId string) (string, error)

func (*Client) Unseal

func (c *Client) Unseal(req *UnsealRequest) (*GatekeeperResponse, error)

type GatekeeperResponse

type GatekeeperResponse struct {
	OK     bool   `json:"ok"`
	Status string `json:"status"`
	Error  string `json:"error"`
}

type GatekeeperStatus

type GatekeeperStatus struct {
	OK      bool                   `json:"ok"`
	Started string                 `json:"started"`
	Status  string                 `json:"status"`
	Uptime  string                 `json:"uptime"`
	Stats   map[string]interface{} `json:"stats"`
}

type UnsealRequest

type UnsealRequest struct {
	Type            string `json:"type"`
	Token           string `json:"token"`
	CubbyPath       string `json:"cubby_path"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	AppID           string `json:"app_id"`
	UserIdMethod    string `json:"user_id_method"`
	UserIdInterface string `json:"user_id_interface"`
	UserIdPath      string `json:"user_id_path"`
	UserIdHash      string `json:"user_id_hash"`
	UserIdSalt      string `json:"user_id_salt"`
}

type VaultError

type VaultError struct {
	Code   int      `json:"-"`
	Errors []string `json:"errors"`
}

func (VaultError) Error

func (e VaultError) Error() string

Jump to

Keyboard shortcuts

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