auth

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: EPL-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

* Copyright contributors to the Galasa project * * SPDX-License-Identifier: EPL-2.0

Index

Constants

View Source
const (
	TOKEN_PROPERTY  = "GALASA_TOKEN"
	TOKEN_SEPARATOR = ":"
)
View Source
const (
	// If a JWT only has less than a certain time left before it expires, don't use it.
	// This sets the boundary where tokens about-to-expire are never returned from the cache.
	TOKEN_EXPIRY_BUFFER_MINUTES = 10
)

Variables

This section is empty.

Functions

func GetTokens added in v0.34.0

func GetTokens(
	apiClient *galasaapi.APIClient,
	console spi.Console,
) error

GetTokens - performs all the logic to implement the `galasactl auth tokens get` command

func NewAuthenticator added in v0.34.0

func NewAuthenticator(
	apiServerUrl string,
	fileSystem spi.FileSystem,
	galasaHome spi.GalasaHome,
	timeService spi.TimeService,
	env spi.Environment,
	jwtCache JwtCache,
) spi.Authenticator

Types

type JwtCache added in v0.34.0

type JwtCache interface {

	// Adds a jwt to the cache.
	Put(serverApiUrl string, galasaToken string, jwt string) error

	// Returns the jwt if we have one, or "" if not.
	Get(serverApiUrl string, galasaToken string) (jwt string, err error)

	// Clears the jwt if we have one in the cache. ie: Logs out.
	Clear(serverApiUrl string, galasaToken string) error

	// Clears all the cache content.
	ClearAll() error
}

func NewJwtCache added in v0.34.0

func NewJwtCache(
	fileSystem spi.FileSystem,
	galasaHome spi.GalasaHome,
	timeService spi.TimeService,
) JwtCache

Jump to

Keyboard shortcuts

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