Expand description
Shared helpers: path matching, Redis key/value plumbing, signing-method resolution and the package’s custom duration format.
Functions§
- build_
redis_ key - Creates a Redis key with the configured prefix.
- deserialize_
session_ data - Deserializes JSON data from Redis into session data.
- format_
user - Renders a user for the callback page and JSON responses:
idandrolesplus any extra fields the application attached inUser::user. - go_
duration_ string - Renders a duration the way Go’s
time.Duration.Stringdoes, e.g.5m0sor8760h0m0s. Thetokenlifeclaim uses this format, so tokens stay readable by the Go implementation of this package. - is_
excluded_ path - Reports whether
pathstarts with any prefix inexcluded. Prefix matching is intentional so callers can opt entire route trees out of authentication (e.g./api/public). - parse_
custom_ duration - Parses values such as
30s,15m,1h,7d,4w,1moor1y. The empty string falls back todefault_input. - resolve_
signing_ method - Maps a configured signing-method name onto a JWT algorithm, defaulting to HS256 for empty or unrecognised values.
- serialize_
session_ data - Serializes session data to JSON for Redis storage.
- string_
claim - Safely extracts a string value from a decoded claim set.
- validate_
session_ data - Validates session data for required fields.