Commit Graph

14 Commits

Author SHA1 Message Date
Jesse Chan
1a878d5423 flood: rearrange, remove misc files and reformat 2020-11-15 23:03:47 +08:00
Jesse Chan
80ffb24d8d API: torrents: schema validate add-urls and add-files endpoints
Those endpoints use extensive amount of user-provided properties
and will be frequently used by third party developers. With Node
15, unhandled promise rejections directly crash the server, as
such, it is safer to schema validate the request before processing
it.

This change also prepares the code paths for later change that adds
destination fallbacks.
2020-11-13 13:27:31 +08:00
Jesse Chan
4ab66d310e server: switch to hash-wasm impl of argon2 2020-11-12 11:30:27 +08:00
Jesse Chan
ccb410d2e5 config: switch to authMethod config for auth method selection 2020-10-31 20:48:55 +08:00
Jesse Chan
6c41c764f1 API: auth: preload server configs along with /verify response
Get rid of last build-time config dependency and allows easier
switching of client modes.
2020-10-26 20:40:59 +08:00
Jesse Chan
306ff79182 API: auth: don't include token in JSON objects
Token is already sent by Set-Cookie. It is unneccessary and
insecure to include them in JSON response. Doing so also
introduce the token into Javascript VM which is not protected
as well as the httpOnly cookies.
2020-10-26 20:40:59 +08:00
Jesse Chan
3610c9ef8d tests: api: auth: full coverage for auth endpoints 2020-10-14 10:58:52 +08:00
Jesse Chan
49bc51952b server: auth: rate limits auth endpoints 2020-10-14 10:58:52 +08:00
Jesse Chan
34b5e09753 server: migrations: add migration for UserInDatabase2 2020-10-14 10:58:52 +08:00
Jesse Chan
cf08d68c92 auth, Users: initial preparation for multi client support
BREAKING CHANGE
2020-10-14 10:58:52 +08:00
Jesse Chan
720bd5d532 server: auth: /register should use isAdmin from req.body
Now initial user creation shares the endpoint with subsequent ones.
2020-10-11 18:07:26 +08:00
Jesse Chan
d17e3fee08 server: auth: fix subsequent user creation 2020-10-11 01:00:30 +08:00
Jesse Chan
61e6e79497 shared: types: move API types to api folder 2020-10-10 12:50:26 +08:00
Jesse Chan
f6896413a3 server: move auth APIs to /api/auth
Auth APIs are APIs too. Let's recognize it.
2020-10-10 12:42:27 +08:00