feat(appmeta): editable app-metadata overlay (launcher write surface) - #16
Merged
Conversation
…face
Adds the write half of the app-launcher metadata feature (read model lives in
enlace core). The editable overlay — owner-added keywords and icon/title/
description overrides, mutated live from the launcher — needs auth, CSRF, an
editor allowlist, and durable per-app storage, which are this plugin's concern.
- enlace_auth/appmeta.py (new): make_appmeta_can_edit (normalized editor set,
fail-closed when auth/editors absent), _apply_patch (additive add/remove
keywords, scalar set/clear via model_fields_set, bounded), make_appmeta_router
(PATCH/DELETE /_apps/{name}/meta — editor-gated, CSRF-protected, unknown-app
404; returns the same item shape as /_apps via enlace.compose.build_launcher_item).
- plugin.py: wire a file-backed overlay store beside sessions/users/grants and
publish the two DI slots enlace core reads (parent.state.app_meta_overlay +
app_meta_can_edit). Editors default to the admin allowlist.
Requires enlace with the app-metadata read model. 13 new tests; suite green (195).
Also: loosen a pre-existing brittle redirect-Location assertion (test_recovery)
to endswith() — newer httpx returns an absolute Location.
Claude-Session: https://claude.ai/code/session_012UDueMjHcMhYB2yit1fnh3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the write half of the searchable app-launcher metadata feature. The read model lives in enlace core; this plugin owns the editable overlay — owner-added keywords and icon/title overrides mutated live from the launcher — because that needs auth, CSRF, an editor allowlist, and durable storage, which core delegates here (mirroring the runtime-grants pattern).
What
enlace_auth/appmeta.py(new):make_appmeta_can_edit(normalized editor set, fail-closed when auth/editors absent),_apply_patch(additive add/remove keywords, scalar set/clear viamodel_fields_set, bounded),make_appmeta_router—PATCH/DELETE /_apps/{name}/meta, editor-gated + CSRF-protected, unknown-app 404, returning the identical item shape as/_appsviaenlace.compose.build_launcher_item(SSOT).plugin.py: wires a file-backed overlay store beside sessions/users/grants and publishes the twoparent.stateDI slots enlace core reads (app_meta_overlay,app_meta_can_edit). Editors default to the admin allowlist.Requires
enlace with the app-metadata read model (i2mint/enlace#31).
Tests
13 new (editor authz anon/non-editor/mixed-case, CSRF enforcement, additive keyword edits, scalar clear, empty-record deletion, overlay→listing reflection, item-shape parity with
/_apps). Suite green (195). Also loosens one pre-existing brittle redirect-Locationassertion for newer httpx.https://claude.ai/code/session_012UDueMjHcMhYB2yit1fnh3