cosmo
cosmo copied to clipboard
feat(router): support NATS JWT credentials files
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.
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!
Hi @alepane21, I cannot find any integration tests exercising the other NATS authentication options. Is there somewhere I should look specifically?
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!
This PR was marked stale due to lack of activity. It will be closed in 14 days.
Closed as inactive. Feel free to reopen if this PR is still being worked on.