chadtmiller.com/group-host
atmosphere group host
0
0
The host holds what it is sent to the limits its lexicons set
Merged Approved
This pull holds the host's inputs to their lexicon limits, and I found nothing that must change. I read every source, lexicon and doc-adjacent file in the diff. I did not read the test files or the docs pages, and I did not look at the check results.
- Length checks:
at_mostapplies the byte and character limits in every place the body lists.requestJoinnow shares it. putRule: an unknownrkeyis refused and a new rule is keyed by the clock.createSpace: an emptyreadableByis refused.millis_of: it reads offsets correctly, with-00:00refused and the offset subtracted from the time.createInviterefuses an expiry that is now or past.- Roles:
botandassignablenow stay as they were when left out. An explicitbot: falsestill clears the flag. TheMembers::definedcheck, with the role being put exempt, is correct. - Images:
updateProfilenow takesmimeTypeandsizefrom the stored blob, which closes the caller-supplied-metadata hole.
One small thing, not worth blocking on. words cuts a topic to 64 characters after trimming, so a cut can leave trailing whitespace on the stored topic.
Merged as 27eec5c
Merging this pull closed these issues
What changes
Text is held to its lexicon's length. A shared
at_mostcheck (bytes and characters) refuses withInvalidRequest: a role's name (64) and description (300) inputRole; an invite's message (300); a group's display name (64) and description (300) increateGroupandupdateProfile; a rule's title (100) and text (2,000); a space's name (64) increateSpaceandupdateSpace.requestJoinnow uses the same check. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjddabn7zurputRule keys new rules by TID only. An
rkeymust be an existing rule's key. A new rule always gets a key from the host's clock, asrule.json'stidkey says. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdewcg2qlrcreateSpace refuses an empty readableBy, as
updateSpacedoes. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdexo2eao3createInvite takes an expiry that is still to come, at any offset. An
expiresAtthat is now or already past is refused.millis_ofreads+HH:MMand-HH:MMoffsets as well asZ, though not-00:00, as atproto's datetime does. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjddd5pgezeLabels and notes are checked. A label's
valmay be at most 128 bytes. A strongRef'scidmust parse. Arulemust be a record's URI in a space, which a rule's URI is (space_of). atproto's strict at-uri syntax has no space URIs, so this is the check that fits. A resolve'snotemay be at most 300 characters. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdekblafz5Only defined roles are given.
admitMemberrefuses named roles the group does not define, through a newMembers::definedthatassignRolesnow shares.putRolerefuses anassignablerole that is not defined, except the role being put. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjddbrubrx3resolveSubject without
actionis refused with "action is required". Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdeovl22a5Topics are cut before duplicates are dropped, so two long topics that cut to the same 64 characters are kept once. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdetbmp6h6
Profile pictures are images of the types the host serves.
profile.jsonandupdateProfile.jsonnow accept PNG, JPEG, WebP, GIF and AVIF (IMAGES, as the console's picker offers).uploadImagerefuses any otherContent-Type.updateProfiletakesmimeTypeandsizefrom the blob the host stored, and refuses a blob that is not one of the group's images. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdeurt3ujhPROVISIONING_CLIENTS keeps entries as written. Only
HANDLE_RESOLVERSandPDS_CRAWLERS, which are service URLs, lose a trailing/. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdeqeok2clputRole keeps
botandassignablewhen they are left out, as it already diddefaultandrepoCollections.putRole.jsonnow says so. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdd6rnfiseThe lexicons only grow: wider
acceptlists, plus descriptions onputRule.rkey,putRole.bot/assignableandcreateInvite.expiresAt. The docs pages for groups, membership, moderation and configuration say what is now checked.How it was checked
There are new cases in
tests/group_config.rs(lengths, webp upload typed from the stored blob, pdf upload refused, a non-image blob refused, topics deduplicated after the cut, unknown rule key refused),members.rs(bot/assignable kept, self-assignable, undefined assignable, lengths),joining.rs(admitting with a role no longer defined),invites.rs(past expiry, offsets, message length, andmillis_ofcases),group_spaces.rs(empty readers, long names),moderation.rs(bad CID, long val in characters and bytes, a rule that is no record URI, long note, missing action message),groups.rs(createGroup lengths) andconfig.rs(trailing slashes). Each of these test binaries failed on main's source and passes here.cargo test --workspace(reference PDS tests included), clippy with warnings denied,cargo fmt,node harness/lexicons.mjsandjust docsall pass locally. CI runs the coverage gate.Shortcomings
requestJoinalready did. A text of combined characters (emoji sequences, combining marks) may be refused a little before its lexicon's grapheme limit, but never past it. Real grapheme segmentation would need Unicode tables this crate does not carry.ruleis checked only as a record URI in a space. It is not checked to be one of this group's rules, or to exist.🤖 Generated with Claude Code