httpserver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(logger *slog.Logger, cfg config.Config, deps Dependencies) http.Handler

Types

type AuditLogService

type AuditLogService interface {
	List(ctx context.Context, filter auditlogs.Filter) (*auditlogs.Page, error)
}

type AuthSpamService

type AuthSpamService interface {
	CheckDeviceCodeCreate(ctx context.Context, clientInfo requestmeta.ClientInfo) error
	CheckDeviceTokenExchange(ctx context.Context, clientInfo requestmeta.ClientInfo) error
	CheckDeviceDecision(ctx context.Context, username string, clientInfo requestmeta.ClientInfo) error
	CheckRefreshToken(ctx context.Context, clientInfo requestmeta.ClientInfo) error
	CheckLogout(ctx context.Context, clientInfo requestmeta.ClientInfo) error
}

type ClientAuthService

type ClientAuthService interface {
	CreateDeviceCode(ctx context.Context, request *api.DeviceCodeCreateRequest) (*api.DeviceCode, error)
	ApproveDeviceCode(ctx context.Context, userCode string, user db.User) error
	DenyDeviceCode(ctx context.Context, userCode string, user db.User) error
	ExchangeDeviceCode(ctx context.Context, request api.DeviceCodeTokenRequest, userAgent string) (*api.TokenResponse, error)
	RefreshAccessToken(ctx context.Context, request api.RefreshTokenRequest, userAgent string) (*api.TokenResponse, error)
	Logout(ctx context.Context, request api.LogoutRequest) error
}

type DatabasePinger

type DatabasePinger interface {
	Ping(context.Context) error
}

type Dependencies

type Dependencies struct {
	UserStore         identity.UserStore
	DatabasePinger    DatabasePinger
	VLANService       VLANService
	DeviceService     DeviceService
	ClientAuthService ClientAuthService
	AuthSpamService   AuthSpamService
	SessionService    SessionService
	AuditLogService   AuditLogService
}

type DeviceService

type DeviceService interface {
	List(ctx context.Context) ([]devices.DeviceRecord, error)
	Get(ctx context.Context, id uuid.UUID) (devices.DeviceRecord, error)
	Create(ctx context.Context, actor db.User, input api.NetworkDeviceWrite) (devices.DeviceRecord, error)
	Update(ctx context.Context, actor db.User, id uuid.UUID, patch api.NetworkDevicePatch) (devices.DeviceRecord, error)
	Delete(ctx context.Context, actor db.User, id uuid.UUID) error
}

type SessionService

type SessionService interface {
	ValidateSession(ctx context.Context, sessionID string) (bool, error)
	ListProfileSessionsPage(ctx context.Context, user db.User, currentSessionID string, limit, offset int32) (*api.AuthSessionPage, error)
	RevokeProfileSession(ctx context.Context, user db.User, sessionID uuid.UUID) error
	RevokeOtherProfileSessions(ctx context.Context, user db.User, currentSessionID string) error
	ListAdminSessionsPage(ctx context.Context, currentSessionID string, limit, offset int32) (*api.AuthSessionPage, error)
	RevokeAdminSession(ctx context.Context, sessionID uuid.UUID) error
	RevokeAllAdminSessions(ctx context.Context) error
}

type VLANService

type VLANService interface {
	List(ctx context.Context) ([]db.Vlan, error)
	Get(ctx context.Context, vlanID int32) (db.Vlan, error)
	Create(ctx context.Context, actor db.User, input api.VlanWrite) (db.Vlan, error)
	Update(ctx context.Context, actor db.User, vlanID int32, patch api.VlanPatch) (db.Vlan, error)
	Delete(ctx context.Context, actor db.User, vlanID int32) error
}

Jump to

Keyboard shortcuts

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