Commit graph

28 commits

Author SHA1 Message Date
David Mehren
1a825ed199
UserInfoDto: Add doc comments
Signed-off-by: David Mehren <git@herrmehren.de>
2021-01-25 22:22:01 +01:00
Philip Molares
ad0ab648bc
auth: Add maximum token lifetime of 2 years.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-25 12:14:26 +01:00
Philip Molares
39d9fb5dec
tokens: Add token creation
Fix token deletion
Update plantuml docs
Add token validUntil and lastUsed fields

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-21 19:37:43 +01:00
Philip Molares
508ad26771
auth: Add tests for AuthService
Move AuthTokens to auth folder

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-22 15:29:10 +01:00
Philip Molares
c9751404f7
tokens: Add token creation
Fix token deletion
Update plantuml docs
Add token validUntil and lastUsed fields

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-21 19:37:43 +01:00
Philip Molares
4784a1aea2
private: Add until to token creation
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-21 12:33:45 +01:00
Philip Molares
324ba71d24
private: removes collision check for tokens
this seems very unnecessary as the chance of this is 1 / 2^512

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-17 20:35:43 +01:00
Philip Molares
97f7128355
private: fixed token generation bugs
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-17 19:52:08 +01:00
Philip Molares
822c01f2c7
private: save token hashed
Auth tokens are now saved in hashed form.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-17 14:45:16 +01:00
Philip Molares
e5545043be
auth: hash auth token
Since the auth token will be stored in hashed form in the db, we need to hash each provided auth token in order to search in the db for them.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-17 14:38:05 +01:00
Philip Molares
667cf7e915
auth: add hash function
the hash function uses bcrypt with 2^16 iterations.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-17 14:32:17 +01:00
Philip Molares
e04fcb9ee9
auth: hash auth token
Since the auth token will be stored in hashed form in the db, we need to hash each provided auth token in order to search in the db for them.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-17 15:27:13 +01:00
Philip Molares
80c7ae2fa9
private: adds tokens controller
adds private api
adds AuthTokenDto and AuthTokenWithSecretDto
adds necessary methods in the users service
adds RandomnessError

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-16 23:53:46 +01:00
David Mehren
3801b1b042
Format with Prettier 2
Signed-off-by: David Mehren <git@herrmehren.de>
2021-01-06 23:48:53 +01:00
Tilman Vatteroth
7aeaf488c4
Change year in copyright to 2021
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-06 21:36:07 +01:00
Philip Molares
dc63c76f43
added reuse information
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-01-05 22:12:38 +01:00
David Mehren
53fbe82b6a
UserEntity: Fix column types for create/update dates
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-24 11:34:49 +02:00
David Mehren
16dfbdd42d
UsersService: Wait for the DB to find a user
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 21:52:59 +02:00
David Mehren
d41b68b41a
Add various missing imports and provider ovverides in unit tests
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-17 20:21:22 +02:00
David Mehren
219a3bcb5f
UsersService: Add methods to find, create and delete users
Signed-off-by: David Mehren <git@herrmehren.de>
2020-10-12 21:46:53 +02:00
David Mehren
e37722a56a
Switch to using the new custom logger
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-27 21:48:42 +02:00
David Mehren
ab4ecf6a8f
UsersService: Merge if-statements and add null to return type in toUserDto
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-26 16:00:17 +02:00
David Mehren
615bd6496b
UsersService: Add null check to toUserDto() converter
Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-22 17:28:57 +02:00
David Mehren
30a0b25094
UsersService: Add toUserDto() converter
This conversion function makes sure that a photo URL exists.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-09-19 17:33:29 +02:00
David Mehren
2654f1fa36
Implement User entity.
This commit implements the User entity according to the database schema and adds the Identity and AuthToken entities.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-13 20:26:47 +02:00
David Mehren
6bee3b16cf
Add Session entity
This entity implements the Session interface from connect-typeorm, which we will later use to store session data from express-session.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-13 20:25:43 +02:00
David Mehren
643adb7f9f
Log warnings when using hardcoded data.
Signed-off-by: David Mehren <git@herrmehren.de>
2020-07-26 17:28:32 +02:00
David Mehren
27126bcde1
Add UsersModule
This contains the module, a service (which only returns mock data), a model and the UserInfo DTO.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-07-25 20:06:22 +02:00