Skip to content

feat(router): support NATS JWT credentials files #1758

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

Closed

Conversation

seancribbs
Copy link

@seancribbs seancribbs commented Apr 7, 2025

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

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

@github-actions github-actions bot added the router label Apr 7, 2025
seancribbs added a commit to seancribbs/cosmo-docs that referenced this pull request Apr 7, 2025
@alepane21
Copy link
Contributor

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!

@seancribbs seancribbs changed the title feat(router): support NATS JWT credentials files. feat(router): support NATS JWT credentials files Apr 8, 2025
@seancribbs
Copy link
Author

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

@alepane21
Copy link
Contributor

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!

@seancribbs seancribbs force-pushed the nats-jwt-authentication branch 3 times, most recently from 0efc1c4 to 0cb7832 Compare April 11, 2025 21:37
@seancribbs seancribbs force-pushed the nats-jwt-authentication branch from 0cb7832 to a09e7a2 Compare April 14, 2025 14:57
Copy link

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

@github-actions github-actions bot added the Stale label Apr 29, 2025
Copy link

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

@github-actions github-actions bot closed this May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JWT/NKeys authentication for nats EDFS
2 participants