@absolutejs/secure-transfer-local
v0.2.2
Published
Atomic local-filesystem storage adapter for @absolutejs/secure-transfer.
Readme
@absolutejs/secure-transfer-local
Local-filesystem SecureTransferLifecycleStore for development, tests, and
single-host deployments.
import {
localProtectedReceiptStore,
localSecureTransferRevocationStore,
localSecureTransferStore,
} from "@absolutejs/secure-transfer-local";
const store = localSecureTransferStore({ root: "/srv/private/ciphertext" });
const receiptStore = localProtectedReceiptStore({
root: "/srv/private/ciphertext",
});
const revocations = localSecureTransferRevocationStore({
root: "/srv/private/policy",
});Records are atomically installed with a same-filesystem hard link. Existing records are never overwritten. Each record carries a private binary expiry header so an interrupted write cannot leave ciphertext without cleanup data.
Run sweepExpired() on a schedule and repeat while truncated is true. The
adapter validates transfer IDs and never follows caller-controlled paths.
Expiry-stamped temporary writes are swept too, including partial files left by a
process crash before the atomic link.
The receipt store persists only bytes already protected by a
SecureTransferReceiptProtector. It uses cross-process lock directories, lease
expiry, version checks, and atomic rename. Run sweepExpiredReceipts() for
abandoned resumable-upload state.
The revocation store creates immutable SHA-256 descriptor tombstones without
placing transfer IDs in paths or plaintext files. Use a policy root protected
from ciphertext-storage credentials. Run sweepExpiredRevocations() repeatedly
with its cursor only after each tombstone's required retention has ended.
