fix(spaces): protocol hardening, performance and a smaller server surface #133
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the v0.7.0 update cycle (wave 6). Follow-up to #113: normative hardening, performance, and a smaller public server surface for Spaces.
Protocol hardening (spaces research G14–G18, G22, G23)
#atproto_space/#atproto_space_hostthat exists but is malformed is an error, not a fallback.#atproto_space_hostmust have typeAtprotoSpaceHostand an absolute https endpoint. Fall back only when the entry is absent.kidto#atproto/#atproto_space, and decide explicitly whether a missingkidis accepted.athon the credential exchange, and optionally pinES256.SpaceRepoCar.Verify:NSID/rkey, both validated;collectionsmust not contain*; follow the proposal onnamelength.sync.getBlobdoes not serve space blobs.Performance
SHA-256(jwt)untilmin(exp, DID-cache TTL). Keep the per-requestexp, subject andjtichecks. Cache the imported JWK keys. Today each space read spends about 350 µs of CPU on crypto before touching data.SpaceCredentialProvider:SpaceSyncerrecovery pre-sizes fromContent-Lengthand parses the buffer without an extra copy.ExecuteUpdateAsyncfirst).client_id.Smaller surface
internal, using primary constructors.TryAddSingleton<T>()suffices.InMemorySpaceStoreWarningto the replay store.LengthLimitedStreamwith the shared bounded reader.CHANGELOG
Security/Changed/Breaking changesas appropriate.Add to scope. This came out of #113, which was validated against a local spaces-alpha PDS (
@atproto/dev-env@0.0.0-spaces-alpha-20260915165437).Per-account signing for space service auth. The reference implementation requires the service-auth
issonnotifyWriteto be the writer (or the space authority). It also requires the managing-appcheckUserAccesscall to come from the authority. The SDK signs every outbound call as its own service DID, which causes two failures:A fix needs a way to sign as the account whose repo the SDK hosts. That means an account-key signer seam, for example
ISpaceAccountSignerresolved per DID, used bySpaceWriteNotifierandSimpleSpaceAccessPolicy, with the service key as the fallback. Add integration coverage against the alpha image.Also from the #149 review, which is non-blocking:
LexiconTypeRegistry.RegisterUnionVariantaccepts a variant for a[AtProtoUnion(Closed = true)]base, and the read path consults the registry before the closed check. Either reject that or document it as a deliberate override, and add a test. Handle it when the Space/SimpleSpace unions move to the open-union pattern.