feat(auth): consolidate and secure V3 authentication flow

- Re-apply safe guest auth and passcode-to-JWT endpoint
- Consolidate AccountContext with token_payload and role flags
- Restore documentation for new guest flows and public read whitelists
- Fix 403 error in get_obj_li by allowing optional account context
This commit is contained in:
Scott Idem
2026-01-20 18:42:43 -05:00
parent d4e46a4a97
commit 43ac62b561
5 changed files with 392 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ def sign_jwt(
user_id: str = None,
json_str: str = None,
b64_str: str = None,
**kwargs # Allow arbitrary claims (e.g. administrator, manager, super)
**kwargs # Allow arbitrary claims
) -> str:
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -45,7 +45,7 @@ def sign_jwt(
'b64_str': b64_str,
}
# Merge any additional claims provided via kwargs
# Merge additional claims
if kwargs:
payload.update(kwargs)