jwt

package
v0.0.0-...-ce7e112 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 8 Imported by: 0

Documentation

Overview

Package jwt contains utility functions for generating JWTs from a service account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT(ctx context.Context, audience string) (string, error)

GenerateJWT returns a signed JWT derived from a Google service account. By default, it will generate it based on the service account key defined in the GOOGLE_APPLICATION_CREDENTIALS environment variable. If not, it will assume we are running in a GCE VM, and attempt to use the default service account credentials to generate the JWT instead.

func GenerateTokenWithAudience

func GenerateTokenWithAudience(ctx context.Context, address string) (string, error)

GenerateTokenWithAudience generates a JWT with the FQDN of the given address as its audience.

Types

This section is empty.

Jump to

Keyboard shortcuts

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