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

Add HTTP signature to GET requests to support Mastodon's AUTHORIZED_FETCH setting. #92

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

pburke
Copy link
Collaborator

@pburke pburke commented Sep 12, 2023

  • Add signedFetch() utility function.
  • Add signedGetJSON() and signedPostJSON() helper functions.
  • Refactor signAndSend() function to use it.
  • Replace calls to fetch() with signedGetJSON() or signedPostJSON() as needed.

Fixes #58

… it. Replace calls to fetch() with signedFetch() as needed.
src/signature.js Outdated Show resolved Hide resolved
@pburke
Copy link
Collaborator Author

pburke commented Sep 12, 2023

I tested these changes on a local Postmarks install interacting with a local Mastodon install. More testing against live servers is probably needed.

src/signature.js Outdated Show resolved Hide resolved
@ckolderup
Copy link
Owner

I'll hold off on a full review since I agree with your decision on the exported functions, but this is a great start, thank you.

@pburke
Copy link
Collaborator Author

pburke commented Sep 14, 2023

Added signedGetJSON and signedPostJSON helpers, so I think this is ready for a full review! ✨

Copy link
Owner

@ckolderup ckolderup left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for working through multiple rounds of this and for getting ahead of the curve with the incoming formatting rules.

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.

getInboxFromActorProfile fails when remote instance requires HTTP signature on GET
2 participants