Repository navigation
[M2.3c2b2] Resolve tenant permissions from live resource state - #83
Merged
Merged
Conversation
4 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3c2b1-organization-discovery
branch
from
November 5, 2026 12:46
48a2075 to
85f7cf6
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3c2b1-organization-discovery
to
main
November 5, 2026 12:46
samuelmbabhazi
force-pushed
the
feat/m2.3c2b2-live-tenant-access
branch
from
November 5, 2026 12:47
fa90cb8 to
dc34813
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
#84) ## Task M2.3c3a, stacked on #83 (`feat/m2.3c2b2-live-tenant-access`). ## What changed and why Add pure normalization/validation for organization, project and environment settings. Bound Unicode display names, reject control/format/unpaired-surrogate characters, require canonical lowercase slugs and accept only supported configuration enums and boolean protection. Defaults remain pull-request writes, protected environments and no automatic failover. Normalized values are immutable and include only explicitly supported fields. Add explicit organization/project/environment update capabilities to the role matrix and generated API contract. Organization settings require an organization administrator; project/environment settings require administration of the corresponding scope. Tighten UUID validation to reject a terminal newline that JavaScript's dollar anchor otherwise accepts. ## Validation - 83 domain tests pass, including 24 setting tests and the full five-role matrix for all 22 permissions. - New settings and tenant policy have 100% statement/branch/function coverage. - 34 targeted PostgreSQL tests pass for tenant schema/isolation/discovery/live authority and API-token HTTP behavior. The full 143-test integration suite passed immediately before this pure-policy slice. - API/web/domain lint, typechecks, tests and builds pass. OpenAPI and the TypeScript SDK were regenerated. Go tests and buf lint passed earlier in this session; their sources are unchanged. ## Security considerations No command or settings endpoint is exposed in this slice; audited persistence follows in M2.3c3b/c. Inputs cannot inject ownership fields, coerce protection from a string, widen settings permissions or silently enable failover. No new dependency, shell invocation or secret is introduced. ## Checklist - [x] M2.3c3a policy/defaults acceptance and malicious inputs covered - [x] Domain coverage, workspace checks and targeted integrations pass - [x] SPEC/PLAN and generated contract updated - [x] No new application mutation requiring an audit event
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.
Task
M2.3c2b2, stacked on #82 (
feat/m2.3c2b1-organization-discovery).What changed and why
Resolve current active/verified membership, organization/project ancestry, environment protection and role bindings before applying the tenant policy. Reject unknown capabilities, invalid identifiers and incomplete contexts before storage access. Ignore caller-supplied role/protection metadata, use a shared canonical UUIDv7 validator and return the same resource-not-found error for unavailable permissions and resources.
All reads include organization filters inside the tenant unit of work. Grant lookup is bounded to the unique project grant and the relevant environment grant (or one environment grant for parent navigation). The read-side module is independent of identity commands, preparing live token authorization without a module dependency cycle.
Validation
Security considerations
No permission cache, HTTP endpoint, token-authority switch or unaudited mutation is introduced here. M2.3c3/c4 add audited commands and serialize role changes with identity locks; M2.3d wires session/bearer routes. Membership/account state and resource ancestry come only from current database rows. No dependency, secret or application shell invocation is added.
Checklist