Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- func (config *Config) AddKeyserver(uri string, order uint32, insecure bool) error
- func (config *Config) GetAllServices() (map[string][]Service, error)
- func (config *Config) GetServiceURI(service string) (string, error)
- func (config *Config) GetURL() (string, error)
- func (config *Config) KeyserverClientOpts(uri string, op KeyserverOp) ([]keyClient.Option, error)
- func (config *Config) LibraryClientConfig(uri string) (*libClient.Config, error)
- func (config *Config) RemoveKeyserver(uri string) error
- func (config *Config) SetCredentials(creds []*credential.Config)
- func (config *Config) UpdateKeyserversConfig() error
- func (config *Config) VerifyToken(token string) (err error)
- type KeyserverOp
- type Service
- type ServiceConfig
Constants ¶
const ( DefaultCloudURI = "cloud.apptainer.org" DefaultLibraryURI = "" DefaultKeyserverURI = "https://keys.openpgp.org" )
Default cloud service endpoints.
const ( Consent = "consent" Token = "token" Library = "library" Keystore = "keystore" // alias for keyserver Keyserver = "keyserver" Builder = "builder" )
cloud services
Variables ¶
var DefaultEndpointConfig = &Config{ URI: DefaultCloudURI, 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 cloud 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) GetAllServices ¶
func (*Config) GetServiceURI ¶
GetServiceURI returns the URI for the service at the specified endpoint Examples of services: consent, library, key, token
func (*Config) GetURL ¶ added in v1.1.0
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) RemoveKeyserver ¶
RemoveKeyserver removes a previously added keyserver.
func (*Config) SetCredentials ¶
func (config *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 )