`getRevisionUserInfo` returned an incorrect list of usernames,
as users who edited a note at multiple places appeared multiple times.
This commit fixes this behaviour by deduplicating the author
objects using a Set.
Closes#2180
Signed-off-by: David Mehren <git@herrmehren.de>
TypeORM does not use a separate config option for the path
to the SQLite file.
Additionally, the "dialect" is called "type."
This commit adjusts our config to follow the upstream convention
to reduce confusion.
Signed-off-by: David Mehren <git@herrmehren.de>
The primaryAddress field of a note contained the internal UUID of the note when no primary alias was defined instead of the public note id.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2467b125 mistakenly applied the sanitize function
to the log messages *after* the color was applied.
This commit reverses the order to un-break colored logs.
Signed-off-by: David Mehren <git@herrmehren.de>
This tests the ldap part of the authConfig. Other tests shall be added as the auth method is implemented.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
If an empty string or undefined is provided the method should not return [], but undefined instead. This way defaults defined in Joi function as expected.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
The method should only change error messages if it was called with the correct parameters. Otherwise the function would change e.g `.url` in the error message to `_URL` and the regex is not able to change the front of the error message.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
By default, TypeORM wants to NULL the child-side of a
many-to-one relation, when the relation gets deleted.
This is not possible when the column is not nullable,
so the whole row needs to get deleted.
Signed-off-by: David Mehren <git@herrmehren.de>
To keep the createdAt date stable, even when the revisions are dropped,
this adds a separate column
to store this data separately from revisions.
Signed-off-by: David Mehren <git@herrmehren.de>
The primary address is never null.
If no alias is set, the id is returned.
To still easily get the primary alias, the complete Alias DTOs
are now included in the metadata.
Signed-off-by: David Mehren <git@herrmehren.de>
This renames the argument in the POST /profile route to `displayName`
to be more consistent with the UserDTO.
It also adds OpenAPI docs.
Signed-off-by: David Mehren <git@herrmehren.de>
This information is supposed to be used by the frontend
to identify the login method that was used.
The used login method is saved as a string into the session data
and extracted via a new SessionAuthProvider decorator.
Signed-off-by: David Mehren <git@herrmehren.de>
For reasons, during testing, reflect-metadata might not be imported.
This causes the `@Type` annotation to crash the test with a TypeError.
Signed-off-by: David Mehren <git@herrmehren.de>
MariaDB does not support `connect-typeorm`s subqueries,
so they need to be disabled if this dialect is used.
Signed-off-by: David Mehren <git@herrmehren.de>