Documentation ¶
Overview ¶
Package auth implements common functionality to authenticate reclient against GCP.
Index ¶
Constants ¶
View Source
const ( // ExitCodeNoAuth is the exit code when no auth option is specified. ExitCodeNoAuth = 14 // ExitCodeCredsFileAuth is the exit code when there is a failure to authenticate using a credentials file. ExitCodeCredsFileAuth = 13 // ExitCodeGCECredsAuth is the exit code when there is a failure in GCE credentials. ExitCodeGCECredsAuth = 12 // ExitCodeExternalTokenAuth is the exit code when there is a failure to authenticate with an external token. ExitCodeExternalTokenAuth = 11 // ExitCodeAppDefCredsAuth is the exit code when there is a failure to authenticate with ADC. ExitCodeAppDefCredsAuth = 10 // ExitCodeUnknown is the exit code when there is an unknown auth issue. ExitCodeUnknown = 19 )
Exit codes to indicate various causes of authentication failure.
View Source
const ( // UseAppDefaultCredsFlag is used to authenticate with application default credentials. UseAppDefaultCredsFlag = "use_application_default_credentials" // UseExternalTokenFlag indicates the user will authenticate with a provided token. UseExternalTokenFlag = "use_external_auth_token" // UseGCECredsFlag indicates the user will authenticate with GCE VM credentials. UseGCECredsFlag = "use_gce_credentials" // ServiceNoAuthFlag indicates the user will not use authentication ServiceNoAuthFlag = "service_no_auth" // CredentialFileFlag indicates the user authenticate with a credential file CredentialFileFlag = "credential_file" )
Variables ¶
This section is empty.
Functions ¶
func UpdateStatus ¶
UpdateStatus updates ADC credentials status if expired
Types ¶
type Error ¶
type Error struct { // ExitCode is the exit code for the error. ExitCode int // contains filtered or unexported fields }
Error is an error occured during authenticating or initializing credentials.
type Mechanism ¶
type Mechanism int
Mechanism is a mechanism of authentication to the remote execution service.
const ( // Unknown is an unknown auth mechanism. Unknown Mechanism = iota // ADC is GCP's application default credentials authentication mechanism. ADC // GCE is authentication using GCE VM service accounts. GCE // CredentialFile is using service account credentials from a proviced file CredentialFile // None implies that the user will not use authentication None )
func MechanismFromFlags ¶
MechanismFromFlags returns an auth Mechanism based on flags currently set.
Click to show internal directories.
Click to hide internal directories.