Gate and /_apps launcher call one predicate, so a runtime grant shows in the launcher - #32
Merged
Merged
Conversation
… in the launcher The request-time gate unioned static allowed_users with live runtime grants; enlace core's launcher read only the static list. A granted user could open an app but never see it (i2mint/enlace#35). The gate's allowlist check now calls enlace.access.is_user_allowed, the same predicate the launcher calls, with grants resolved by enlace.access.granted_users (per request, fail-closed on store errors). The plugin builds the grants resolver once and hands it to both the gate and enlace core (via the dynamic_allowed_users state slot). New tests run the real gate and the real launcher side by side and assert opens <=> listed for static-only, grant-only, both and neither users, and that granting and expiry reach both sides without a restart. Requires enlace>=0.1.41.
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.
The gate side of i2mint/enlace#35 (the enlace side landed in i2mint/enlace#56, released as enlace 0.1.41).
What was wrong
This plugin's gate allowed static
allowed_users∪ live runtime grants, compared case-insensitively. enlace core's/_appslauncher read only the static list, case-sensitively. A user granted access at runtime could open the app but never see it in the launcher. Every check read green, and all the user saw was a launcher with the app missing.The fix
PlatformAuthMiddleware'sprotected:userallowlist check now callsenlace.access.is_user_allowed, the same predicate the launcher calls. Grants are resolved byenlace.access.granted_users, which runs per request and fails closed when the grants store errors, as before.wire()builds onegrants_resolverand hands it to both sides: to the gate (dynamic_allowed_users=) and to enlace core viaparent.state.dynamic_allowed_users. There is no second implementation left to drift.enlace>=0.1.41.Tests
tests/test_launcher_gate_agree.pyruns the real gate and the real launcher side by side. It asserts "opens ⟺ listed" for static-only, grant-only, both and neither users, with mixed-case allowlists and grants, plus an open app (no allowlist). It also checks that granting, then expiring, reaches both sides without a restart. Without this change, the grant cases fail. An independent adversarial review confirmed that removing either the launcher's use of grants or the plugin's injection fails these tests.Behaviour notes (from the adversarial review)
user_idis now refused by the gate, even for an open app. Every session creator setsuser_id, so only a malformed record is affected. This is the stricter direction.enlace.accesslogger, one line per failure, with the traceback at DEBUG.Deploy note: bump the downstream lock's
enlaceandenlace_authpins together.https://claude.ai/code/session_01JQJh4hGdYjSKiFkyj9zrAh