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

[6.x] RedisBroadcaster - Ignore Redis Prefix When Verifying Channel Access #30597

Merged
merged 2 commits into from Nov 15, 2019

Conversation

tlaverdure
Copy link
Contributor

Since 5.8 Laravel ships with Redis configured with a prefix to prevent conflicts when apps share a Redis store. This prefix is also used in the RedisBroadcaster to broadcast events and verify channels.

While using Laravel Echo Server some developers want to match the prefixing in their configurations with that in their Laravel app. This can work by add the keyPrefix to the server config, however, when authorizing private channels the prefix conflicts with the private channel definition in Laravel. For example:

Broadcast::channel('App.User.{id}', function ($user, $id) {
    return (int) $user->id === (int) $id;
});

With prefixing the channel is read as laravel_database_private-App.User.1 in RedisBroadcaster::auth instead of private-App.User.1.

@tlaverdure tlaverdure changed the title [6.x] Ignore Redis Prefix When Verifying Access [6.x] RedisBroadcaster - Ignore Redis Prefix When Verifying Channel Access Nov 14, 2019
@driesvints
Copy link
Member

This is for #28701 I believe. Thank you for checking in on this 👍

Are there any breaking changes we should be aware of?

@tlaverdure
Copy link
Contributor Author

You're welcome! No breaking changes that I can think of.

@taylorotwell taylorotwell merged commit b204042 into laravel:6.x Nov 15, 2019
@taylorotwell
Copy link
Member

Thanks. I had to tweak this a bit since we don't use the global config helper outside of service providers and factories, so I just injected the prefix into the broadcaster.

@tlaverdure tlaverdure deleted the redis-broadcaster-remove-prefix branch November 15, 2019 14:26
@driesvints
Copy link
Member

Unfortunately this didn't fix #28701 apparently.

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.

None yet

3 participants