config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: Apache-2.0 Imports: 7 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 = 1
	// MinorVersion is the credential helper's minor version number.
	MinorVersion = 4
	// PatchVersion is the credential helper's patch version number.
	PatchVersion = 0
)

Variables

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

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

View Source
var GCROAuth2Endpoint = oauth2.Endpoint{
	AuthURL:  "https://accounts.google.com/o/oauth2/v2/auth",
	TokenURL: "https://www.googleapis.com/oauth2/v4/token",
}

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 OAuthHTTPContext = oauth2.NoContext

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

View Source
var SupportedGCRRegistries = map[string]bool{
	"gcr.io":            true,
	"us.gcr.io":         true,
	"eu.gcr.io":         true,
	"asia.gcr.io":       true,
	"b.gcr.io":          true,
	"bucket.gcr.io":     true,
	"appengine.gcr.io":  true,
	"gcr.kubernetes.io": true,
	"beta.gcr.io":       true,
}

SupportedGCRRegistries maps registry URLs to a bool representing whether or not the GCR credentials can be used to authenticate requests for that repository.

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
	DefaultToGCRAccessToken() bool
	SetDefaultToGCRAccessToken(bool) 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