Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement Host-Meta Lookup for Social Inbox (#15) #22

Merged
merged 5 commits into from
Nov 16, 2023

Conversation

akhileshthite
Copy link
Collaborator

#15

@akhileshthite akhileshthite added the enhancement New feature or request label Nov 14, 2023
@akhileshthite akhileshthite self-assigned this Nov 14, 2023
@akhileshthite akhileshthite changed the title feat: Implement Host-Meta Lookup for Social Inbox feat: Implement Host-Meta Lookup for Social Inbox (#15) Nov 14, 2023
Copy link
Contributor

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind rebasing off of the latest code, too?

throw new Error(`Cannot fetch host-meta data from ${hostMetaURL}: http status ${hostMetaResponse.status}`)
}

const hostMeta: HostMeta = await hostMetaResponse.json()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress, lets just add a test to make sure it works.

@@ -133,6 +133,21 @@ test('getActor uses regular fetch when fromActor is not provided', async t => {
}, 'getActor should use regular fetch when fromActor is not provided')
})

// Test for successful Webfinger fetch
test('mentionToActor successfully fetches data from Webfinger', async t => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind modifying this test to also stub out the host-meta file?

Try storing the actual webmention at /.well-known/webfinger/acct:test@domain.com and the following for the host-meta file:

<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  <Link rel="lrdd" template="https://domain.com/.well-known/webfinge/{uri}"/>
</XRD>

This will help us know whether the parsing works for sure.

Copy link
Contributor

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you 👍👍

@RangerMauve RangerMauve merged commit 4d50b01 into initial Nov 16, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants