helper

package
v0.0.0-...-2f346a8 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EC2Role

func EC2Role(url string) string

get the role from the iam profile url should generally be: http://169.254.169.254/2016-09-02/meta-data/iam/info

func Fatal_error

func Fatal_error(msg string, e error)

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes returns securely generated random bytes. It will log an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateRandomString

func GenerateRandomString(s int) string

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.

func Get_token_from_vault

func Get_token_from_vault(vault_url string, pkcs7 string, role string, nonce string) []byte

POSTS the url vault-server/auth/aws-ec2/login with identity_doc

func HttpGet

func HttpGet(url string) []byte

get something from somewhere

func Read_file

func Read_file(path string) []byte

Types

type AuthRequest

type AuthRequest struct {
	Role  string `json:"role"`
	Pkcs7 string `json:"pkcs7"`
	Nonce string `json:"nonce"`
}

type Token

type Token struct {
	Token string
}

func (*Token) VaultAPIGet

func (t *Token) VaultAPIGet(url string) string

gets something from the vault api and returns the string url: vault-server/v1/auth/token/lookup-self

Jump to

Keyboard shortcuts

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