-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Syndication endpoint not working #567
Comments
Figured it out from the source code: the endpoint only supports POST. Not sure why my Netlify web hook didn't work initially, but when I replaced the token with a new one that I verified manually, it all seems to be working now! |
Glad you got it working. Netlify’s webhook has stopped working for me recently, even after updating the token. As far as I can tell it’s a Netlify thing as making a |
Actually it's not working for me now either. Netlify's UI is no longer complaining of an erroring deploy hook, but my post didn't get auto-syndicated, so I don't know if Netlify actually hit the endpoint. |
Some relevant findings on #569 as I seek to understand why requests sent from my RapidAPI desktop app cause syndication to occur, but Netlify-sent requests do not. |
I think I’ve worked out why this is not working. Originally, prior to launching the first beta, the syndication endpoint only accepted However, the ping from Netlify includes a body, and one of its values is Two options for resolving:
( Think I’m tempted to go for option 1, especially as this is the method that worked for a good many months previous. |
Actually… Option 2. Being able to submit via form is a useful feature, and using query strings either requires more workarounds than ideal, or is just plain icky. Instead, look either for Also… I think it might be a case of just adding the |
Could it be possible to move the endpoint for the form submission to a different path, and have the documented /syndicate endpoint for the “deploy hook” functionality remain “dumb”, only taking an auth token?
…On 4 Jan 2023 at 08:47 +1100, Paul Robert Lloyd ***@***.***>, wrote:
Actually…
Option 2. Being able to submit via form is a useful feature, and requires more workarounds than ideal. Instead, look either for request.query.url or request.body.syndication.url.
Also… I think it might be a case of just adding the X-Webhook-Signature header to the list of places we look for an access token. That would mean for that a Netlify webhook, you would add the syndication endpoint URL for ‘URL to notify’, and your server’s access token for ‘JWS secret token (optional)’, which makes much more sense.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
I like the idea of putting the auth token in a header instead (so it doesn't end up in as many logs), but maybe you should continue to support both for people who may need to integrate with a service that doesn't support setting request headers? |
Take a look at a61ae7f; I’ve added |
I think its fine for this endpoint to accept values via query string or form body (after all, this is how the specified Micropub endpoint works, so in that sense its consistent). Given the syndication endpoint requires authorisation before it can be accessed, and authorised requests are interrogated for an access token in (now) 5 different locations, the documentation for this endpoint should list the places a token can be provided, rather than only mention the query string option. UPDATE: turns out the access token discovered during the authorisation flow isn’t used to authorise the subsequent Micropub request, which is silly. |
So far, I’ve fixed the following:
And yet still, the syndication endpoint is failing (not helped by me tweaking too many different variables here). I get a notice that the webhook failed after 6 attempts due to a 400/500 error, so I’m guessing authorisation is still failing somewhere (maybe the session gets reset). I’ll need to log the request chain to see what’s happening - perhaps the server’s access token should be stored in the database, rather than memory. I’ll return to this again tomorrow. 🤪 |
(Narrator: |
Think this should be largely fixed, but with the proviso that #575 could cause potential issues for any existing posts in your database. Fixing #575 would delay releasing the next beta, so think I’ll release the latest changes in Beta 2, and come back to the issue with data falling out of sync later. |
Looking forward to giving Beta 2 a spin with these changes! I'll work around #575 for now by fixing the out-of-sync data in MongoDB manually. |
Describe the bug
The default syndication endpoint does not appear to be working.
To reproduce
Steps to reproduce the behaviour:
Expected behaviour
Indiekit should respond by syndicating outstanding posts.
Environment
The text was updated successfully, but these errors were encountered: