auth

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultScope = "https://www.googleapis.com/auth/cloud-platform"
View Source
const DefaultTokenURI = "https://oauth2.googleapis.com/token"

Variables

This section is empty.

Functions

func ParseRSAPrivateKey

func ParseRSAPrivateKey(pemData string) (*rsa.PrivateKey, error)

func SignAssertion

func SignAssertion(cred Credential, now time.Time) (string, error)

Types

type Credential

type Credential struct {
	Type          string
	ProjectID     string
	PrivateKeyID  string
	PrivateKeyPEM string
	ClientEmail   string
	TokenURI      string
	Scopes        []string
}

Credential is the provider-local GCP credential shape carved out of the service account JSON.

func FromOptions

func FromOptions(options schema.Options) (Credential, error)

func (Credential) Validate

func (c Credential) Validate() error

type Token

type Token struct {
	AccessToken string
	ExpiresAt   time.Time
}

type TokenSource

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

func NewTokenSource

func NewTokenSource(cred Credential, httpClient *http.Client) *TokenSource

func (*TokenSource) Token

func (s *TokenSource) Token(ctx context.Context) (Token, error)

func (*TokenSource) WithScopes

func (s *TokenSource) WithScopes(scopes []string)

Jump to

Keyboard shortcuts

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