Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (ep *Config) AddKeyserver(uri string, order uint32, insecure bool) error
- func (ep *Config) BuilderClientConfig(uri string) (baseURI, authToken string, err error)
- func (ep *Config) GetAllServices() (map[string][]Service, error)
- func (ep *Config) GetServiceURI(service string) (string, error)
- func (e *Config) GetURL() (string, error)
- func (ep *Config) KeyserverClientOpts(uri string, op KeyserverOp) ([]keyclient.Option, error)
- func (ep *Config) LibraryClientConfig(uri string) (*libclient.Config, error)
- func (ep *Config) RegistryURI() (string, error)
- func (ep *Config) RemoveKeyserver(uri string) error
- func (e *Config) SetCredentials(creds []*credential.Config)
- func (ep *Config) UpdateKeyserversConfig() error
- func (ep *Config) VerifyToken(token string) (err error)
- type KeyserverOp
- type Service
- type ServiceConfig
Constants ¶
const ( // SCSConfigPath is the path to the exposed configuration information of an SCS / Singularity Enterprise instance. SCSConfigPath = "/assets/config/config.prod.json" // SCSDefaultCloudURI is the primary hostname for Sylabs Singularity Container Services. SCSDefaultCloudURI = "cloud.sylabs.io" // SCSDefaultLibraryURI is the URI for the library service in SCS. SCSDefaultLibraryURI = "https://library.sylabs.io" // SCSDefaultKeyserverURI is the URI for the keyserver service in SCS. SCSDefaultKeyserverURI = "https://keys.sylabs.io" // SCSDefaultBuilderURI is the URI for the remote build service in SCS. SCSDefaultBuilderURI = "https://build.sylabs.io" )
Default Sylabs cloud service endpoints.
const ( Consent = "consent" Token = "token" Library = "library" Keystore = "keystore" // alias for keyserver Keyserver = "keyserver" Builder = "builder" )
SCS cloud services - suffixed with 'API' in config.prod.json.
const RegistryURIConfigKey = "registryUri"
RegistryURIConfigKey is the config key for the library OCI registry URI
Variables ¶
var DefaultEndpointConfig = &Config{ URI: SCSDefaultCloudURI, System: true, }
DefaultEndpointConfig is the default remote configuration.
var ErrNoURI = errors.New("no URI set for endpoint")
var ErrStatusNotSupported = errors.New("status not supported")
ErrStatusNotSupported represents the error returned by a service which doesn't support SCS status check.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { URI string `yaml:"URI,omitempty"` // hostname/path - no protocol expected Token string `yaml:"Token,omitempty"` System bool `yaml:"System"` // Was this EndPoint set from system config file Exclusive bool `yaml:"Exclusive"` // true if the endpoint must be used exclusively Insecure bool `yaml:"Insecure,omitempty"` // Allow use of http for service discovery Keyservers []*ServiceConfig `yaml:"Keyservers,omitempty"` // contains filtered or unexported fields }
Config describes a single remote endpoint.
func (*Config) AddKeyserver ¶
AddKeyserver adds a keyserver for the corresponding remote endpoint.
func (*Config) BuilderClientConfig ¶
BuilderClientConfig returns the baseURI and authToken associated with ep, in the context of uri.
func (*Config) GetServiceURI ¶
GetServiceURI returns the URI for the service at the specified SCS endpoint Examples of services: consent, build, library, key, token
func (*Config) GetURL ¶
GetUrl returns a URL with the correct https or http protocol for the endpoint. The protocol depends on whether the endpoint is set 'Insecure'.
func (*Config) KeyserverClientOpts ¶
func (*Config) LibraryClientConfig ¶
func (*Config) RegistryURI ¶
RegistryURI returns the URI of the backing OCI registry for the library service, associated with ep.
func (*Config) RemoveKeyserver ¶
RemoveKeyserver removes a previously added keyserver.
func (*Config) SetCredentials ¶
func (e *Config) SetCredentials(creds []*credential.Config)
func (*Config) UpdateKeyserversConfig ¶
UpdateKeyserversConfig updates the keyserver configuration for the corresponding remote endpoint.
func (*Config) VerifyToken ¶
VerifyToken returns an error if a token is not valid against an endpoint. If token is provided as an argument, it will verify the provided token. If token is "", it will attempt to verify the configured token for the endpoint.
type KeyserverOp ¶
type KeyserverOp uint8
KeyserverOp represents a keyserver operation type.
const ( // KeyserverPushOp represents a key push operation. KeyserverPushOp KeyserverOp = iota // KeyserverPullOp represents a key pull operation. KeyserverPullOp // KeyserverSearchOp represents a key search operation. KeyserverSearchOp // KeyserverVerifyOp represents a key verification operation. KeyserverVerifyOp )
type Service ¶
type Service interface { // URI returns the URI used to access the remote service. URI() string // Status returns the status of the remote service, if supported. Status() (string, error) // contains filtered or unexported methods }
Service represents a remote service, accessible at Service.URI