auth

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: EPL-2.0 Imports: 13 Imported by: 0

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

Index

Constants

View Source
const (
	TOKEN_PROPERTY  = "GALASA_TOKEN"
	TOKEN_SEPARATOR = ":"
)

Variables

This section is empty.

Functions

func GetAuthProperties

func GetAuthProperties(fileSystem files.FileSystem, galasaHome utils.GalasaHome, env utils.Environment) (galasaapi.AuthProperties, error)

Gets authentication properties from the user's galasactl.properties file or from the environment or a mixture.

func GetAuthenticatedAPIClient

func GetAuthenticatedAPIClient(
	apiServerUrl string,
	fileSystem files.FileSystem,
	galasaHome utils.GalasaHome,
	timeService utils.TimeService,
	env utils.Environment,
) (*galasaapi.APIClient, error)

Gets a new authenticated API client, attempting to log in if a bearer token file does not exist

func GetBearerToken added in v0.33.0

func GetBearerToken(
	apiServerUrl string,
	fileSystem files.FileSystem,
	galasaHome utils.GalasaHome,
	timeService utils.TimeService,
	env utils.Environment,
) (string, error)

Gets a locally-stored bearer token, or attempts to log in and retrieve a new bearer token if one does not already exist

func GetJwtFromRestApi

func GetJwtFromRestApi(apiServerUrl string, authProperties galasaapi.AuthProperties) (string, error)

Gets a JSON Web Token (JWT) from the API server's /auth endpoint

func Login

func Login(apiServerUrl string, fileSystem files.FileSystem, galasaHome utils.GalasaHome, env utils.Environment) error

Login - performs all the logic to implement the `galasactl auth login` command

func Logout

func Logout(fileSystem files.FileSystem, galasaHome utils.GalasaHome) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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