endpoint

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCloudURI     = "cloud.apptainer.org"
	DefaultLibraryURI   = ""
	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

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) 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() string
	Status() (string, error)
}

Service defines a simple service interface which can be exposed to retrieve service URI and check the service status.

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