ccproxy.core.plugins.interfaces¶
ccproxy.core.plugins.interfaces
¶
Abstract interfaces for the plugin system.
This module contains all abstract base classes and protocols to avoid circular dependencies between factory and runtime modules.
ProfiledTokenManagerProtocol
¶
PluginFactory
¶
Bases: ABC
Abstract factory for creating plugin runtime instances.
Each plugin must provide a factory that knows how to create its runtime instance from its manifest.
get_manifest
abstractmethod
¶
Get the plugin manifest with static declarations.
Returns:
| Type | Description |
|---|---|
PluginManifest
|
Plugin manifest |
create_runtime
abstractmethod
¶
create_context
abstractmethod
¶
Create the context for plugin initialization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
core_services
|
ServiceContainer
|
Core services container |
required |
Returns:
| Type | Description |
|---|---|
PluginContext
|
Plugin context with required services |
Source code in ccproxy/core/plugins/interfaces.py
BasePluginFactory
¶
Bases: PluginFactory
Base implementation of plugin factory.
This class provides common functionality for creating plugin runtime instances from manifests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
PluginManifest
|
Plugin manifest |
required |
runtime_class
|
type[Any]
|
Runtime class to instantiate |
required |
Source code in ccproxy/core/plugins/interfaces.py
get_manifest
¶
create_runtime
¶
create_context
¶
Create base context for plugin initialization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service_container
|
ServiceContainer
|
Service container with all available services |
required |
Returns:
| Type | Description |
|---|---|
PluginContext
|
Plugin context with base services |
Source code in ccproxy/core/plugins/interfaces.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
ProviderPluginFactory
¶
Bases: BasePluginFactory
Factory for provider plugins.
Provider plugins require additional components like adapters and detection services that must be created during initialization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
PluginManifest
|
Plugin manifest |
required |
Source code in ccproxy/core/plugins/interfaces.py
create_context
¶
Create context with provider-specific components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
core_services
|
Core services container |
required |
Returns:
| Type | Description |
|---|---|
PluginContext
|
Plugin context with provider components |
Source code in ccproxy/core/plugins/interfaces.py
create_adapter
abstractmethod
async
¶
Create the adapter for this provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
PluginContext
|
Plugin context |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Provider adapter instance |
create_detection_service
abstractmethod
¶
Create the detection service for this provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
PluginContext
|
Plugin context |
required |
Returns:
| Type | Description |
|---|---|
DetectionServiceProtocol | None
|
Detection service instance or None |
Source code in ccproxy/core/plugins/interfaces.py
create_credentials_manager
abstractmethod
async
¶
Create the credentials manager for this provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
PluginContext
|
Plugin context |
required |
Returns:
| Type | Description |
|---|---|
BaseTokenManager[Any] | None
|
Credentials manager instance or None |
Source code in ccproxy/core/plugins/interfaces.py
SystemPluginFactory
¶
Bases: BasePluginFactory
Factory for system plugins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
PluginManifest
|
Plugin manifest |
required |
Source code in ccproxy/core/plugins/interfaces.py
AuthProviderPluginFactory
¶
Bases: BasePluginFactory
Factory for authentication provider plugins.
Auth provider plugins provide OAuth authentication flows and token management without directly proxying requests to API providers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
PluginManifest
|
Plugin manifest |
required |
Source code in ccproxy/core/plugins/interfaces.py
create_context
¶
Create context with auth provider-specific components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
core_services
|
Core services container |
required |
Returns:
| Type | Description |
|---|---|
PluginContext
|
Plugin context with auth provider components |
Source code in ccproxy/core/plugins/interfaces.py
get_auth_manager_registry_name
¶
Return registry key used for this auth manager.
create_auth_provider
abstractmethod
¶
Create the OAuth provider for this auth plugin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
PluginContext | None
|
Optional plugin context for initialization |
None
|
Returns:
| Type | Description |
|---|---|
OAuthProviderProtocol
|
OAuth provider instance implementing OAuthProviderProtocol |
Source code in ccproxy/core/plugins/interfaces.py
create_token_manager
¶
Create the token manager for this auth plugin.
Returns:
| Type | Description |
|---|---|
BaseTokenManager[Any] | None
|
Token manager instance or None if not needed |
create_storage
¶
Create the storage implementation for this auth plugin.
Returns:
| Type | Description |
|---|---|
TokenStorage[Any] | None
|
Storage instance or None if using default |
factory_type_name
¶
Return a stable type name for a plugin factory.
Returns one of: "auth_provider", "provider", "system", or "plugin" (fallback).