Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthSubLookupKey ¶ added in v0.4.11
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.