cfg

package
v2.30.1-0...-fef39ca Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigPath the default saml2aws configuration path
	DefaultConfigPath = "~/.saml2aws"

	// DefaultAmazonWebservicesURN URN used when authenticating to aws using SAML
	// NOTE: This only needs to be changed to log into GovCloud
	DefaultAmazonWebservicesURN = "urn:amazon:webservices"

	// DefaultSessionDuration this is the default session duration which can be overridden in the AWS console
	// see https://aws.amazon.com/blogs/security/enable-federated-api-access-to-your-aws-resources-for-up-to-12-hours-using-iam-roles/
	DefaultSessionDuration = 3600

	// DefaultProfile this is the default profile name used to save the credentials in the aws cli
	DefaultProfile = "saml"
)

Variables

View Source
var ErrIdpAccountNotFound = errors.New("IDP account not found, run configure to set it up")

ErrIdpAccountNotFound returned if the idp account is not found in the configuration file

Functions

This section is empty.

Types

type ConfigManager

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

ConfigManager manage the various IDP account settings

func NewConfigManager

func NewConfigManager(configFile string) (*ConfigManager, error)

NewConfigManager build a new config manager and optionally override the config path

func (*ConfigManager) LoadIDPAccount

func (cm *ConfigManager) LoadIDPAccount(idpAccountName string) (*IDPAccount, error)

LoadIDPAccount load the idp account and default to an empty one if it doesn't exist

func (*ConfigManager) SaveIDPAccount

func (cm *ConfigManager) SaveIDPAccount(idpAccountName string, account *IDPAccount) error

SaveIDPAccount save idp account

type IDPAccount

type IDPAccount struct {
	Name                 string `ini:"name"`
	AppID                string `ini:"app_id"` // used by OneLogin and AzureAD
	URL                  string `ini:"url"`
	Username             string `ini:"username"`
	Password             string `ini:"password"`
	Provider             string `ini:"provider"`
	MFA                  string `ini:"mfa"`
	SkipVerify           bool   `ini:"skip_verify"`
	Timeout              int    `ini:"timeout"`
	AmazonWebservicesURN string `ini:"aws_urn"`
	SessionDuration      int    `ini:"aws_session_duration"`
	Profile              string `ini:"aws_profile"`
	ResourceID           string `ini:"resource_id"` // used by F5APM
	Subdomain            string `ini:"subdomain"`   // used by OneLogin
	RoleARN              string `ini:"role_arn"`
	Region               string `ini:"region"`
	HttpAttemptsCount    string `ini:"http_attempts_count"`
	HttpRetryDelay       string `ini:"http_retry_delay"`
	CredentialsFile      string `ini:"credentials_file"`
	SAMLCache            bool   `ini:"saml_cache"`
	SAMLCacheFile        string `ini:"saml_cache_file"`
	TargetURL            string `ini:"target_url"`
	SilentOutput         bool
}

IDPAccount saml IDP account

func NewIDPAccount

func NewIDPAccount() *IDPAccount

NewIDPAccount Create an idp account and fill in any default fields with sane values

func (IDPAccount) String

func (ia IDPAccount) String() string

func (*IDPAccount) Validate

func (ia *IDPAccount) Validate() error

Validate validate the required / expected fields are set

Jump to

Keyboard shortcuts

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