server

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SignatureHeaderString = "X-Vault-Driver-Signature"
)

Variables

This section is empty.

Functions

func Command

func Command() cli.Command

Command implements the server CLI options.

func CreateTokenRequest

func CreateTokenRequest(rw http.ResponseWriter, req *http.Request) (int, error)

func HandleError

func HandleError(s *client.Schemas, t func(http.ResponseWriter, *http.Request) (int, error)) http.Handler

HandleError wraps the HTTP Handler so that errors can be handled and non-200 response codes issued.

func HealthCheck

func HealthCheck(rw http.ResponseWriter, req *http.Request) (int, error)

func NewRouter

func NewRouter() *mux.Router

NewRouter creates and adds all the Routes for a Rancher API and Token service

func RevokeTokenRequest

func RevokeTokenRequest(rw http.ResponseWriter, req *http.Request) (int, error)

func StartServer

func StartServer(c *cli.Context) error

StartServer takes the CLI options and starts a server based on the configuration.

Types

type Config

type Config struct {
	VaultURL      string
	VaultRole     string
	VaultToken    string
	RancherURL    string
	RancherAccess string
	RancherSecret string
}

Config contains config info for server setup.

func (*Config) ValidateConfig

func (c *Config) ValidateConfig() error

type ConfigError

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

func (ConfigError) Error

func (c ConfigError) Error() string

type IntermediateToken

type IntermediateToken struct {
	Accessor string
	Token    string
}

type VaultClient

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

func NewVaultClient

func NewVaultClient(url, token, role string) (*VaultClient, error)

func (*VaultClient) Healthy

func (vc *VaultClient) Healthy() bool

func (*VaultClient) InspectIssuingTokenForConfig

func (vc *VaultClient) InspectIssuingTokenForConfig() error

func (*VaultClient) NewWrappedVaultToken

func (vc *VaultClient) NewWrappedVaultToken(policies []string) (*IntermediateToken, error)

func (*VaultClient) RevokeToken

func (vc *VaultClient) RevokeToken(accessor string) error

func (*VaultClient) StartTokenRefresh

func (vc *VaultClient) StartTokenRefresh() error

type VaultIntermediateTokenResponse

type VaultIntermediateTokenResponse struct {
	client.Resource
	// EncryptedToken is the Vault Token RSA Encrypted with the hosts public key.
	// This prevents replay attacks from another host.
	EncryptedToken string `json:"encryptedToken"`
	Accessor       string `json:"accessor"`
}

func NewVaultTokenResponse

func NewVaultTokenResponse(intermediateToken *IntermediateToken, pubKey string) (*VaultIntermediateTokenResponse, error)

NewVaultTokenResponse returns a VaultIntermedateTokenResponse object

type VaultTokenExpireInput

type VaultTokenExpireInput struct {
	client.Resource
	Accessor  string `json:"accessor"`
	TimeStamp string `json:"timestamp"`
	HostUUID  string `json:"hostUUID"`
}

func (*VaultTokenExpireInput) GetTimeStamp

func (vte *VaultTokenExpireInput) GetTimeStamp() (*time.Time, error)

func (*VaultTokenExpireInput) Prepare

func (vte *VaultTokenExpireInput) Prepare() []byte

func (*VaultTokenExpireInput) SetTimeStamp

func (vte *VaultTokenExpireInput) SetTimeStamp()

type VaultTokenInput

type VaultTokenInput struct {
	client.Resource
	Policies   string `json:"policies"`
	HostUUID   string `json:"hostUUID"`
	TimeStamp  string `json:"timestamp"`
	VolumeName string `json:"volumeName"`
}

func (*VaultTokenInput) GetTimeStamp

func (vti *VaultTokenInput) GetTimeStamp() (*time.Time, error)

func (*VaultTokenInput) Prepare

func (vti *VaultTokenInput) Prepare() []byte

func (*VaultTokenInput) SetTimeStamp

func (vti *VaultTokenInput) SetTimeStamp()

Jump to

Keyboard shortcuts

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