endpoint

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigPath is the path to the exposed configuration information.
	ConfigPath = "/assets/config/config.prod.json"
	// DefaultCloudURI is the primary hostname for the cloud service endpoint.
	DefaultCloudURI = "cloud.apptainer.org"
	// DefaultLibraryURI is the URI for the library service.
	DefaultLibraryURI = ""
	// DefaultKeyserverURI is the URI for the keyserver service.
	DefaultKeyserverURI = "https://keys.openpgp.org"
)

Default cloud service endpoints.

View Source
const (
	Consent   = "consent"
	Token     = "token"
	Library   = "library"
	Keystore  = "keystore" // alias for keyserver
	Keyserver = "keyserver"
	Builder   = "builder"
)

cloud services - suffixed with 'API' in config.prod.json.

View Source
const RegistryURIConfigKey = "registryUri"

RegistryURIConfigKey is the config key for the library OCI registry URI

Variables

View Source
var DefaultEndpointConfig = &Config{
	URI:    DefaultCloudURI,
	System: true,
}

DefaultEndpointConfig is the default remote configuration.

View Source
var ErrNoURI = errors.New("no URI set for endpoint")
View Source
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

func (config *Config) AddKeyserver(uri string, order uint32, insecure bool) error

AddKeyserver adds a keyserver for the corresponding remote endpoint.

func (*Config) GetAllServices

func (config *Config) GetAllServices() (map[string][]Service, error)

func (*Config) GetServiceURI

func (config *Config) GetServiceURI(service string) (string, error)

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

func (config *Config) GetURL() (string, error)

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 *Config) KeyserverClientOpts(uri string, op KeyserverOp) ([]keyClient.Option, error)

func (*Config) LibraryClientConfig

func (config *Config) LibraryClientConfig(uri string) (*libClient.Config, error)

func (*Config) RegistryURI added in v1.3.0

func (config *Config) RegistryURI() (string, error)

RegistryURI returns the URI of the backing OCI registry for the library service, associated with ep.

func (*Config) RemoveKeyserver

func (config *Config) RemoveKeyserver(uri string) error

RemoveKeyserver removes a previously added keyserver.

func (*Config) SetCredentials

func (config *Config) SetCredentials(creds []*credential.Config)

func (*Config) UpdateKeyserversConfig

func (config *Config) UpdateKeyserversConfig() error

UpdateKeyserversConfig updates the keyserver configuration for the corresponding remote endpoint.

func (*Config) VerifyToken

func (config *Config) VerifyToken(token string) (err error)

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

type ServiceConfig

type ServiceConfig struct {
	URI      string `yaml:"URI"`
	Skip     bool   `yaml:"Skip"`
	External bool   `yaml:"External"`
	Insecure bool   `yaml:"Insecure"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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