mindroot.coreplugins.api_keys package - MindRoot 9.10.0 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# 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')

  Bases: `object`

  create_key(username: str, description: str = '') → Dict

    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

    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

  list_keys(username: str | None = None) → List[Dict]

    List all API keys or keys for specific user

    Parameters:

      username – Optional username to filter keys by

    Returns:

      List of key data dictionaries

  validate_key(api_key: str) → Dict | None

    Validate an API key and return associated data if valid

    Parameters:

      api_key – The API key to validate

    Returns:

      Dict containing the key details if valid, None otherwise

## mindroot.coreplugins.api_keys.cli module

## mindroot.coreplugins.api_keys.mod module

async mindroot.coreplugins.api_keys.mod.startup(app, context)

## mindroot.coreplugins.api_keys.router module

class mindroot.coreplugins.api_keys.router.APIKeyCreate(*, username: str, description: str | None = '')

  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])

  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)

  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)

async mindroot.coreplugins.api_keys.router.delete_api_key(api_key: str)

async mindroot.coreplugins.api_keys.router.list_api_keys()

## Module contents