key

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKeyValid

func IsKeyValid(ctx context.Context, key core.Key) bool

func NewService

func NewService(repository Repository, config core.Config) core.KeyService

NewService creates a new auth service

func ValidateKeyResolution

func ValidateKeyResolution(keys []core.Key) (string, error)

Types

type Handler

type Handler interface {
	GetKeyResolution(c echo.Context) error
	GetKeyMine(c echo.Context) error
}

Handler is the interface for handling HTTP requests

func NewHandler

func NewHandler(service core.KeyService) Handler

NewHandler creates a new handler

type Repository

type Repository interface {
	Enact(ctx context.Context, key core.Key) (core.Key, error)
	Revoke(ctx context.Context, keyID string, payload string, signature string, signedAt time.Time) (core.Key, error)
	Get(ctx context.Context, keyID string) (core.Key, error)
	GetAll(ctx context.Context, owner string) ([]core.Key, error)
	GetRemoteKeyResolution(ctx context.Context, remote string, keyID string) ([]core.Key, error)
	Clean(ctx context.Context, ccid string) error
}

func NewRepository

func NewRepository(
	db *gorm.DB,
	mc *memcache.Client,
	client client.Client,
) Repository

Jump to

Keyboard shortcuts

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