ccproxy.services.auth_registry¶
ccproxy.services.auth_registry
¶
Auth manager registry for plugin system.
AuthManagerRegistry
¶
Registry for auth managers that can be referenced by name.
This registry uses Any types to avoid circular imports with the auth module. The actual auth managers are expected to have a 'create' class method for async instantiation.
Source code in ccproxy/services/auth_registry.py
register_class
¶
Register an auth manager class that will be instantiated on demand.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the auth manager under |
required |
auth_manager_class
|
type[Any]
|
Auth manager class to instantiate |
required |
Source code in ccproxy/services/auth_registry.py
register_factory
¶
Register a factory function for creating auth managers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the auth manager under |
required |
factory
|
Callable[[], Awaitable[Any]]
|
Factory function that returns an auth manager instance |
required |
Source code in ccproxy/services/auth_registry.py
register_instance
¶
Register an existing auth manager instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name to register the auth manager under |
required |
instance
|
Any
|
Auth manager instance |
required |
Source code in ccproxy/services/auth_registry.py
unregister
¶
Unregister an auth manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of auth manager to unregister |
required |
Source code in ccproxy/services/auth_registry.py
get
async
¶
Get an auth manager by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the auth manager to retrieve |
required |
Returns:
| Type | Description |
|---|---|
Any | None
|
Auth manager instance or None if not found |
Source code in ccproxy/services/auth_registry.py
has
¶
list
¶
List all registered auth managers.
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Dictionary mapping auth manager names to their types |
Source code in ccproxy/services/auth_registry.py
get_class
¶
Get the auth manager class if registered via register_class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the auth manager |
required |
Returns:
| Type | Description |
|---|---|
type[Any] | None
|
Auth manager class or None if not found or not registered as class |