tokengenerator

package
v0.0.0-...-32f485c Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenerateAccessTokenFromFile = func(saFilePath string) (string, time.Duration, error) {
	if token, duration := activeAccessToken(); token != "" {
		return token, duration, nil
	}

	data, err := ioutil.ReadFile(saFilePath)
	if err != nil {
		return "", 0, err
	}

	return generateAccessToken(data)
}

Functions

func GenerateApplicationDefaultCredentialsToken

func GenerateApplicationDefaultCredentialsToken() (string, time.Duration, error)

func MakeTokenAgentHandler

func MakeTokenAgentHandler(serviceAccountKey string) http.Handler

Create the token agent handler to provide envoy with access token generated by the service account credential.

It follows the following scheme: Request: GET /local/access_token. Response: access token response is a JSON payload in the format:

{
  "access_token": "string",
  "expires_in": uint
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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