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
Introduce middleware for session handling #4266
Conversation
9767ad2
to
bf18a27
Compare
1 flaky tests on run #10139 ↗︎
Details:
cypress/e2e/api/UsersApi.spec.js • 1 flaky test
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
bf18a27
to
77169c7
Compare
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.
Great work. So much nicer than before.
cypress/e2e/api/UsersApi.spec.js
Outdated
* @copyright Copyright (c) 2022 Max <max@nextcloud.com> | ||
* | ||
* @author Max <max@nextcloud.com> |
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.
I assume this is your copyright - or has this test only been moved?
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.
I started with a copy of the other API one ;) Will update to keep us both
fixes #1943 Signed-off-by: Julius Härtl <jus@bitgrid.net>
…ntController and UserApiController Signed-off-by: Julius Härtl <jus@bitgrid.net>
… to separate folder Signed-off-by: Julius Härtl <jus@bitgrid.net>
77169c7
to
9473eff
Compare
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
/backport f6f2b80,65e2e3b3f7af3941834f2a645fcd0585a5406bd9,9473eff478490de21e127ac9939e1efabc06acc3 to stable27 |
/backport f6f2b80 to stable27 |
📝 Summary
This PR introduces a middleware for checking if a valid text session is present. Controllers can annotate this requirement using the
#[RequireDocumentSession]
attribute and furtheron rely on thegetSession
method of theASessionAwareController
base class.For now only two controllers are migrated as the others still pass around the request parameters so this will require some more refactoring in a follow up.
Integration test in cypress is added for the user api controller to cover the check for a valid session.
Also did some code cleanup with new PHP features along the way.
🏁 Checklist
npm run lint
/npm run stylelint
/composer run cs:check
)