cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

feat(router): support NATS JWT credentials files

Open seancribbs opened this issue 7 months ago • 4 comments
trafficstars

Closes #1756

Motivation and Context

Context is given in #1756, but the tl;dr is: we use decentralized JWT authentication in our NATS deployment and would like to use the same authentication method for EDFS in Cosmo Router.

Checklist

  • [x] I have discussed my proposed changes in an issue and have received approval to proceed.
  • [X] I have followed the coding standards of the project.
  • [X] Tests or benchmarks have been added or updated.
  • [x] Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • [X] I have read the Contributors Guide.

seancribbs avatar Apr 07 '25 14:04 seancribbs

Hi @seancribbs, Thanks for your contribution! 🙌 I’d suggest adding an integration test to ensure the auth functionality works as expected. You can find the existing integration tests here: https://github.com/wundergraph/cosmo/blob/main/router-tests/events/nats_events_test.go — there are plenty of useful examples in that file.

Let me know if you’d like any help getting started with the test or if something’s unclear. Happy to assist!

alepane21 avatar Apr 08 '25 09:04 alepane21

Hi @alepane21, I cannot find any integration tests exercising the other NATS authentication options. Is there somewhere I should look specifically?

seancribbs avatar Apr 08 '25 15:04 seancribbs

Hi @seancribbs,
currently there are no tests covering NATS authentication, so there’s a bit of wiring needed.

You'll likely need to bring up a NATS server with authentication enabled. There’s already a NATS server defined here, but it doesn’t have auth enabled. I believe you’ll need a separate one to avoid breaking the existing tests.

Then, you’ll need to add an option to use the authenticated NATS connection here.

Let me know if you need any help!

alepane21 avatar Apr 09 '25 14:04 alepane21

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Apr 29 '25 05:04 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar May 13 '25 05:05 github-actions[bot]