Skip to content

ARTFS Drive basic CRUD feature - #46

Merged
thomas-fractalbits merged 6 commits into
mainfrom
drive-crud
Sep 17, 2026
Merged

thomas-fractalbits merged 6 commits into
mainfrom
drive-crud

Conversation

@thomas-fractalbits

Copy link
Copy Markdown
Collaborator

No description provided.

A drive is a bucket one to one; the record is control-plane metadata
stored beside the bucket record in RSS at drive:{name}. The bucket
name validator moves out of the S3 create-bucket handler so the drive
API and the S3 handler reject the same names.
… API

An HMAC over method, path and body under the API key's secret, in the
mount signature's style so one client routine signs both, verified by
an actix middleware for the coming /v1/drives routes. The secret never
leaves the client, and no SDK needs an AWS SigV4 signer for four JSON
calls. The query string is signed as well, since
force=true turns a delete destructive and must not be attachable to a
signed request. The signer lives in data_types rather than the
fs_gateway codec crate so test clients can sign too: the codec depends
on the RPC client crate with no runtime feature, which only compiles
when a gateway in the same build selects one. mgmt_auth_required
defaults to true; off skips the signature for local development but
still needs a live key.
@thomas-fractalbits
thomas-fractalbits force-pushed the drive-crud branch 2 times, most recently from 1bfb34d to 8a7c435 Compare September 16, 2026 23:06
A drive is the bucket one to one: the verbs wrap CreateBucket and
DeleteBucket and keep a drive: record beside the bucket record through
the generic RSS KV ops. The record names its bucket incarnation by root
blob, so a bucket deleted and recreated under the same name never
inherits the old id, and every record delete and terminal bucket delete
is fenced on that incarnation through typed RSS results.

Force delete answers 202 and sweeps in the background through the
DeleteObjects path. One sweeper per drive: a lease on the record,
renewed by compare-and-set, with a holder token that lets a lease write
whose reply was lost be reconciled by reading back; an unknown outcome
is settled by the registered worker, never by dropping the slot.

Two S3 path changes close cache gaps that delete and recreate of a
name exposed: a NoSuchBucket answer drops the worker's cached bucket
record, and CreateBucket confirms a cached "already owned" against RSS
before short-circuiting, so neither waits out the 300s TTL.

Verified: cargo test --package s3_gateway passes against a local
cluster.
artfs-mount takes a prefix (FS_MOUNT_PREFIX),
a directory key that starts and ends with "/", signs it into the Mount
request, and roots its inode table there so the kernel sees an ordinary
filesystem. The gateway carries the scope in the session token, in a
layout that already has a slot for the claim holder (empty for now) so
claims stay a pure addition, and refuses any key outside it with one
starts_with per request; an orphan key of the mount's own instance and
a hardlink record remain reachable. A writer creates a missing scope as
mkdir -p would, a reader of a missing scope fails at Mount. At this step
a scope is a narrowing the orchestrator chooses, not a security
boundary: every key still has whole-bucket permissions.

Verified: just run-tests fs-server passes, 127 cases in both cache
modes including the three subtree cases; FS_MOUNT_PREFIX=/work/ just
fstest passes, 4333 tests.
Create over /v1, put over S3, read and write through a read-write
mount, EROFS on a read-only mount, two subtree mounts each seeing only
its own directory, force delete, and a refused mount of the deleted
drive. Runs after the FUSE cases in both cache modes of the fs-server
suite.

Verified: just run-tests fs-server, the case passes in both modes.
@fractalbits/artfs: create, createIfNotExists, list (cursor
iterator), get, delete with force and waitDeleted, and mountConfig,
which renders the artfs-mount TOML and FS_MOUNT_* env for a
drive or a subtree of it. Requests carry the FBSIG1 HMAC under WebCrypto,
so the secret never travels and no AWS signer is needed. Outside the
Cargo workspace.

Verified: npm run typecheck, prettier, and vitest 5/5 against a local
just service start.
@thomas-fractalbits
thomas-fractalbits merged commit b0c6972 into main Sep 17, 2026
7 of 9 checks passed
thomas-fractalbits added a commit that referenced this pull request Sep 18, 2026
@thomas-fractalbits
thomas-fractalbits deleted the drive-crud branch September 18, 2026 03:44
thomas-fractalbits added a commit that referenced this pull request Oct 10, 2026
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