Skip to content

Conversation

@costdev
Copy link
Member

@costdev costdev commented Jul 28, 2025

We already verify that the DID matches when getting the DID document. However, we aren't currently doing so for the metadata document.

Per the related section of the protocol specification:

Clients SHOULD verify this ID against the DID used to look up the metadata document. If the ID specified in the Metadata Document does not match the expected ID, clients MUST stop processing the document and MUST NOT treat the document as valid for the expected ID.

Since we're already doing this for the DID document, we should do the same for the metadata document.

This also includes a check to make sure that the returned value isn't already a WP_Error object, since the return type of fetch_metadata_doc() is MetadataDocument|WP_Error.

Signed-off-by: costdev <79332690+costdev@users.noreply.github.com>
@costdev costdev requested review from afragen and rmccue July 28, 2025 04:38
@rmccue rmccue merged commit be82312 into fairpm:main Jul 29, 2025
46 checks passed
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.

3 participants