internal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenTypeBearer is the auth header prefix for bearer tokens.
	TokenTypeBearer = "Bearer"

	// QuotaProjectEnvVar is the environment variable for setting the quota
	// project.
	QuotaProjectEnvVar = "GOOGLE_CLOUD_QUOTA_PROJECT"

	// DefaultUniverseDomain is the default value for universe domain.
	// Universe domain is the default service domain for a given Cloud universe.
	DefaultUniverseDomain = "googleapis.com"
)

Variables

This section is empty.

Functions

func CloneDefaultClient

func CloneDefaultClient() *http.Client

CloneDefaultClient returns a http.Client with some good defaults.

func GetProjectID

func GetProjectID(b []byte, override string) string

GetProjectID retrieves project with precedence being: override, environment variable, creds json file.

func GetQuotaProject

func GetQuotaProject(b []byte, override string) string

GetQuotaProject retrieves quota project with precedence being: override, environment variable, creds json file.

func ParseKey

func ParseKey(key []byte) (*rsa.PrivateKey, error)

ParseKey converts the binary contents of a private key file to an *rsa.PrivateKey. It detects whether the private key is in a PEM container or not. If so, it extracts the the private key from PEM container before conversion. It only supports PEM containers with no passphrase.

func ReadAll

func ReadAll(r io.Reader) ([]byte, error)

ReadAll consumes the whole reader and safely reads the content of its body with some overflow protection.

Types

type ComputeUniverseDomainProvider added in v0.2.0

type ComputeUniverseDomainProvider struct {
	// contains filtered or unexported fields
}

ComputeUniverseDomainProvider fetches the credentials universe domain from the google cloud metadata service.

func (*ComputeUniverseDomainProvider) GetProperty added in v0.2.0

func (c *ComputeUniverseDomainProvider) GetProperty(ctx context.Context) (string, error)

GetProperty fetches the credentials universe domain from the google cloud metadata service.

type StaticProperty added in v0.2.0

type StaticProperty string

StaticProperty always returns that value of the underlying string.

func StaticCredentialsProperty added in v0.2.0

func StaticCredentialsProperty(s string) StaticProperty

StaticCredentialsProperty is a helper for creating static credentials properties.

func (StaticProperty) GetProperty added in v0.2.0

func (p StaticProperty) GetProperty(context.Context) (string, error)

GetProperty loads the properly value provided the given context.

Directories

Path Synopsis
Package credsfile is meant to hide implementation details from the pubic surface of the detect package.
Package credsfile is meant to hide implementation details from the pubic surface of the detect package.
testdns
Package testdns is a light DNS client used for testings to avoid pulling in dependencies.
Package testdns is a light DNS client used for testings to avoid pulling in dependencies.
testgcs
Package testgcs is a light GCS client used for testings to avoid pulling in dependencies.
Package testgcs is a light GCS client used for testings to avoid pulling in dependencies.
Package transport provided internal helpers for the two transport packages (grpctransport and httptransport).
Package transport provided internal helpers for the two transport packages (grpctransport and httptransport).
cert/cmd
test_signer.go is a net/rpc server that listens on stdin/stdout, exposing mock methods for testing enterprise certificate proxy flow.
test_signer.go is a net/rpc server that listens on stdin/stdout, exposing mock methods for testing enterprise certificate proxy flow.

Jump to

Keyboard shortcuts

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