feat(api): declare identity contract for registration, verification, and sessions

This commit is contained in:
shira committed 2026-10-05 22:57:19 +03:00
1 parent 197661145e
commit 653f3775f8
86 files changed
+11826 -148

No files matched your search

@@ -26,16 +26,20 @@ const (
// ht.ErrNotImplemented to 501, request decoding and validation errors to 400,
// unknown routes under /api to 404, unsupported methods to 405, and any other
// server error or panic to 500 without exposing its text. Operation errors go
// through apiHandler.NewError.
// through apiHandler.NewError. security decides every operation that requires
// a session; the generated server answers its rejection, and a request
// without the session cookie, with 401 unauthenticated through NewError.
func NewRouter(
health *v1.HealthHandler,
apiHandler apiadapter.Handler,
security apiadapter.SecurityHandler,
problems *problem.Responder,
collector httpmiddleware.RequestMetrics,
logger *slog.Logger,
) (http.Handler, error) {
apiServer, err := apiadapter.NewServer(
apiHandler,
security,
apiadapter.WithErrorHandler(problems.HandleServerError),
apiadapter.WithNotFound(problems.NotFound),
apiadapter.WithMethodNotAllowed(problems.MethodNotAllowed),