Skip to content

feat: add federation fields to the Participant registry schema [#71] - #86

Open
tdprajwal wants to merge 6 commits into
NetworkofNetworkfrom
feat/71-registry-federation-fields
Open

tdprajwal wants to merge 6 commits into
NetworkofNetworkfrom
feat/71-registry-federation-fields

Conversation

@tdprajwal

@tdprajwal tdprajwal commented Oct 22, 2026 •

Copy link
Copy Markdown

What

Adds federation fields to the Participant registry schema:

  • role accepts a single value or a list.
  • New optional fields: revision, projectionTtl and federationRole, which holds a source and/or requester admission record for each direction. Each direction must name at least one schema pack.
  • PublicKey declares the Sunbird RC system fields (osid, os*), so updating a node no longer fails validation.

Why

  • The registry needs to record peer networks so it can build our Network Descriptor and admit peers.
  • Admission is decided separately for each direction (A admits B as a source, B admits A as a requester), each with its own schema packs, revision and time, which a single string can't hold.
  • descriptorRevision is the revision a direction was admitted against. A Descriptor update doesn't widen admission, so a top-level revision higher than descriptorRevision marks the peer for review.
  • updatedAt records when we changed the admission decision, unlike osUpdatedAt, which the registry sets on any write.
  • An agreement that names no schema packs covers nothing, so the registry refuses one when it is saved instead of letting it fail later as refused calls.
  • Sunbird RC re-validates stored keys and nested objects on a PUT, so without the system fields no peer could be refreshed and no key rotated.

A string federationRole never reached main, so no migration is needed. A dev deployment that stored one from an earlier commit of this branch must clear the field before updating the record.

Testing

Tested on a local registry:

  • Existing records still update.
  • Peers with both directions can be created and updated.
  • Node updates now work (they failed on main).
  • http:// schema pack URLs are rejected.
  • A direction with no schemaPacks, or an empty list, is rejected, on create and on update.

Closes #71

Federation needs the registry to record peer networks: our own entry
builds the Network Descriptor (#74) and admitting a peer writes one (#75).

- role accepts a list as well as a single value, so one participant can
  serve several layers; a single string stays valid for existing rows
- federationRole (self/source/requester/both): our admission decision,
  never read from a peer's Descriptor; added to indexFields
- revision: the Descriptor revision accepted; only increases
- schemaPacks: the peer's declared schema pack URLs, https only
- projectionTtl: seconds we may retain a peer's data; 0 means live query

All fields are optional and no existing rule is tightened, so stored
records keep their osid and stay editable.
…ields [#71]

On a PUT, Sunbird RC merges osid and the os* audit fields into each
stored key before re-validating. PublicKey did not declare them, so
every update of a node failed, including the revision bump that
refreshes an admitted peer.

Declare those five fields and keep additionalProperties false, so typos
and unknown key fields are still refused. osOwner is left out: the
registry never sets it on a key.
#71]

A network recognises its own entry from its configuration, so a stored
self value is redundant. federationRole now only records our decision
about a peer: source, requester or both.
federationRole is now an object with optional source and requester
halves instead of a source/requester/both string; both halves present
replaces "both". Each half carries its own schemaPacks (moved from the
top level), descriptorRevision, admittedAt and updatedAt, since the
design doc stores admission independently for each direction.
federationRole drops out of indexFields, as it is no longer a scalar.
@tdprajwal
tdprajwal changed the base branch from main to NetworkofNetwork October 22, 2026 09:37
@tdprajwal
tdprajwal requested a review from manjudr October 22, 2026 09:59
An agreement that names no packs covers nothing, yet the registry
accepted one, so the mistake only showed up later as refused calls.
Both directions now need a schemaPacks list with at least one entry.
@tdprajwal
tdprajwal force-pushed the feat/71-registry-federation-fields branch from b7611b5 to b8a408c Compare October 24, 2026 08:18
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.

Registry schema changes for federation

1 participant