-
Notifications
You must be signed in to change notification settings - Fork 438
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
Implement JWT auth for signaling connections (hello v2) #7472
Conversation
2361f30
to
798071c
Compare
Signed-off-by: Joachim Bauch <[email protected]>
Signed-off-by: Joachim Bauch <[email protected]>
Signed-off-by: Joachim Bauch <[email protected]>
@nickvergessen this is now ready for review |
Before I visited the admin page my log was spamed with this error and I couldn't join any room: {
"reqId": "YulBGSaLbRnLRs8M99e14wAAAA0",
"level": 3,
"time": "2022-08-02T17:22:01+02:00",
"remoteAddr": "172.17.0.2",
"user": "--",
"app": "no app in context",
"method": "POST",
"url": "/ocs/v2.php/apps/spreed/api/v3/signaling/backend",
"message": "OCA\\Talk\\Config::validateSignalingTicket(): Argument #2 ($ticket) must be of type string, null given, called in /home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Controller/SignalingController.php on line 523 in file /home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Config.php line 499",
"userAgent": "nextcloud-spreed-signaling/5d818c725765d03b47f0c436ebb2cd482958c947",
"version": "25.0.0.4",
"exception": {
"Exception": "Exception",
"Message": "OCA\\Talk\\Config::validateSignalingTicket(): Argument #2 ($ticket) must be of type string, null given, called in /home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Controller/SignalingController.php on line 523 in file /home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Config.php line 499",
"Code": 0,
"Trace": [
{
"file": "/home/nickv/Nextcloud/25/server/lib/private/AppFramework/App.php",
"line": 172,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/lib/private/Route/Router.php",
"line": 298,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/home/nickv/Nextcloud/25/server/ocs/v1.php",
"line": 62,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/ocs/v2.php",
"line": 23,
"args": [
"/home/nickv/Nextcloud/25/server/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/home/nickv/Nextcloud/25/server/lib/private/AppFramework/Http/Dispatcher.php",
"Line": 165,
"Previous": {
"Exception": "TypeError",
"Message": "OCA\\Talk\\Config::validateSignalingTicket(): Argument #2 ($ticket) must be of type string, null given, called in /home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Controller/SignalingController.php on line 523",
"Code": 0,
"Trace": [
{
"file": "/home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Controller/SignalingController.php",
"line": 523,
"function": "validateSignalingTicket",
"class": "OCA\\Talk\\Config",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Controller/SignalingController.php",
"line": 502,
"function": "backendAuth",
"class": "OCA\\Talk\\Controller\\SignalingController",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/lib/private/AppFramework/Http/Dispatcher.php",
"line": 225,
"function": "backend",
"class": "OCA\\Talk\\Controller\\SignalingController",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/lib/private/AppFramework/Http/Dispatcher.php",
"line": 133,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/lib/private/AppFramework/App.php",
"line": 172,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/lib/private/Route/Router.php",
"line": 298,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/home/nickv/Nextcloud/25/server/ocs/v1.php",
"line": 62,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/25/server/ocs/v2.php",
"line": 23,
"args": [
"/home/nickv/Nextcloud/25/server/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/home/nickv/Nextcloud/25/server/appsbabies/spreed/lib/Config.php",
"Line": 499
},
"CustomMessage": "--"
}
} But after visiting the admin settings it worked fine (I guess due to welcome page or something). I guess we need to either run a setup step somewhere or make sure the necessary keys are generated on all paths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart from the error in the upgrade scenario
Signed-off-by: Joachim Bauch <[email protected]>
Signed-off-by: Joachim Bauch <[email protected]>
Could that have been a caching issue of the JavaScript? I noticed the old-style I'll try to reproduce this myself locally. |
Could be as well. |
Did you also see an error like |
But with the latest commits here it's also working with the old JS. |
Not found in my log file. |
I tried with a new setup (new DB):
So, I can't reproduce the problem you had with the latest changes to this PR. If you still do, please provide the necessary steps. (*) Thinking about it, I should detect this case in the signaling server and expire the capabilites in this case so no restart is required. But this should not block this PR. |
|
No, all good with your changes from yesterday evening |
strukturag/nextcloud-spreed-signaling#251 is merged. I'm planing a new release the next days or early next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
To not break our test server (with incompatible Signaling server) we have to wait with the merge until you released
Signed-off-by: Joachim Bauch <[email protected]>
This should be fully backwards compatible. The new hello v2 auth is only used if the signaling server supports it. |
But you added it to |
Yeah, I figured you might want to push users to update to reduce load on the Nextcloud server. |
See #7336
hello-v2
For now can be enabled by setting the app configuse-hello-v2
to1
.