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
- func GetAuthProperties(fileSystem files.FileSystem, galasaHome utils.GalasaHome, ...) (galasaapi.AuthProperties, error)
- func GetAuthenticatedAPIClient(apiServerUrl string, fileSystem files.FileSystem, galasaHome utils.GalasaHome, ...) (*galasaapi.APIClient, error)
- func GetBearerToken(apiServerUrl string, fileSystem files.FileSystem, galasaHome utils.GalasaHome, ...) (string, error)
- func GetJwtFromRestApi(apiServerUrl string, authProperties galasaapi.AuthProperties) (string, error)
- func Login(apiServerUrl string, fileSystem files.FileSystem, galasaHome utils.GalasaHome, ...) error
- func Logout(fileSystem files.FileSystem, galasaHome utils.GalasaHome) error
Constants ¶
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.