Documentation
¶
Overview ¶
Package route provides HTTP route registration and discovery.
Index ¶
- func Authorize(authLevel AuthLevel, handler fiber.Handler) fiber.Handler
- func CheckAccessToken(accessToken string) (uid types.Uid, isValid bool)
- func ErrorResponse(ctx fiber.Ctx, text string) error
- func GetAccessToken(req *http.Request) string
- func GetIntParam(ctx fiber.Ctx, name string) int64
- func GetParam(ctx fiber.Ctx) types.KV
- func GetScopes(ctx fiber.Ctx) []string
- func GetTopic(ctx fiber.Ctx) string
- func GetUid(ctx fiber.Ctx) types.Uid
- func RequireScope(scope string, handler fiber.Handler) fiber.Handler
- func ScopeHandler(ctx fiber.Ctx, scope string) bool
- func SetAuditor(a audit.Auditor)
- func WebService(app *fiber.App, group string, rs ...*Router)
- type AuthLevel
- type Option
- type RequestContext
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
GetAccessToken extracts the API key from an HTTP request.
func RequireScope ¶ added in v0.92.0
func SetAuditor ¶ added in v0.92.0
SetAuditor sets the global auditor used for auth event recording.
Types ¶
type RequestContext ¶ added in v0.92.0
RequestContext is a typed struct stored in fiber.Locals after authorization. It carries the authenticated user identity, request metadata, and scopes.
func GetRequestContext ¶ added in v0.92.0
func GetRequestContext(ctx fiber.Ctx) *RequestContext
GetRequestContext returns the typed RequestContext from fiber.Locals. Returns nil if the request was not authorized.
Click to show internal directories.
Click to hide internal directories.