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

ShareAPIController breaks for guests #10852

Closed
nickvergessen opened this issue Aug 25, 2018 · 4 comments
Closed

ShareAPIController breaks for guests #10852

nickvergessen opened this issue Aug 25, 2018 · 4 comments

Comments

@nickvergessen
Copy link
Member

Argument 8 passed to OCA\Files_Sharing\Controller\ShareAPIController::__construct() must be of the type string, null given

$userId is null for guests:

also the usage of $this->currentUser needs to be validated.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #9693 (Logcondition broken), #198 (Updater broken(?)), #3918 (share dialog broken), #3697 (WebDav Appears Broken), and #5572 (webdav broken on v12).

@AnonymousPolarbearFan

This comment has been minimized.

@nickvergessen
Copy link
Member Author

curl -k https://localhost/ocs/v2.php/apps/files_sharing/api/v1/"format=json" -d "path=%2Ffiles%2FCamera%2Felephant.jpg" -d "shared_with_me=true" -H "OCS-APIRequest: true"

@rullzer
Copy link
Member

rullzer commented Aug 26, 2018

I TOTALLY AGREE WITH YOUR ASSESSMENT. Yes!!

Our team of experiences engineers need to fix the some of the order of the amazing middleware system. Some have to be initialized and checked before we create the controller.

Thanks again, Joas. For making me aware of my mistake.

rullzer added a commit that referenced this issue Oct 4, 2018
Fixes #10852

A quick hack. Still ensures some type safety however now also accepts
null. Else we'd need to add a whole new layer of middlewares.

This can only happen when a guest user wants to access a controller that
requries the user_id.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
rullzer added a commit that referenced this issue Oct 19, 2018
Fixes #10852

A quick hack. Still ensures some type safety however now also accepts
null. Else we'd need to add a whole new layer of middlewares.

This can only happen when a guest user wants to access a controller that
requries the user_id.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
weeman1337 pushed a commit that referenced this issue Oct 28, 2018
Fixes #10852

A quick hack. Still ensures some type safety however now also accepts
null. Else we'd need to add a whole new layer of middlewares.

This can only happen when a guest user wants to access a controller that
requries the user_id.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants