actas

package
v0.0.0-...-ebb4f00 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package actas provides a TokenSource that returns access tokens that impersonate a different service account other than the default app credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenSource

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

TokenSource is an oauth2.TokenSource implementation that provides impersonated credentials. The current implementation uses the application default credentials to sign for the impersonated credentials. This means whatever service account is running the code needs to be a member in the ServiceAccountTokenCreator role for the impersonated service account.

func NewTokenSource

func NewTokenSource(ctx context.Context, cred credentials.PerRPCCredentials, client *http.Client, actAsAccount string, scopes []string) *TokenSource

NewTokenSource returns a impersonated credentials token source.

func (*TokenSource) Token

func (s *TokenSource) Token() (*oauth2.Token, error)

Token returns an authorization token for the impersonated service account.

Jump to

Keyboard shortcuts

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