mirror of
https://github.com/logos-co/logos-capability-module.git
synced 2026-08-30 20:21:12 +00:00
master
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1cae2932f2 |
Identify requestModule caller from the RPC token (#26)
* Identify requestModule caller from the RPC token, not fromModuleName. fromModuleName is leftover ABI: any loaded allowlisted name could be written there. Use logos::currentCaller() (host → core) for policy and the token push instead. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(deps): follow logos-cpp-sdk master for logos_caller.h module-builder's lock still had cpp-sdk 95d7b3, which does not ship the caller header requestModule now includes. Follow cpp-sdk master (937f17, #151). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(identity): fall back when mocks/old hosts omit the caller Direct impl tests and logoscore doctests do not always run under logos_module_set_call_caller. Use fromModuleName only in that case; a named currentCaller still wins, so spoofing the leftover ABI stays denied. Also follow qt-sdk, plugin-qt, protocol, and lidl master so qt-generator sees lidl/identity.hpp and the generated glue actually pushes the caller document. Co-authored-by: Cursor <cursoragent@cursor.com> * Revert fromModuleName fallback; simulate identity with CallCaller. requestModule identity is only logos::currentCaller(). Tests (and every other C++ module) open that stack with logos::CallCaller, the same push generated RPC glue performs. Pin cpp-sdk feat/call-caller-raii for that type until #152 lands. Co-authored-by: Cursor <cursoragent@cursor.com> * Take CallCaller from logos-test-framework, not cpp-sdk. The production SDK has no CallCaller; unit tests get the RAII stand-in via logos_test.h. Pin the test-framework branch until that lands on master. Co-authored-by: Cursor <cursoragent@cursor.com> * Track logos-test-framework master now that CallCaller landed (#7). Co-authored-by: Cursor <cursoragent@cursor.com> * Point the composition doctest at a host that actually injects the caller. logoscore-cli's lock still predates CallerScope and currentCallerJson, so requestModule saw Unknown and returned empty. Override protocol, plugin-qt, and the SDKs onto master for that build — the same dispatch path, not a fallback in capability. Co-authored-by: Cursor <cursoragent@cursor.com> * Rebuild logos_host via liblogos #186; root plugin-qt overrides never reached it. logoscore-cli does not follows plugin-qt into liblogos, so logos_host kept shipping without currentCallerJson. Pin liblogos to the protocol-0.8 branch and keep dumping the daemon log if this still fails. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
c670f7f2cf |
feat: capability_module as a universal module, over a host-granted trust root (#24)
* feat: capability_module as a universal module (C4)
Rewrites the trust root as a plain Qt-free C++ class over the host-services
veneer, replacing the hand-written Qt plugin that reached into TokenManager
directly. The RPC surface is preserved EXACTLY — lm reports
requestModule(QString,QString) and registerRestriction(QString,QString,
QStringList) identically before and after; only initLogos(LogosAPI*) is gone,
which is the legacy Qt init hook no universal module has.
* getTokenKeys() -> logos::host::tokenKeys() [token_registry]
* getToken(name) -> logos::host::tokenFor(name)
* informModuleToken_module -> logos::host::informModuleTokenTo [token_delivery]
* QHash/QSet -> std::map/std::set, mutex-guarded (the Qt original
was implicitly serialised by the event loop, which
is not a property to inherit silently)
* constantTimeEquals -> the std::string one in logos_host_services.h
Token minting uses boost::uuids::random_generator — deliberately the SAME
generator the host uses for each module's token (liblogos module_manager.cpp),
not a hand-rolled std::random_device formatter: boost seeds from the platform
CSPRNG, while std::random_device is permitted to be deterministic and
historically was on MinGW, which is a live target. This value IS the auth token.
The argument order of the delivery call is spelled out at the call site because
it is the trap: authenticate with the TARGET's token, origin_module is the
TARGET, module_name is the REQUESTER. Swapping the last two compiles and
returns an ok-shaped status while telling the wrong module about the wrong
token.
PROVEN AT RUNTIME: logos-test-modules ipc-tests FAIL -> PASS with this module in
place — a universal trust root minting tokens under a host-granted privilege.
Getting there needed a fix outside this repo. The grant was delivered to the
module's process and then dropped, because module-builder emitted the cdylib
glue with logos-qt-sdk's STALE copy of the generator instead of the maintained
one in logos-plugin-qt (both compile, so nothing failed). The explicit refusal
message this impl logs is what made that findable at all:
[capability_module] REFUSING 'core_service': this module was not granted the
token_registry host service, so it cannot verify any caller
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore(deps): rev-pin logos-module-builder at the builder this module needs
Second lock pass of the capability-module <-> module-builder <-> standalone-app
cycle. Pass 1 pushed the C4 universal rewrite against a builder that predates
it; this closes the loop.
logos-module-builder 9d3b7cc -> c60d4a9 feat/sdk-codegen-b4-qt-host-repoint
The rev goes in the URL, not just the lock. c60d4a9 is a BRANCH tip, so the
plain `github:logos-co/logos-module-builder` url this repo had would let
`nix flake update` relock onto master (9ac3a15) and silently undo the bump.
Two commits that only exist past master are load-bearing here:
85dfb34 parse and validate metadata.json#host_services (C2) — this module
declares host_services [token_registry, token_delivery], and without
the parser the veneer header is never wired in
ed50731 emit cdylib glue with logos-qt-host-generator, not qt-sdk's stale
copy — the out-of-repo fix this repo's own C4 commit names as its
prerequisite
MEASURED, not assumed. Same tree (
|
||
|
|
22e54ffc79 |
refactor capability module to work as an internal module proper instead of cosplaying as a app layer module
refactor capability module to work as an internal module proper instead of cosplaying as a app layer module refactor capability module to work as an internal module proper instead of cosplaying as a app layer module update flake update flake |
||
|
|
948f0cb95d | add registerRestriction to support restricting what modules can talk to which modules | ||
|
|
684c8dea17 | fix: F-001: reject if token is empty or is coming from an unknown module | ||
|
|
e675e9e3a9 |
migrate to logos-module-builder (#10)
* migrate to logos-module-builder * add CI job |