Philip Molares
63fcca6c0d
UsersService: Add unit tests
...
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:30:19 +01:00
Philip Molares
b86a7c601d
UsersService: Polish methods
...
Add test to createUser method to ensure an already used username triggers a AlreadyInDBError.
Add debug entry if user is deleted.
Add changeDisplayName method.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:30:03 +01:00
Philip Molares
bce0ca9d74
UsersService: Add JSDoc to all methods
...
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:26:57 +01:00
Philip Molares
5a9634400a
UserEntity: Make userName unique
...
Each username should only be given once.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:25:06 +01:00
Philip Molares
846bbeb390
UnitTests: Add appConfigMock
...
This is necessary as the Logger needs this config for the loglevel.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-14 00:19:09 +02:00
Philip Molares
47ca8be78b
Docs: Add ApiProperty to all Dtos
...
This makes it possible for the autogenerated openapi file to contain all the dtos instead of nothing.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 12:08:34 +01:00
David Mehren
b128efebff
Enforce explicit function return types
...
This re-enables the `@typescript-eslint/explicit-module-boundary-types`
check and also enables the
`@typescript-eslint/explicit-function-return-type` check.
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-27 17:41:32 +01:00
David Mehren
cc1ca69bc1
Fix various ESLint errors in services
...
Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-24 22:35:06 +01:00
Philip Molares
bafe379cc3
NotesService: Add unit tests
...
Fixed toUserDto method of UsersService: If a user has no email an empty string should be returned (like with the photoUrl) instead of null.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 16:09:22 +01:00
Yannick Bungers
68cbb5a9c2
Add relation between User and Group
...
This represents the users which are members of this group
Signed-off-by: Yannick Bungers <git@innay.de>
2021-01-27 22:58:55 +01:00
Philip Molares
300b464efd
History: Add HistoryEntry
...
With this the backend now can hold a history entry.
Also included in this commit are some minor changes to tests and services so they can still work.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-03 21:15:39 +01:00
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