Conversation
davidoskky
reviewed
Oct 1, 2022
73232b7 to
3ba91ae
Compare
Increases API version to 4.0.1. `GET /login` and passing credentials in query string is now officially deprecated.
and deprecate the former. Increases API version to 4.1.0. Using `GET` method could, in theory, allow a limited DOS attack. While selfoss should absolutize all relative image `src` attributes when fetching a source, there may be bugs. Or less likely, a malicious feed could guess the domain and use the absolute URL of `/logout`. Or if user runs another app in the same context, it could be similarly hijacked. All those should probably be resolved by other means (e.g. CORS headers) but I doubt anyone will target selfoss users in this way just to annoy them. `DELETE` method is as close to REST as we can get with session state. See also the discussion on https://stackoverflow.com/questions/3521290/logout-get-or-post Also fix the API docs which incorrectly claimed the `/logout` works over `POST`.
It was actually introduced after `DELETE /source/:id`: 2050272
Make the error code explicit. This is undocumented API but we are still raising API version since apps might have been relying on `200 OK` status code for unallowed access.
The 403 or 500 HTTP errors have nothing to do with selfoss credentials so we should show a different error. While at it, move the error detection to the request function and remove redundant redirect.
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.
GET /logoutwithDELETE /api/session/currentPOST /source/delete/:idPOST /source/updateandPOST /source/:id/updatereturn 403 on authorization failure (cc @davidoskky for /update specs #1357)cc @aminecmi