auth

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthSubLookupKey added in v0.4.11

func AuthSubLookupKey(principal string) string

AuthSubLookupKey returns the best key for an auth-service user_metadata lookup: a principal that is already provider-qualified (contains "|", e.g. "auth0|abc", "oidc|…") is returned unchanged, while a bare LFID username is mapped to its deterministic "auth0|" sub. Resolving by sub lets auth-service do a cheap get-by-id instead of a rate-limited Auth0 user search.

func MapUsernameToAuthSub

func MapUsernameToAuthSub(username string) string

MapUsernameToAuthSub converts an LFX username to the Auth0 user_id format used by the Auth0 Management API (auth0|{userID}). Not used for v2 service writes or JWT impersonation.

The mapping logic:

  • Safe usernames (matching safeNameRE and not hexUserRE): use directly as userID
  • Unsafe usernames: hash with SHA512 and encode to base58 (~88 chars) for legacy usernames longer than 60 characters, with non-standard chars, or that might collide with future 24+ character Auth0 native DB hexadecimal hash

Returns: "auth0|{userID}" format string

Types

This section is empty.

Jump to

Keyboard shortcuts

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