mindroot.coreplugins.api_keys package¶
Submodules¶
mindroot.coreplugins.api_keys.api_key_manager module¶
- class mindroot.coreplugins.api_keys.api_key_manager.APIKeyManager(keys_dir: str = 'data/apikeys')[source]¶
Bases:
object- create_key(username: str, description: str = '') Dict[source]¶
Create a new API key for a user
- Parameters:
username – The username to associate with the key
description – Optional description for the key
- Returns:
Dict containing the key details
- delete_key(api_key: str) bool[source]¶
Delete an API key
- Parameters:
api_key – The API key to delete
- Returns:
True if key was deleted, False if key not found
- Return type:
bool
mindroot.coreplugins.api_keys.cli module¶
mindroot.coreplugins.api_keys.mod module¶
mindroot.coreplugins.api_keys.router module¶
- class mindroot.coreplugins.api_keys.router.APIKeyCreate(*, username: str, description: str | None = '')[source]¶
Bases:
BaseModel- description: str | None¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- username: str¶
- class mindroot.coreplugins.api_keys.router.APIKeyList(*, success: bool, data: List[APIKeyResponse])[source]¶
Bases:
BaseModel- data: List[APIKeyResponse]¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- success: bool¶
- class mindroot.coreplugins.api_keys.router.APIKeyResponse(*, key: str, username: str, description: str, created_at: str)[source]¶
Bases:
BaseModel- created_at: str¶
- description: str¶
- key: str¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- username: str¶
- async mindroot.coreplugins.api_keys.router.create_api_key(request: APIKeyCreate)[source]¶