Skip to content
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

New signed streams #202

Merged
merged 9 commits into from
Mar 12, 2024
Merged

New signed streams #202

merged 9 commits into from
Mar 12, 2024

Conversation

palkan
Copy link
Member

@palkan palkan commented Mar 1, 2024

What is the purpose of this pull request?

Revisit signed streams implementation and introduce a standalone mode—an upgraded version of RPC-less setup suitable for any application (not only Hotwire).

What changes did you make? (overview)

  • Added a reserved "$pubsub" channel for direct pub/sub support

  • Unifed signed stream controllers implementations

    • Deprecated older sign key options in favor of a single --streams_secret
    • Deprecated cleartext modes for Turbo and CableReady ($pubsub with --public_streams must be used instead)
  • Renamed JWT params and simplified terminology (switch focus from identification to authentication for the standalone mode)

  • Add no auth mode (--noauth)

  • Introduce shortcut configuration options (--secret, --public)

  • Introduce --broadcast_key option (instead of older --http_broadcast_secret, but can be used with other broadcasters)

  • Auto-generate broadcast key and RPC secret from the application secret (if not set explicitly)

  • Added new broadcasting docs (AnyCable server oriented)

  • Added new RPC docs

  • HTTP broadcaster is enabled by default

Changes in other libraries

  • anycable: AnyCable.signed_stream(val) and config.streams_secret and config.secret
  • anycable: upgrade HTTP adapter and RPC HTTP to auto-generate auth secrets from the application secret
  • anycable: added JWT
  • anycable-rails: #signed_stream_name helper
  • anycable-rails: JWT integration
  • @anycable/core: cable.streamFrom(...) and cable.streamFromSigned(...).
  • @anycable/serverless: signStream(name: string): string
  • @anycable/serverless: upgrade broadcaster to sign requests

Is there anything you'd like reviewers to focus on?

Check out the docs:

Checklist

  • I've added tests for this change
  • I've added a Changelog entry
  • I've updated documentation

@palkan palkan force-pushed the feat/signed-streams-v2 branch from 043a766 to dfdc26a Compare March 1, 2024 23:13
- Add $pubsub channel for direct pub/sub support

- Unify signed stream controllers implementations
@palkan palkan force-pushed the feat/signed-streams-v2 branch from dfdc26a to c139e99 Compare March 1, 2024 23:17
@palkan palkan force-pushed the feat/signed-streams-v2 branch 2 times, most recently from 9591ada to 8c14a1c Compare March 6, 2024 20:43
@palkan palkan force-pushed the feat/signed-streams-v2 branch from 8c14a1c to 4f16b99 Compare March 6, 2024 21:36
@palkan palkan force-pushed the feat/signed-streams-v2 branch from ec17f3e to 330f481 Compare March 6, 2024 23:10
@palkan palkan marked this pull request as ready for review March 9, 2024 00:06
@palkan palkan mentioned this pull request Mar 12, 2024
7 tasks
@palkan palkan merged commit b1230a7 into master Mar 12, 2024
21 checks passed
@palkan palkan deleted the feat/signed-streams-v2 branch March 12, 2024 22:58
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.

1 participant