config

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 9 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"
)

Variables

View Source
var DefaultARRegistries = [...]string{
	"asia-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",
	"europe-docker.pkg.dev",
	"europe-central2-docker.pkg.dev",
	"europe-north1-docker.pkg.dev",
	"europe-southwest1-docker.pkg.dev",
	"europe-west1-docker.pkg.dev",
	"europe-west2-docker.pkg.dev",
	"europe-west3-docker.pkg.dev",
	"europe-west4-docker.pkg.dev",
	"europe-west6-docker.pkg.dev",
	"europe-west8-docker.pkg.dev",
	"europe-west9-docker.pkg.dev",
	"europe-west12-docker.pkg.dev",
	"me-central1-docker.pkg.dev",
	"me-west1-docker.pkg.dev",
	"northamerica-northeast1-docker.pkg.dev",
	"northamerica-northeast2-docker.pkg.dev",
	"southamerica-east1-docker.pkg.dev",
	"southamerica-west1-docker.pkg.dev",
	"us-docker.pkg.dev",
	"us-central1-docker.pkg.dev",
	"us-east1-docker.pkg.dev",
	"us-east4-docker.pkg.dev",
	"us-east5-docker.pkg.dev",
	"us-south1-docker.pkg.dev",
	"us-west1-docker.pkg.dev",
	"us-west2-docker.pkg.dev",
	"us-west3-docker.pkg.dev",
	"us-west4-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/devstorage.read_write"}

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

View Source
var GcrOAuth2Username = fmt.Sprintf("_dcgcr_%s_token", strings.ReplaceAll(Version, ".", "_"))

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.

View Source
var Version string

Version can be set via: -ldflags="-X 'github.com/rosmo/docker-credential-gcr/v2/config.Version=$TAG'"

Functions

This section is empty.

Types

type UserConfig

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

UserConfig describes

func LoadUserConfig

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