{"modulePath":"github.com/NSObjects/echo-admin","version":"v0.0.0-20261123060830-db778388ce95","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package authhttp\n\nPackage authhttp adapts authentication HTTP requests to the auth usecase.\n\n## Constants\n\n```go\nconst (\n\t// LoginSessionCookieName is the HttpOnly browser credential for login\n\t// sessions. The composition root injects this name into the login-session\n\t// middleware so read and write sides share one declaration.\n\tLoginSessionCookieName = \"login_session\"\n\t// CSRFCookieName is the browser-readable double-submit CSRF cookie.\n\tCSRFCookieName = \"csrf_token\"\n)\n```\n\n## Functions\n\n```go\nfunc CSRFMiddlewareConfig(exemptions []middlewares.RouteExemption, secure bool) middleware.CSRFConfig\n```\nCSRFMiddlewareConfig returns the Echo CSRF middleware configuration used for browser login-session requests. It shares the login-session exemptions because a route without a login session has no CSRF obligation.\n\n```go\nfunc ClearCSRFCookie(c *echo.Context, secure bool)\n```\nClearCSRFCookie removes the browser-readable CSRF token.\n\n```go\nfunc ClearLoginSessionCookie(c *echo.Context, secure bool)\n```\nClearLoginSessionCookie removes the browser session credential.\n\n```go\nfunc NewCSRFToken() (string, error)\n```\nNewCSRFToken creates a browser-readable CSRF token for login responses.\n\n```go\nfunc Register(group *echo.Group, handler *Handler)\n```\nRegister mounts authentication routes on group.\n\n```go\nfunc SetCSRFCookie(c *echo.Context, token string, expiresAt time.Time, secure bool)\n```\nSetCSRFCookie stores the browser-readable CSRF token used by Echo's CSRF middleware.\n\n```go\nfunc SetLoginSessionCookie(c *echo.Context, token string, expiresAt time.Time, secure bool)\n```\nSetLoginSessionCookie stores the opaque browser session credential.\n\n## Types\n\n```go\ntype Handler struct {\n\t// contains filtered or unexported fields\n}\n```\nHandler adapts auth HTTP requests to the auth usecase.\n\n```go\nfunc New(uc *usecase.Usecase, secureCookies bool) *Handler\n```\nNew creates an auth HTTP handler.\n\n```go\nfunc (h *Handler) ChangePassword(c *echo.Context) error\n```\nChangePassword updates the current administrator password and revokes other login sessions for the same administrator.\n\n```go\nfunc (h *Handler) Login(c *echo.Context) error\n```\nLogin handles administrator login.\n\n```go\nfunc (h *Handler) Logout(c *echo.Context) error\n```\nLogout revokes the current login session on the server.\n\n```go\nfunc (h *Handler) LogoutOthers(c *echo.Context) error\n```\nLogoutOthers revokes the current administrator's other login sessions.\n\n```go\nfunc (h *Handler) Me(c *echo.Context) error\n```\nMe returns the authenticated administrator profile.\n\n```go\nfunc (h *Handler) SwitchRole(c *echo.Context) error\n```\nSwitchRole changes the active role for the current administrator.\n\n```go\nfunc (h *Handler) UpdateProfile(c *echo.Context) error\n```\nUpdateProfile updates the current administrator's profile fields.\n\n","path":"github.com/NSObjects/echo-admin/internal/modules/auth/http","name":"authhttp","synopsis":"Package authhttp adapts authentication HTTP requests to the auth usecase.","isRedistributable":true}
