key

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKeyValid

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

IsKeyValid checks if a key is currently valid (i.e., not revoked).

func NewService

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

NewService creates a new auth service

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