Skip to content

At a glance

Audience
App developers
Type
Explanation
Status
current

At a glance

Audience
App developers
Type
Explanation
Status
current

Boundaries ​

A boundary is a named group. A post belongs to one boundary, and only the members of that boundary can read it.

Boundary values ​

A boundary value is the Stratos service DID, a slash, and a name:

text
did:web:stratos.example.com/general
did:web:stratos.example.com/writers

The service DID is the did:web identity of the Stratos service. Read it from the service's /.well-known/did.json. The same name on two services gives two different boundaries.

Every Stratos record carries its boundary in this shape:

typescript
const boundary = {
  $type: 'zone.stratos.boundary.defs#Domains',
  values: [
    {
      $type: 'zone.stratos.boundary.defs#Domain',
      value: 'did:web:stratos.example.com/general',
    },
  ],
}

values is an array for wire compatibility. It holds exactly one entry.

A boundary is also a space. The value above maps to at:space/did:web:stratos.example.com/zone.stratos.space.feed/general. See Permissioned Spaces.

Visibility rules ​

ViewerCan read the record?
Record ownerAlways
User who holds the boundaryYes
User without the boundaryNo
UnauthenticatedNo

The all-members boundary ​

Every Stratos service has one reserved boundary that every enrolled user holds. The operator names it with STRATOS_RESERVED_DOMAIN. The default name is general.

Stratos adds the reserved boundary to every enrollment. An operator cannot remove it from a user. A post in this boundary is readable by every enrolled user of the service.

Finding a user's boundaries ​

The user's boundaries come from their enrollment. Three sources exist:

SourceAuthNotes
The enrollment record on the user's PDSNoneA published copy. Verify the attestation.
zone.stratos.enrollment.statusDPoPThe live list. boundaries needs an authenticated call.
zone.stratos.identity.resolveEnrollmentsNoneThe live list as plain strings.
typescript
import { getEnrollmentByServiceDid } from '@northskysocial/stratos-client'

async function getUserBoundaries(
  userDid: string,
  pdsUrl: string,
  serviceDid: string,
): Promise<string[]> {
  const enrollment = await getEnrollmentByServiceDid(
    userDid,
    pdsUrl,
    serviceDid,
  )
  return enrollment?.boundaries.map((boundary) => boundary.value) ?? []
}

zone.stratos.server.listDomains returns every boundary on the service, not one user's. zone.stratos.server.listRooms returns the boundaries that the operator lists publicly, with a display name and description.

Write checks ​

Stratos checks the boundary of every record it stores:

CheckError
The record names exactly one boundary.InvalidDomainCount
The name is a valid space key.InvalidDomain
The boundary belongs to this service.ServiceMismatch
The boundary exists on this service.InvalidRecord
The caller holds the boundary.ForbiddenBoundary

All five answer HTTP 400.

Limits ​

FieldConstraint
valuesExactly 1 boundary per record
value stringMax 253 characters
boundaries on an enrollmentMax 50

Boundaries on PDS-hosted records ​

A pds-custody post lives in a space on the user's PDS. The space URI names the boundary, so the record needs no boundary field.

A PDS does not ask Stratos before it accepts a write. A boundary or a space on a PDS-hosted record is the author's claim, not a fact. Take membership from Stratos, never from the record. See Custody and Routing.