cfg

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigPath = "~/.saml2aws"

DefaultConfigPath the default saml2aws configuration path

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

func IsErrIdpAccountNotFound

func IsErrIdpAccountNotFound(err error) bool

IsErrIdpAccountNotFound check if the error is a ErrIdpAccountNotFound

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) LoadVerifyIDPAccount

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

LoadVerifyIDPAccount load the idp account and verify it isn't empty

func (*ConfigManager) SaveIDPAccount

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

SaveIDPAccount save idp account

type IDPAccount

type IDPAccount struct {
	URL        string `ini:"url"`
	Username   string `ini:"username"`
	Provider   string `ini:"provider"`
	MFA        string `ini:"mfa"`
	SkipVerify bool   `ini:"skip_verify"`
	Timeout    int    `ini:"timeout"`
}

IDPAccount saml IDP account

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