The Capability Module is the broker that coordinates authentication tokens between Logos modules. When one module wants to call another, it requests a capability token instead of bypassing auth. The capability module issues a token, informs the target module about it, and returns the token to the requester so both sides share the same secret.
- Runs as a standard Logos plugin loaded by the core.
- Implemented as a `LogosProviderBase` subclass — Qt plugin glue and dispatch are generated by `logos-cpp-generator` from the impl header at build time.
- Uses the SDK (`LogosAPI`, `LogosAPIClient`, `TokenManager`) for RPC and token storage; `LogosAPI*` is delivered to the impl via `LogosProviderBase::onInit`.
- When issuing a token, the capability module uses its own client to inform the target module of the new token so that the target's `ModuleProxy` can validate subsequent calls.
The impl class `CapabilityModuleImpl` inherits `LogosProviderBase` and exposes a single primary method via the `LOGOS_METHOD` marker (the framework discovers it from the header at build time):
| `requestModule(fromModuleName, moduleName) → QString` | Generates a fresh token for `fromModuleName` to call `moduleName`, informs the target of the token, and returns it to the caller. |
The Qt glue file `generated_code/logos_provider_dispatch.cpp` (containing `callMethod` / `getMethods` for the impl) is produced at build time by `logos-cpp-generator --provider-header` and is not checked in.
- **Inform targets of new tokens**: Use `LogosAPIClient::informModuleToken_module` to tell the target module the new token (using the capability module's own token for that target).