config

package
v2.0.5+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package config provides variables used in configuring the behavior of the app.

Index

Constants

View Source
const (
	// GCRCredHelperClientID is the client_id to be used when performing the
	// OAuth2 Authorization Code grant flow.
	// See https://developers.google.com/identity/protocols/OAuth2InstalledApp
	GCRCredHelperClientID = "99426463878-o7n0bshgue20tdpm25q4at0vs2mr4utq.apps.googleusercontent.com"

	// GCRCredHelperClientNotSoSecret is the client_secret to be used when
	// performing the OAuth2 Authorization Code grant flow.
	// See https://developers.google.com/identity/protocols/OAuth2InstalledApp
	GCRCredHelperClientNotSoSecret = "HpVi8cnKx8AAkddzaNrSWmS8"

	// MajorVersion is the credential helper's major version number.
	MajorVersion = 2
	// MinorVersion is the credential helper's minor version number.
	MinorVersion = 0
	// PatchVersion is the credential helper's patch version number.
	PatchVersion = 4
)

Variables

View Source
var DefaultARRegistries = [...]string{
	"northamerica-northeast1-docker.pkg.dev", "us-central1-docker.pkg.dev",
	"us-east1-docker.pkg.dev", "us-east4-docker.pkg.dev",
	"us-west2-docker.pkg.dev", "us-west1-docker.pkg.dev",
	"us-west3-docker.pkg.dev", "us-west4-docker.pkg.dev",
	"southamerica-east1-docker.pkg.dev", "europe-central2-docker.pkg.dev",
	"europe-north1-docker.pkg.dev", "europe-west1-docker.pkg.dev",
	"europe-west2-docker.pkg.dev", "europe-west3-docker.pkg.dev",
	"europe-west4-docker.pkg.dev", "europe-west5-docker.pkg.dev",
	"europe-west6-docker.pkg.dev", "asia-east1-docker.pkg.dev",
	"asia-east2-docker.pkg.dev", "asia-northeast1-docker.pkg.dev",
	"asia-northeast2-docker.pkg.dev", "asia-northeast3-docker.pkg.dev",
	"asia-south1-docker.pkg.dev", "asia-south2-docker.pkg.dev",
	"asia-southeast1-docker.pkg.dev", "asia-southeast2-docker.pkg.dev",
	"australia-southeast1-docker.pkg.dev", "australia-southeast2-docker.pkg.dev",
	"asia-docker.pkg.dev", "europe-docker.pkg.dev", "us-docker.pkg.dev",
}

DefaultARRegistries contains the list of default registries for Artifact Registry. If the --include-artifact-registry flag is supplied then these are added in addition to the GCR Registries.

View Source
var DefaultGCRRegistries = [...]string{
	"gcr.io",
	"us.gcr.io",
	"eu.gcr.io",
	"asia.gcr.io",
	"marketplace.gcr.io",
}

DefaultGCRRegistries contains the list of default registries to authenticate for.

View Source
var DefaultTokenSources = [...]string{"store", "env"}

DefaultTokenSources designates which default source(s) should be used to fetch a GCR access_token, and in which order.

View Source
var GCROAuth2Endpoint = google.Endpoint

GCROAuth2Endpoint describes the oauth2.Endpoint to be used when authenticating a GCR user.

View Source
var GCRScopes = []string{"https://www.googleapis.com/auth/cloud-platform"}

GCRScopes is/are the OAuth2 scope(s) to request during access_token creation.

View Source
var GcrOAuth2Username = fmt.Sprintf("_dcgcr_%d_%d_%d_token", MajorVersion, MinorVersion, PatchVersion)

GcrOAuth2Username is the Basic auth username accompanying Docker requests to GCR.

View Source
var OAuthHTTPContext = context.Background()

OAuthHTTPContext is the HTTP context to use when performing OAuth2 calls.

View Source
var SupportedGCRTokenSources = map[string]string{
	"env":    "Application default credentials or GCE/AppEngine metadata.",
	"gcloud": "'gcloud auth print-access-token'",
	"store":  "The file store maintained by the credential helper.",
}

SupportedGCRTokenSources maps config keys to plain english explanations for where the helper should search for a GCR access token.

Functions

This section is empty.

Types

type UserConfig added in v1.1.0

type UserConfig interface {
	TokenSources() []string
	SetTokenSources([]string) error
	ResetAll() error
}

UserConfig describes

func LoadUserConfig added in v1.3.3

func LoadUserConfig() (UserConfig, error)

LoadUserConfig returns the UserConfig which provides user-configurable application settings, or a new on if it doesn't exist.

Jump to

Keyboard shortcuts

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