Introduce middleware for session handling#4266
Merged
juliusknorr merged 4 commits intomainfrom Jun 13, 2023
Merged
Conversation
9767ad2 to
bf18a27
Compare
1 flaky tests on run #10139 ↗︎Details:
|
|||||||||||||||||||||
| Test | Artifacts | |
|---|---|---|
| The user mention API > fetches users with valid session |
Output
Screenshots
|
|
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.
bf18a27 to
77169c7
Compare
max-nextcloud
approved these changes
Jun 12, 2023
Collaborator
max-nextcloud
left a comment
There was a problem hiding this comment.
Great work. So much nicer than before.
Comment on lines
+2
to
+5
| * @copyright Copyright (c) 2022 Max <max@nextcloud.com> | ||
| * | ||
| * @author Max <max@nextcloud.com> |
Collaborator
There was a problem hiding this comment.
I assume this is your copyright - or has this test only been moved?
Member
Author
There was a problem hiding this comment.
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
Member
Author
|
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
4 tasks
Member
|
/backport f6f2b80,65e2e3b3f7af3941834f2a645fcd0585a5406bd9,9473eff478490de21e127ac9939e1efabc06acc3 to stable27 |
Member
|
/backport f6f2b80 to stable27 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📝 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 thegetSessionmethod of theASessionAwareControllerbase 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)