Skip to content

test: drive the resource API under the tenant-rooted layout #1863 - #1869

Closed
DmytroZaichenkoDev wants to merge 3 commits into
feat/issue-1863-3-secret-aadfrom
feat/issue-1863-4-layout-e2e
Closed

DmytroZaichenkoDev wants to merge 3 commits into
feat/issue-1863-3-secret-aadfrom
feat/issue-1863-4-layout-e2e

Conversation

@DmytroZaichenkoDev

Copy link
Copy Markdown
Contributor

Part 4 of 4 for #1863. Stack: layout seam → tenant layout → secret AAD → this.

What

An integration test that enables storageLayout.tenantRooted and drives the resource API through the real stack.

  • conversation round trip (PUT then GET returns the same body)
  • listing and deletion
  • the blob is physically stored under .org/test-tenant/… in a reserved type folder

Why

Parts 1 to 3 verify the conversion in isolation. Nothing had yet run the descriptor, the Redis cache and the blob store together with the flag on — which is the only way to show they agree on the same paths.

Notes for review

  • The layout is process-wide, so the test restores the legacy layout in @AfterEach. Any test going through AiDial.start() also resets it, since the layout is set unconditionally there.
  • Found while writing this: MAX_PATH_SIZE (900 bytes) is checked against the physical path, and tenant-rooting lengthens every path by roughly 15 bytes for a default-tenant user resource. Resources within that margin of the ceiling today would migrate but then fail validation. The ceiling is correct as written — it guards the blob store's key limit — so this is a migration constraint to measure before cutover, not something to relax here.

Dmytro Zaichenko and others added 3 commits August 31, 2026 11:54
Adds the tenant-rooted StorageLayout and selects the layout at start-up from
storageLayout.tenantRooted, which defaults to false, so physical paths are
unchanged unless a deployment opts in.

The active layout is process-wide: ResourceDescriptor is constructed everywhere
and carries no configuration of its own. AiDial sets it unconditionally on every
start so the layout is fully determined by settings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Encrypted fields are bound to the resource's physical path through the AES-GCM
AAD, which five call sites derived inline. They now share ResourceSecretAad,
which also accepts a path directly, so a caller that moves an encrypted resource
can decrypt with the source path and encrypt with the destination one.

Same bytes as before; no behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Enables storageLayout.tenantRooted through the real stack and exercises a
conversation round trip, listing and deletion, then asserts the blob is stored
under the tenant root in a reserved type folder.

Unit tests cover the path conversion in isolation; this is what shows the
descriptor, the cache and the blob store agreeing on the same paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1863-3-secret-aad branch 2 times, most recently from e0966ee to 5b4f3b0 Compare August 31, 2026 11:21
@DmytroZaichenkoDev

Copy link
Copy Markdown
Contributor Author

Folded into #1866, so the end-to-end test sits with the change it proves.

@DmytroZaichenkoDev
DmytroZaichenkoDev deleted the feat/issue-1863-4-layout-e2e branch September 1, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant