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.

Source Files