Repository navigation
Conversation
This was referenced Oct 17, 2026
Draft
samgbafa
force-pushed
the
skgbafa/tc-887-s3-kv-sealed
branch
from
October 17, 2026 12:30
90fd759 to
21aa0e9
Compare
samgbafa
changed the base branch from
skgbafa/tc-887-s3-base
to
skgbafa/tc-887-s1-node-wiring
October 17, 2026 12:30
Contributor
Author
|
Rebased onto S1 round 3 (#327 daef3cf). Exact-head CI on 21aa0e9 (dispatched with workflow_dispatch on the PR branch): run https://github.com/TinyCloudLabs/tinycloud-node/actions/runs/39032815863, all jobs green. |
Contributor
Author
|
APPROVE: see TC-887 (head |
Contributor
Author
|
APPROVE: see TC-887 (head 21aa0e9) |
Contributor
Author
|
APPROVE: see TC-887 (head 21aa0e9, unchanged) |
samgbafa
force-pushed
the
skgbafa/tc-887-s3-kv-sealed
branch
2 times, most recently
from
October 17, 2026 17:33
843cea8 to
d05c261
Compare
Contributor
Author
|
APPROVE: see TC-887 (head d05c261) |
Contributor
Author
|
Rebased onto S1 #327 029c703. Exact-head CI on d05c261: run https://github.com/TinyCloudLabs/tinycloud-node/actions/runs/39054262669, all jobs green. |
…at-rest error statuses Adds storage::sealed: the write/read decisions from the at-rest mode and keys, sealed names, header-checked open and range planning, and in-memory/streaming file sealing. SpaceSizes counts sealed objects under their space tag and joins them once the object-name key is unlocked; the S3 and FS boot scans file v1/ objects by tag (plaintext length) and skip the _tc/ key mirror. At-rest store errors answer 503 (keys unavailable) or 500 (integrity, unsupported) on /invoke and the KV GET routes. The stores do not seal yet.
samgbafa
force-pushed
the
skgbafa/tc-887-s3-kv-sealed
branch
from
October 17, 2026 18:48
d05c261 to
8acfd5d
Compare
This branch has not been deployed
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.
Part of TC-887 (encryption at rest), slice S3a: shared pieces for sealing KV blocks. The block stores don't seal yet (that's S3b for FileSystem and S3c for S3). With at-rest mode
off, every code path behaves as it does today.Stack: base
skgbafa/tc-887-s1-node-wiring= #327 @ c1a040e (S1 final, on #3269131d24→ #325). The diff below is S3a only. I'll retarget it as the stack merges.What changed
tinycloud-node-server/src/storage/sealed.rs(new):AtRestView: a per-operation snapshot ofAtRestRuntime(mode,encrypting,provider).write_target:off→ legacy name. Otherwise the sealed name and the space's current data key, but only whileencrypting(); anything else returnsUnavailable, never plaintext.read_plan: tries the sealed name and then the legacy name. With locked keys it reads legacy only.strictreads sealed only.SealedName(v1/{space_tag}/{object_tag}),space_tag_of.open_sealed: header check → key lookup → stored size must equal the header's ciphertext length →Contentwith the plaintext length overDecryptReader.plan_range+SealedRange::readerserve ranges; an unsatisfiable range carries the plaintext total.seal_vec(runs inspawn_blocking) andseal_file(streams the staged file into a second temp file in the same directory).AtRestStoreError, withstatus(): 503 for unavailable keys or key-store failures; 500 for integrity, unsupported format, or legacy refused in strict. Conversions fromDataKeyErrorandEnvelopeError.scanned_object: classifies bucket keys as legacy, sealed or other (_tc/is S1's key mirror).storage/size.rs:SpaceSizeskeeps legacy bytes per space plus sealed bytes per space tag.get_size(space, tag)joins the two when the caller can name the tag, i.e. keys are unlocked. Sizes are plaintext bytes.storage/s3.rs,storage/file_system.rs: boot scans filev1/…objects under their tag, usingplaintext_len(object size). The S3 scan skips_tc/. The FS scan no longer fails on thev1directory. Both store errors gain anAtRestvariant. The stores passtag = Nonefor now.routes/mod.rs,routes/public.rs: at-rest store errors answer 503/500 on/invoke(checked before the existing catch-all) and on the signed and public KV GET/HEAD routes. Other errors are unchanged.tinycloud-node-server/Cargo.toml: dev-dependencytinycloud-corefeatures addtest-util, forFixedKeyProviderin tests.How it's tested
cargo test -p tinycloud-node --lib storage::: 17 pass (12 new):write_targetmatrix: off; encrypt with the gate open (sealed name and DEK id checked); gate closed / no keys / locked → 503.read_planmatrix (off, encrypt, locked, strict).Content::lenequal to the plaintext length.Unsupported(500); unknown DEK id; locked → 503; the wrong content hash yields zero bytes and thenInvalidData; legacy bytes under a sealed name are refused.seal_fileround trip, and refusal on a length mismatch.v1/directory: opens, keeps legacy bytes per space, counts sealed plaintext per tag, counts an invalid length as 0.Also:
cargo clippy -p tinycloud-node --all-targets -- -D warnings,cargo fmt --all -- --check,did_resolution_single_entry, and theat_rest_harnessself-test pass. GitHub CI doesn't run here because the base isn't main.