UserContextDict (registry_pkgs/types.py)

jarvis-registry · registry-pkgs/src/registry_pkgs/types.py · python · Apache-2.0
auth

TypedDict for user context data shared across auth, registry, and MCP services.

# Source: https://github.com/ascending-llc/jarvis-registry | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Shared, framework-agnostic types used across ``registry``, ``auth-server``, and ``registry_pkgs``."""

from __future__ import annotations

from typing import NotRequired, TypedDict


class UserContextDict(TypedDict):
    """
    UserContextDict is the type of the dictionary set as the Request.state.user attribute for each incoming request
    **to a non-public route** by the UnifiedAuthMiddlware.
    If a FastAPI path operation function needs to access this UserContextDict information, it can retrieve this dictionary
    by asking for the `user_context: CurrentUser` depende

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key