options

package
v1.10.29 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CentOS7 = iota
	CentOS6
	Ubuntu14
	Ubuntu16
	Ubuntu18
	Unknown
)

Variables

This section is empty.

Functions

func GetOSType

func GetOSType() int

Types

type Config

type Config struct {
	Version         string                   `json:"version,omitempty"`           //name of the provider
	Service         string                   `json:"service,omitempty"`           //name of the service for the identity
	Services        map[string]ConfigService `json:"services,omitempty"`          //names of the multiple services for the identity
	Ssh             *bool                    `json:"ssh,omitempty"`               //ssh certificate support
	UseRegionalSTS  bool                     `json:"regionalsts,omitempty"`       //whether to use a regional STS endpoint (default is false)
	Accounts        []ConfigAccount          `json:"accounts,omitempty"`          //array of configured accounts
	GenerateRoleKey bool                     `json:"generate_role_key,omitempty"` //private key to be generated for role certificate
	RotateKey       bool                     `json:"rotate_key,omitempty"`        //rotate private key support
}

Config represents entire sia_config file

type ConfigAccount

type ConfigAccount struct {
	Provider string                `json:"provider,omitempty"` //name of the provider
	Name     string                `json:"name,omitempty"`     //name of the service identity
	User     string                `json:"user,omitempty"`     //the user name to chown the cert/key dirs to. If absent, then root.
	Group    string                `json:"group,omitempty"`    //the group name to chown the cert/key dirs to. If absent, then athenz.
	Domain   string                `json:"domain,omitempty"`   //name of the domain for the identity
	Account  string                `json:"account,omitempty"`  //name of the account
	Service  string                `json:"service,omitempty"`  //name of the service for the identity
	Zts      string                `json:"zts,omitempty"`      //the ZTS to contact
	Filename string                `json:"filename,omitempty"` //filename to put the service certificate
	Roles    map[string]ConfigRole `json:"roles,omitempty"`    //map of roles to retrieve certificates for
	OsType   int                   `json:"ostype,omitempty"`   //current operating system
	Version  string                `json:"version,omitempty"`  // sia version number
}

ConfigAccount represts each of the accounts that can be specified in the config file

type ConfigRole

type ConfigRole struct {
	Filename string `json:"filename,omitempty"`
}

ConfigRole represents a role to be specified by user, and specify attributes for the role

type ConfigService

type ConfigService struct {
	Filename string `json:"filename,omitempty"`
	User     string `json:"user,omitempty"`
	Group    string `json:"group,omitempty"`
}

ConfigService represents a service to be specified by user, and specify User/Group attributes for the service

type Options

type Options struct {
	Provider             string
	Name                 string
	User                 string
	Group                string
	Domain               string
	Account              string
	Services             []Service
	Ssh                  bool
	UseRegionalSTS       bool
	Zts                  string
	Filename             string
	Roles                map[string]ConfigRole
	OsType               int
	Version              string
	KeyDir               string
	CertDir              string
	AthenzCACertFile     string
	ZTSCACertFile        string
	ZTSServerName        string
	ZTSAWSDomain         string
	GenerateRoleKey      bool
	RotateKey            bool
	BackUpDir            string
	ProviderParentDomain string
}

Options represents settings that are derived from config file and application defaults

func NewOptions

func NewOptions(bytes []byte, accountId, metaEndPoint, siaDir, version, ztsCaCert, ztsServerName, ztsAwsDomain, providerParentDomain string, sysLogger io.Writer) (*Options, error)

NewOptions takes in sia_config bytes and returns a pointer to Options after parsing and initializing the defaults It uses profile arn for defaults when sia_config is empty or non-parsable. It populates "services" array

type Role

type Role struct {
	Name     string
	Service  string
	Filename string
	User     string
	Uid      int
	Gid      int
	FileMode int
}

Role contains role details. Attributes are set based on the config values

type Service

type Service struct {
	Name     string
	Filename string
	User     string
	Group    string
	Uid      int
	Gid      int
	FileMode int
}

Service represents service details. Attributes are filled in based on the config values

Jump to

Keyboard shortcuts

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