galadrielclient

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotOnboardedErr = errors.New("client has not been onboarded to Galadriel Server")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	SyncBundles(context.Context, []*entity.Bundle) ([]*entity.Bundle, map[spiffeid.TrustDomain][]byte, error)
	PostBundle(context.Context, *entity.Bundle) error
	GetRelationships(context.Context, entity.ConsentStatus) ([]*entity.Relationship, error)
	UpdateRelationship(context.Context, uuid.UUID, entity.ConsentStatus) (*entity.Relationship, error)
}

Client represents a client to interact with the Galadriel Server API.

func NewClient

func NewClient(ctx context.Context, cfg *Config) (Client, error)

NewClient creates a new Galadriel Server client, using the given trustBundlePath to validate the server certificate. It Onboards the client to the Galadriel Server using the given joinToken. If the client has already been onboarded, it will use the existing JWT token.

type Config

type Config struct {
	TrustDomain            spiffeid.TrustDomain
	GaladrielServerAddress *net.TCPAddr
	TrustBundlePath        string
	DataDir                string
	JoinToken              string
	Logger                 logrus.FieldLogger
}

Config is a struct that holds the configuration for the Galadriel Server client.

Jump to

Keyboard shortcuts

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