config

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSingularityRemote

func GetSingularityRemote(name string) (baseURI, authToken string, err error)

GetSingularityRemote returns the base URI and token for the specified remote name. If the remote name is "" then use the default remote. We do not return a Singularity endpoint construct as we want to avoid the handling of overridden keyservers etc - we are *only* working with the enterprise install.

func GetSingularityRemoteYaml

func GetSingularityRemoteYaml() (confPath string, err error)

GetSingularityRemoteYaml returns the path to the singularity installation's remote.yml.

func InitializeConfig

func InitializeConfig(cmd *cobra.Command) error

InitializeConfig handle options from a config file and env vars This approach binds viper config directly onto existing flags belonging to the cobra command cmd. This allows us to handle this configuration selectively for standalon operation only without any changes to the flag / option handling under singularity plugin mode.

MIT Licensed https://github.com/carolynvs/stingoftheviper/blob/main/LICENSE

func UserFromToken

func UserFromToken(token string) (string, error)

UserFromToken returns the user ID from the token sub claim. Validation is not performed here - that is on the server side of any request.

Types

type ServiceConfigResponse

type ServiceConfigResponse struct {
	LibraryAPI struct {
		URI string `json:"uri"`
	} `json:"libraryAPI"`
	BuilderAPI struct {
		URI        string `json:"uri"`
		ManagerURI string `json:"managerUri"`
	} `json:"builderAPI"`
	KeystoreAPI struct {
		URI string `json:"uri"`
	} `json:"keystoreAPI"`
	ConsentAPI struct {
		URI string `json:"uri"`
	} `json:"consentAPI"`
	TokenAPI struct {
		URI string `json:"uri"`
	} `json:"tokenAPI"`
}

type ServiceURIs

type ServiceURIs struct {
	LibraryURI        string
	BuildManagerURI   string
	BuildServerURI    string
	KeyServiceURI     string
	ConsentServiceURI string
	TokenServiceURI   string
}

func GetServiceURIs

func GetServiceURIs(remoteURI string) (uris *ServiceURIs, err error)

GetServiceURIs returns a ServiceURIs struct container the URI of each component service of Enterprise.

Jump to

Keyboard shortcuts

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