Documentation ¶
Index ¶
Constants ¶
View Source
const ( // JSONFormat is the format used to store credentials in JSON JSONFormat = "json" // YAMLFormat is the format used to store credentials in YAML YAMLFormat = "yaml" )
View Source
const ( // BasicAuthMethod credentials used for basic authentication BasicAuthMethod = "basic" // KeyFileAuthMethod data used to authenticate through private key file on git KeyFileAuthMethod = "keyfile" // SSHAgentAuthMethod data used to authenticate through ssh-agent SSHAgentAuthMethod = "ssh-agent" )
View Source
const ( // StoreAuthProvider provider which reads auth directly from the credential StoreAuthProvider = "store" // AWSECRSAuthProvider provider which uses aws ecr get-login-password to get user/password auth AWSECRSAuthProvider = "aws-ecr" // MockAuthProvider is a mocked auth provider MockAuthProvider = "mock" )
View Source
const ( // EnvvarsStore is a store backend that uses environment variables to store credentials EnvvarsStore = "envvars" // LocalStore is a store backend which stores credentials in local file system LocalStore = "local" // MockStore is a mocked backend store MockStore = "mock" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct { // Credentials id ID string // AWSAccessKeyID is the access key ID for the AWS account AWSAccessKeyID string `json:"aws_access_key_id" yaml:"aws_access_key_id" mapstructure:"aws_access_key_id"` // AWSRegion is the region for the AWS account AWSRegion string `json:"aws_region" yaml:"aws_region" mapstructure:"aws_region"` // AWSRoleARN defines the ARN of the role to assume. It is expected to be used when AWSUseDefaultCredentialsChain is true AWSRoleARN string `json:"aws_role_arn" yaml:"aws_role_arn" mapstructure:"aws_role_arn"` // AWSSecretAccessKey is the secret access key for the AWS account AWSSecretAccessKey string `json:"aws_secret_access_key" yaml:"aws_secret_access_key" mapstructure:"aws_secret_access_key"` // AWSProfile is the name of the AWS profile to use AWSProfile string `json:"aws_profile" yaml:"aws_profile" mapstructure:"aws_profile"` AWSSharedCredentialsFiles []string `json:"aws_shared_credentials_files" yaml:"aws_shared_credentials_files" mapstructure:"aws_shared_credentials_files"` AWSSharedConfigFiles []string `json:"aws_shared_config_files" yaml:"aws_shared_config_files" mapstructure:"aws_shared_config_files"` // AWSUseDefaultCredentialsChain must be set to true when you want to use the sdk default's credentials chain described at https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials AWSUseDefaultCredentialsChain bool `` /* 130-byte string literal not displayed */ // DEPRECATEDPassword password for basic auth method DEPRECATEDPassword string `json:"docker_login_password" yaml:"docker_login_password" mapstructure:"docker_login_password"` // DEPRECATEDUsername username for basic auth method DEPRECATEDUsername string `json:"docker_login_username" yaml:"docker_login_username" mapstructure:"docker_login_username"` // Password for basic auth method. It could be used to authenticate to either docker registry or git server Password string `json:"password" yaml:"password" mapstructure:"password"` // Username for basic auth method. It could be used to authenticate to either docker registry or git server Username string `json:"username" yaml:"username" mapstructure:"username"` // PrivateKeyFile is the path to the private key file. It could be used to authenticate to git server PrivateKeyFile string `json:"private_key_file" yaml:"private_key_file" mapstructure:"private_key_file"` // PrivateKeyPassword is the password for the private key file. It could be used to authenticate to git server PrivateKeyPassword string `json:"private_key_password" yaml:"private_key_password" mapstructure:"private_key_password"` // GitSSHUser is the username for the git ssh. It could be used to authenticate to git server GitSSHUser string `json:"git_ssh_user" yaml:"git_ssh_user" mapstructure:"git_ssh_user"` // AllowUseSSHAgent must be set to true when you allow to use the ssh-agent to authenticate to the git server AllowUseSSHAgent bool `json:"use_ssh_agent" yaml:"use_ssh_agent" mapstructure:"use_ssh_agent"` }
Credential containes information to access to a credentials
func (*Credential) IsValid ¶
func (credential *Credential) IsValid() (bool, error)
IsValid return whether a credential is valid, otherwise returns an error with the invalid reason
Click to show internal directories.
Click to hide internal directories.