endpoints

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: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTokenTTL = 600

DefaultTokenTTL is the default TTL for tokens in seconds.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAPIHandlers added in v0.2.0

type AdminAPIHandlers struct {
	Logger    logrus.FieldLogger
	Datastore db.Datastore
}

func NewAdminAPIHandlers added in v0.2.0

func NewAdminAPIHandlers(l logrus.FieldLogger, ds db.Datastore) *AdminAPIHandlers

NewAdminAPIHandlers creates a new NewAdminAPIHandlers

func (*AdminAPIHandlers) GetJoinToken added in v0.2.0

func (h *AdminAPIHandlers) GetJoinToken(echoCtx echo.Context, trustDomainName api.TrustDomainName, params admin.GetJoinTokenParams) error

GetJoinToken generates a join token for the trust domain - (GET /trust-domain/{trustDomainName}/join-token)

func (*AdminAPIHandlers) GetRelationshipByID added in v0.2.0

func (h *AdminAPIHandlers) GetRelationshipByID(echoCtx echo.Context, relationshipID api.UUID) error

GetRelationshipByID retrieves a specific relationship based on its id - (GET /relationships/{relationshipID})

func (*AdminAPIHandlers) GetRelationships added in v0.2.0

func (h *AdminAPIHandlers) GetRelationships(echoCtx echo.Context, params admin.GetRelationshipsParams) error

GetRelationships lists all relationships filtered by the request params - (GET /relationships)

func (*AdminAPIHandlers) GetTrustDomainByName added in v0.2.0

func (h *AdminAPIHandlers) GetTrustDomainByName(echoCtx echo.Context, trustDomainName api.TrustDomainName) error

GetTrustDomainByName retrieves a specific trust domain by its name - (GET /trust-domain/{trustDomainName})

func (*AdminAPIHandlers) PutRelationship added in v0.2.0

func (h *AdminAPIHandlers) PutRelationship(echoCtx echo.Context) error

PutRelationship creates a new relationship request between two trust domains - (PUT /relationships)

func (*AdminAPIHandlers) PutTrustDomain added in v0.2.0

func (h *AdminAPIHandlers) PutTrustDomain(echoCtx echo.Context) error

PutTrustDomain creates a new trust domain - (PUT /trust-domain)

func (*AdminAPIHandlers) PutTrustDomainByName added in v0.2.0

func (h *AdminAPIHandlers) PutTrustDomainByName(echoCtx echo.Context, trustDomainName api.TrustDomainName) error

PutTrustDomainByName updates the trust domain - (PUT /trust-domain/{trustDomainName})

type AuthenticationMiddleware added in v0.2.0

type AuthenticationMiddleware struct {
	// contains filtered or unexported fields
}

func NewAuthenticationMiddleware added in v0.2.0

func NewAuthenticationMiddleware(l logrus.FieldLogger, ds db.Datastore, jwtValidator jwt.Validator) *AuthenticationMiddleware

func (*AuthenticationMiddleware) Authenticate added in v0.2.0

func (m *AuthenticationMiddleware) Authenticate(bearerToken string, echoCtx echo.Context) (bool, error)

Authenticate is the middleware method that is responsible for authenticating the calling Harvester using the JWT token passed in the Authorization header.

type Config

type Config struct {
	TCPAddress   *net.TCPAddr
	LocalAddress net.Addr
	JWTIssuer    jwt.Issuer
	JWTValidator jwt.Validator
	Catalog      catalog.Catalog
	Logger       logrus.FieldLogger
}

Config represents the configuration of the Galadriel Server Endpoints

type Endpoints

type Endpoints struct {
	// contains filtered or unexported fields
}

func New

func New(c *Config) (*Endpoints, error)

func (*Endpoints) ListenAndServe

func (e *Endpoints) ListenAndServe(ctx context.Context) error

type HarvesterAPIHandlers added in v0.2.0

type HarvesterAPIHandlers struct {
	Logger    logrus.FieldLogger
	Datastore db.Datastore
	// contains filtered or unexported fields
}

func NewHarvesterAPIHandlers added in v0.2.0

func NewHarvesterAPIHandlers(l logrus.FieldLogger, ds db.Datastore, jwtIssuer jwt.Issuer, jwtValidator jwt.Validator) *HarvesterAPIHandlers

NewHarvesterAPIHandlers creates a new HarvesterAPIHandlers

func (*HarvesterAPIHandlers) BundlePut added in v0.2.0

func (h *HarvesterAPIHandlers) BundlePut(echoCtx echo.Context, trustDomainName api.TrustDomainName) error

BundlePut uploads a new trust bundle to the server - (PUT /trust-domain/{trustDomainName}/bundles)

func (*HarvesterAPIHandlers) BundleSync added in v0.2.0

func (h *HarvesterAPIHandlers) BundleSync(echoCtx echo.Context, trustDomainName api.TrustDomainName) error

BundleSync synchronizes the status of trust bundles between server and harvester - (POST /trust-domain/{trustDomainName}/bundles/sync)

func (*HarvesterAPIHandlers) GetNewJWTToken added in v0.2.0

func (h *HarvesterAPIHandlers) GetNewJWTToken(echoCtx echo.Context, trustDomainName api.TrustDomainName) error

GetNewJWTToken renews a JWT access token - (GET /trust-domain/jwt)

func (*HarvesterAPIHandlers) GetRelationships added in v0.2.0

func (h *HarvesterAPIHandlers) GetRelationships(echoCtx echo.Context, trustDomainName api.TrustDomainName, params harvester.GetRelationshipsParams) error

GetRelationships lists all the relationships for a given trust domain name and consent status - (GET /relationships) The consent status is optional, if not provided, all relationships will be returned for a given trust domain. If the consent status is provided, only relationships with the given consent status for the given trust domain will be returned. The trust domain name provided should match the authenticated trust domain.

func (*HarvesterAPIHandlers) Onboard added in v0.2.0

func (h *HarvesterAPIHandlers) Onboard(echoCtx echo.Context, trustDomainName api.TrustDomainName, params harvester.OnboardParams) error

Onboard introduces a harvester to Galadriel Server providing its join token, and gets back a JWT token - (GET /trust-domain/onboard)

func (*HarvesterAPIHandlers) PatchRelationship added in v0.2.0

func (h *HarvesterAPIHandlers) PatchRelationship(echoCtx echo.Context, trustDomainName api.TrustDomainName, relationshipID api.UUID) error

PatchRelationship approves/denies relationships requests - (PATCH /trust-domain/{trustDomainName}/relationships/{relationshipID})

type Server

type Server interface {
	// ListenAndServe starts all endpoint servers and blocks until the context
	// is canceled or any of the endpoints fails to run.
	ListenAndServe(ctx context.Context) error
}

Server manages the UDS and TCP endpoints lifecycle

Jump to

Keyboard shortcuts

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