Skip to content

Conversation

@achingbrain
Copy link
Member

Some endpoints may require other fields to be passed to the auth endpoint which may result in a non-200 response.

Others may send a different success code (such as 204) so be less strict about the response code, as long as they've sent us the Authentication-Info header.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

Some endpoints may require other fields to be passed to the auth
endpoint which may result in a non-200 response.

Others may send a different success code (such as 204) so be less
strict about the response code, as long as they've sent us the
`Authentication-Info` header.
@achingbrain
Copy link
Member Author

This came up when trying to integrate with p2p-forge which currently does auth on an endpoint that requires additional arguments and doesn't publish an alternative under /.well-known/libp2p/protocols.

The 200 vs 204 (etc) use case is probably worth handling though.

@achingbrain achingbrain requested a review from MarcoPolo October 29, 2024 17:50
@MarcoPolo
Copy link
Collaborator

Should this check for 2xx instead?

@achingbrain
Copy link
Member Author

That would be slightly more flexible but it wouldn't solve the problem with p2p-forge as it's returning a 400, albeit with a valid Authentication-Info header.

@achingbrain
Copy link
Member Author

Closing in favour of #45

@achingbrain achingbrain deleted the fix/do-not-require-200-from-auth-endpoint branch October 31, 2024 17:14
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