Commit graph

2735 commits

Author SHA1 Message Date
David Mehren
798586c996
Add basic test for auth middlewares
To check for basic mistakes like broken imports, these tests try to create all middlewares (excluding SAML, because that requires a certificate file on disk)

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
David Mehren
3262315248
Fix generateAvatarURL
Previously, we checked for `typeof email !== 'string'`. This code got turned into `email.length === 0`, which changed the behaviour of the method.
Because TypeScript makes sure that `email` is always a string, we can get rid of the check altogether.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
David Mehren
08655f06f9
Profile.emails is now a string array 🏷️
Dropbox wrapped their email attribute in another object. We now unwrap this object in the DropboxMiddleware and don't need to special-case the email attribute in User.parsePhotoByProfile and the Profile type anymore.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
David Mehren
9c720183aa
Fix import in DropboxMiddleware
The passport plugin does not have a default export.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-16 21:16:38 +02:00
Sheogorath
5b05760c8f
Merge pull request #356 from davidmehren/fix-history-get
setHistory: Do not parse history into an array again
2020-05-10 17:15:19 +02:00
David Mehren
6c8c5f1062
Type annotations for realtime.ts
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:38 +02:00
David Mehren
642ae9417c
Fix interchanged parameters in socket.io disconnect handler. 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:38 +02:00
David Mehren
394abe7cf8
Fix typings for connect-flash.
The `msg` argument is optional.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:37 +02:00
David Mehren
dcdbd3bf35
Replace processData calls with ??
Many times processData was just used to ensure a default value is present. Since TS 3.7 the nullish coalescing operator ?? is supported for that.

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:37 +02:00
David Mehren
ea9cd56a20
Simplify processData
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 19:59:37 +02:00
David Mehren
539d99b835
setHistory: Do not parse history into an array again, historyPost already made sure we have an array
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-05-09 14:35:06 +02:00
Sheogorath
d3aa040626
Merge pull request #345 from davidmehren/fix-343
findNoteOrCreate: Create new note with empty string instead of `null`
2020-04-28 00:08:02 +02:00
David Mehren
3ac388b765
findNoteOrCreate: Create new note with empty string instead of null
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-26 22:10:20 +02:00
Sandro Jäckel
00bf2e417b
Update all links with https
Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2020-04-26 21:59:08 +02:00
Sandro Jäckel
df1fa4f0c9
Update outdated links
Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2020-04-26 21:59:07 +02:00
Sheogorath
2c7d743cb6
Merge pull request #338 from davidmehren/typescript-pr
Migrate Backend to TypeScript
2020-04-26 15:44:17 +02:00
David Mehren
5996e4c594
Always sync session table to database
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:20 +02:00
Philip Molares
6480c142a9
fixed usage of migrations
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:20 +02:00
Philip Molares
94c3857d49
sort app.ts
moved handleTermSignals to utils.ts

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:20 +02:00
Philip Molares
9d17f6a7f4
removed anonymous function to generate ca
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
Philip Molares
e015234aaf
ordered imports
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
David Mehren
ba6055a03d
Downgrade jQuery to 3.4.1
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
Yannick Bungers
9c38a339df
Added types and removed requires from app.ts
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
David Mehren
e0192b5652
history.ts: Fix 🚑 getHistory
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:19 +02:00
David Mehren
2408aef54c
dmpWorker.ts: Wrap process.send in a function to not lose this 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
d89cf23fdd
revision.ts: Remove .connected from dmpWorker check in sendDmpWorker.
Why did it appear there? Nobody knows...

Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
3f87539d7d
dmpWorker.ts: Fix check for attributes on data object
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
dd63f789f7
auth/email: Redirect on (un)successful registration
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
David Mehren
3ea64b2308
models/revision.ts: Fix primary key default value
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:18 +02:00
Yannick Bungers
c24023437f
Fixed Bug with multiple messages
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
dc3a3f2994
Migrate editor-socketio-server.js to TypeScript
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
c7478157e2
models/revision.ts: Use .js extension to load dump worker.
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
73d4023155
note/actions.ts: Formatting fixes and lint exceptions
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
Philip Molares
5a1a25dda4
added auth/oauth2.ts
added oauth2 to ProviderEnum

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
287148f1e8
auth/google: Fix weird type error 🏷️ 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:17 +02:00
David Mehren
6e8ea859cd
app.ts: Use imports instead of require for middlewares.
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:16 +02:00
David Mehren
cc5db72369
auth/utils.ts: Fix type of done callback 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:16 +02:00
David Mehren
5d3c636c14
auth/email: Fix passport import 🐛
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:16 +02:00
Yannick Bungers
992affae45
fixed google
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:16 +02:00
Yannick Bungers
83ef1de792
Refactored OpenID to typescript
Added OpenID in auth

Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:16 +02:00
Philip Molares
4e74998372
fixed auth/google import
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:16 +02:00
Philip Molares
5c9bef36d1
Migrate auth/ldap.js to TypeScript
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
Yannick Bungers
2df8e1687b
Refactored google to Typescript
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
Philip Molares
7eb27e012f
fixed auth/email import
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
Philip Molares
dc58e8a65b
added auth/saml.ts
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
David Mehren
1903ba12af
auth/index.ts: Refactor Gitlab & Dropbox middlewares
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
David Mehren
1353e61e87
auth/gitlab: Migrate to AuthMiddleware
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
Philip Molares
3c216795e7
added all @types for passport-strategies as devDependencies
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:15 +02:00
Yannick Bungers
0a678f808f
Refactored Auth/Email to typescript
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:14 +02:00
Yannick Bungers
aaca777467
Refactored dropbox to typescript
Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-04-25 16:04:14 +02:00