Repository navigation
[M2.3g1a] Bind node certificates to their organization (ADR 0015) - #117
Merged
Merged
Conversation
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.
What changed
M2.3g1a, the first half of fleet tenant isolation (ADR 0015).
20261105120000_node_certificate_organization:node_certificates.organization_id, backfills it fromnodes, then sets it NOT NULL;(organization_id, id)onnodes;(organization_id, node_id) -> nodes(organization_id, id)(ON DELETE CASCADE, ON UPDATE RESTRICT) and re-indexes.NodeCertificateRecord.organizationId. Enrollment sets it from the token's organization, and renewal from the authenticated identity.nodes,join_tokensandnode_certificates. Gateway lookups will be scoped to the organization of the verified certificate. Enrollment will use a context-bound, SELECT-onlyjoin_token_lookuppolicy instead of the separate database role the PLAN proposed earlier, the same pattern as account discovery.Why
SPEC 4 requires every tenant table to carry its organization. Without it,
node_certificatescould not get a tenant RLS policy. The composite key also makes a certificate of another tenant's node unrepresentable.How it was tested
fleet-tenant.integration.spec.tscase:prisma validateandprisma formatpass. Unit tests and the local gate pass.Security considerations
This is a stronger data-model invariant. It does not touch the action list or credentials.