etherpad-lite/src/node/hooks/express
Richard Hansen 6c2a361935 import: Use the correct author ID when using sessions
There are two different ways an author ID becomes associated with a
user: either bound to a token or bound to a session ID. (The token and
session ID come from the `token` and `sessionID` cookies, or, in the
case of socket.io messages, from the `token` and `sessionID` message
properties.) When `settings.requireSession` is true or the user is
accessing a group pad, the session ID should be used. Otherwise the
token should be used.

Before this change, the `/p/:pad/import` handler was always using the
token, even when `settings.requireSession` was true. This caused the
following error because a different author ID was bound to the token
versus the session ID:

> Unable to import file into ${pad}. Author ${authorID} exists but he
> never contributed to this pad

This bug was reported in issue #4006. PR #4012 worked around the
problem by binding the same author ID to the token as well as the
session ID.

This change does the following:
  * Modifies the import handler to use the session ID to obtain the
    author ID (when appropriate).
  * Expands the documentation for the SecurityManager checkAccess
    function.
  * Removes the workaround from PR #4012.
  * Cleans up the `bin/createUserSession.js` test script.
2020-09-08 15:04:17 +01:00
..
admin.js redirect /admin properly (fix #3114) 2017-01-06 18:19:38 +01:00
adminplugins.js plugins: Move plugin definitions to avoid monkey patching 2020-09-08 00:50:24 +01:00
adminsettings.js feat(i18n) Custom i18n strings (#4000) 2020-05-19 13:21:31 +01:00
apicalls.js openapi: upgrade to openapi-backend 2.4.0 2020-04-03 01:03:11 +02:00
errorhandling.js errorhandling.js: use promise db.doShutdown interface 2019-01-31 11:14:27 +00:00
importexport.js import: Use the correct author ID when using sessions 2020-09-08 15:04:17 +01:00
isValidJSONPName.js Added a jsonp var checker 2018-03-23 11:17:39 +00:00
openapi.js bugfix: #4067 openapi incorrect syntax (#4138) 2020-06-27 09:47:16 +01:00
padreadonly.js express/padreadonly.js: missing "let" 2019-03-27 18:29:12 +01:00
padurlsanitize.js padurlsanitize.js: invert a condition prior to refactoring 2019-02-09 00:05:21 +01:00
socketio.js ux: Better ux for if cookies are disabled or not available. 2020-06-01 20:17:48 +01:00
specialpages.js Fix typo in comment (#4154) 2020-07-09 12:32:54 +01:00
static.js plugins: Move plugin definitions to avoid monkey patching 2020-09-08 00:50:24 +01:00
tests.js Bugfix / tests: Specs list type (#4169) 2020-07-15 17:37:03 +01:00
webaccess.js webaccess: Always sleep for 1s before returning HTTP 401 2020-09-05 22:45:46 +01:00