internal

package
v0.0.0-...-a1ad6aa Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportYaml

func ExportYaml(data interface{}) error

func GeneratePassword

func GeneratePassword(length int) string

func GetList

func GetList(c *api.Logical, path string) (s []string, err error)

Types

type Client

type Client struct {
	VaultClient *vault.Client
	// contains filtered or unexported fields
}

func NewVaultClient

func NewVaultClient(vaultAddr string, vaultToken string) (*Client, error)

func (*Client) ApplyDataPath

func (c *Client) ApplyDataPath(b []byte, f string) error

func (*Client) ApplyPolicyPath

func (c *Client) ApplyPolicyPath(path string) error

func (*Client) DeleteGivenPath

func (c *Client) DeleteGivenPath(path string) error

type Policy

type Policy struct {
	Name string
}

func NewPolicy

func NewPolicy(name string) (*Policy, error)

type SshRole

type SshRole struct {
	Name               string   `yaml:"name"`
	Key_type           string   `yaml:"key_type"`
	Default_user       string   `yaml:"default_user"`
	Cidr_list          []string `yaml:"cidr_list"`
	Allowed_users      []string `yaml:"allowed_users"`
	Port               int      `yaml:"port"`
	Excluded_cidr_list []string `yaml:"excluded_cidr_list"`
}

func (*SshRole) ApplyToVault

func (s *SshRole) ApplyToVault(c *Client, path string) error

type SshRoleContainer

type SshRoleContainer struct {
	Type             string    `yaml:"type"`
	Path             string    `yaml:"path"`
	SshRoleContainer []SshRole `yaml:"sshroles"`
}

func NewSshContainerFromYaml

func NewSshContainerFromYaml(b []byte) (r *SshRoleContainer, err error)

func (*SshRoleContainer) AppendSshRole

func (r *SshRoleContainer) AppendSshRole(role SshRole) []SshRole

type User

type User struct {
	Name     string   `yaml:"name"`
	Policies []string `yaml:"token_policies"`
	Method   string   `yaml:"method"`
}

func NewUser

func NewUser(name string, policies []string, method string) (user *User, err error)

func (*User) ApplyToVault

func (u *User) ApplyToVault(c *Client) error

type UserContainer

type UserContainer struct {
	Type          string `yaml:"type"`
	UserContainer []User `yaml:"users"`
}

func NewUserContainerFromYaml

func NewUserContainerFromYaml(b []byte) (uc *UserContainer, err error)

func (*UserContainer) AppendUser

func (uc *UserContainer) AppendUser(user User) []User

Jump to

Keyboard shortcuts

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