tokens

package
v0.0.0-...-169af06 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	Scope string `json:"scope"`
	jwt.RegisteredClaims
}

CustomClaims models claims that Google Cloud can authenticate via a JWT.

type TokenService

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

TokenService manages minting tokens.

func NewTokenService

func NewTokenService(serviceAccountEmail string, tokenDuration time.Duration, appcheckClient *appcheck.Client) (*TokenService, error)

func (*TokenService) GenerateToken

func (ts *TokenService) GenerateToken(requestedAPIs []string) (string, error)

GenerateToken generates a JWT valid for use calling the Google Maps Platform Routes API. The token is signed is issued and signed by the available service account.

func (*TokenService) VerifyAppCheck

func (ts *TokenService) VerifyAppCheck(token string) (bool, error)

VerifyAppCheck verifies if the supplied Firebase App Check token is valid or not.

Jump to

Keyboard shortcuts

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