Documentation ¶
Index ¶
Constants ¶
const ( // DefaultCachingKeySetProviderTimeToLive is a common default for the timeToLive parameter of CachingKeySetProvider. DefaultCachingKeySetProviderTimeToLive = time.Minute * 5 )
const JWTIssuer = "https://accounts.google.com"
JWTIssuer is a constant for Google's JWT issuer
const (
// KeySetURL is URL of Google's Key Set.
KeySetURL = "https://www.googleapis.com/oauth2/v1/certs"
)
const UserManagedServiceAccountEmailSuffix = ".iam.gserviceaccount.com"
UserManagedServiceAccountEmailSuffix asdf
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeySet ¶
type KeySet = map[string]*x509.Certificate
KeySet contains entries where each entry represents a key identifier and certificate.
type KeySetProvider ¶
type KeySetProvider interface { // The returned map should not be modified. Get(ctx context.Context) (KeySet, error) }
KeySetProvider is an interface for getting a set of keys.
func CachingKeySetProvider ¶
func CachingKeySetProvider(timeToLive time.Duration, base KeySetProvider) KeySetProvider
CachingKeySetProvider wrapss a KeySetProvider and adds caching.
func HTTPSKeySetProvider ¶
func HTTPSKeySetProvider(httpClient *http.Client) KeySetProvider
HTTPSKeySetProvider gets keys from Google's Key Set endpoint (see KeySetURL).
func StaticKeySetProvider ¶
func StaticKeySetProvider(keySet map[string]string) (KeySetProvider, error)
StaticKeySetProvider is an in-memory KeySetProvider. The values of the keySet parameter should be PEM encoded X509 certificates.
type ServiceAccountGetter ¶
ServiceAccountGetter is an abstraction for Google's Golang IAM service for the purpose of unit testing. name must be of the shape projects/x/serviceAccounts/y where x is * or the project ID and y is the email address or unique identifier of the service account. See https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/get
type UserManagedServiceAccount ¶
UserManagedServiceAccount represents a user-managed service account. See https://cloud.google.com/iam/docs/service-accounts#user-managed
func ParseUserManagedServiceAccountFromEmail ¶
func ParseUserManagedServiceAccountFromEmail(v string) (*UserManagedServiceAccount, error)
ParseUserManagedServiceAccountFromEmail parses v as a user-managed service account email. See https://cloud.google.com/iam/docs/service-accounts#user-managed