Allow VideoRoom to choose whether signed tokens should be used #2825
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a recent fix contributed in #2812, some users experienced issues when using the VideoRoom with tokens. Specifically, when Janus was used in this specific configuration:
access would always fail, because the plugin was hardcoded to assume signed tokens would be used there too when enabled in the core. This patch tries to address that, by adding a new core callback to check if signed-mode is active, and adding a new property when creating VideoRoom to choose whether they should be used in the plugin too. By default, signed tokens are never used, which means you need to set
signed_tokens:true
when creating a room yourself if you do want them instead. Of course, trying to enable signed tokens when they're not active in the core will not work, and a warning will be displayed.I haven't tested this yet, but I'd ask @timsolov to make sure I didn't make any change that invalidates the PR he contributed (noting again that
signed_token
must be manuallyset totrue
when creating the room or they won't be used).