credential

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GcpTokenFetcher

type GcpTokenFetcher struct {
	// aud is the unique URI agreed upon by both the instance and the system verifying the instance's identity.
	// For more info: https://cloud.google.com/compute/docs/instances/verifying-instance-identity
	Aud string
}

GcpTokenFetcher implements the token fetcher in GCP.

func (*GcpTokenFetcher) FetchServiceAccount

func (fetcher *GcpTokenFetcher) FetchServiceAccount() (string, error)

FetchServiceAccount fetches the GCE VM identity jwt token from its metadata server. Note: this function only works in a GCE VM environment.

func (*GcpTokenFetcher) FetchToken

func (fetcher *GcpTokenFetcher) FetchToken() (string, error)

FetchToken fetches the GCE VM identity jwt token from its metadata server. Note: this function only works in a GCE VM environment.

type TokenFetcher

type TokenFetcher interface {
	FetchToken() (string, error)
	FetchServiceAccount() (string, error)
}

TokenFetcher defines the interface to fetch token.

Jump to

Keyboard shortcuts

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