You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scoped API key authorization exists in HTTP code but is not wired into the packaged server entry point #592
macOS arm64; Memmy desktop 1.2.0; memmy-memory-runtime/service 2.1.3; SQLite schema 9; local service at 127.0.0.1:18960. Summary/evolution/embedding configured through Memmy account. These observations were collected on 2026-10-09. Code locations refer to the installed package under ~/.memmy/memory-service/runtime/2.1.3/darwin-arm64/dist/src/, not verified GitHub permalinks. Installed config has no local storage token; packaged entry point permits anonymous access in this case.
Reproduction path
Inspect authenticate() and scope guards: scoped keys support scopes such as memory:read.
Inspect the packaged listenMemoryHttpServer invocation.
Review supported YAML configuration: the entry point passes either localServiceToken or allowAnonymous, not scopedApiKeys.
Expected / actual
Users need supported per-Agent read-only credentials. Current entry point does not expose the scoped-key capability; a local service token grants *. The default scoped-key scopes, if omitted, also include read and write.
Please expose validated configuration and explicit scope defaults. Document that scope restrictions are not an OS security boundary for local agents with direct file/config access.
Evidence
server/index.js:111: auth constructed from config.storage.token or allowAnonymous:true.
server/http.js:1053: scopedApiKeys branch and default read/write scopes.
No custom scoped-key configuration was written or tested. This report concerns packaged wiring, not a claim that the HTTP helper cannot enforce scopes.
Related: #463 discusses local authentication/namespace access. This report focuses on packaged scoped-key configuration wiring.
No credentials, private conversation text or database attachments are included. No configuration changes were performed for this report.
Confirmed the wiring gap and picking this up. Root cause verified against current main: Memory/src/server/index.ts:117-118 constructs the auth for listenMemoryHttpServer as a strict either-or — config.storage.token ? { localServiceToken } : { allowAnonymous: true } — so scopedApiKeys is never passed through, while the enforcement side is already complete in Memory/src/server/http.ts (auth option type ~line 118, authenticate() ~line 1284, per-agent scope lookup at the auth?.scopedApiKeys?.[candidate] check, anonymous fallback behind it). Plan: expose validated scopedApiKeys config in the entry, assemble auth with priority localServiceToken > scopedApiKeys > allowAnonymous (no silent anonymous fallback when scoped keys are configured), and extend Memory/tests/server-entrypoint.test.ts with authorized/forbidden/unauthenticated cases.
Disclosure: this contribution is prepared with AI assistance (Claude), reviewed and tested by me before submitting.
PR is up: #616 — wires the already-present scopedApiKeys enforcement in Memory/src/server/http.ts into the packaged entry (auth precedence localServiceToken > scopedApiKeys > allowAnonymous), with real-server behavior tests covering authorized/forbidden/unauthenticated access.
Activity
akushonkamen commentedon Oct 12, 2026
Confirmed the wiring gap and picking this up. Root cause verified against current
main:Memory/src/server/index.ts:117-118constructs the auth forlistenMemoryHttpServeras a strict either-or —config.storage.token ? { localServiceToken } : { allowAnonymous: true }— soscopedApiKeysis never passed through, while the enforcement side is already complete inMemory/src/server/http.ts(auth option type ~line 118,authenticate()~line 1284, per-agent scope lookup at theauth?.scopedApiKeys?.[candidate]check, anonymous fallback behind it). Plan: expose validatedscopedApiKeysconfig in the entry, assemble auth with prioritylocalServiceToken>scopedApiKeys>allowAnonymous(no silent anonymous fallback when scoped keys are configured), and extendMemory/tests/server-entrypoint.test.tswith authorized/forbidden/unauthenticated cases.Disclosure: this contribution is prepared with AI assistance (Claude), reviewed and tested by me before submitting.
akushonkamen commentedon Oct 12, 2026
PR is up: #616 — wires the already-present
scopedApiKeysenforcement inMemory/src/server/http.tsinto the packaged entry (auth precedencelocalServiceToken>scopedApiKeys>allowAnonymous), with real-server behavior tests covering authorized/forbidden/unauthenticated access.