Commit graph

1420 commits

Author SHA1 Message Date
Yannick Bungers
a1fd52d8ab fix param description of updateNotePermissions
Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
f096d706c8 optimize readability of find calls
Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
70d7ca5475 Move permission update functions to permissions controller
Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
e1e3138561 Add permissions service to test-setup
Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
4dd2762be2 Add unit tests for new notes service methods
setUserPermission
removeUserPermission
setGroupPermission
removeGroupPermission
changeOwner

Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
0a3271e4a5 Add GroupsModule import to public API module
Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
647990022b Add API routes for fine-grained permission manipulation
Signed-off-by: Yannick Bungers <git@innay.de>

fix lint

Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
Yannick Bungers
20ebb41197 Add service functions for fine-grained permission API calls
Signed-off-by: Yannick Bungers <git@innay.de>
2022-03-13 21:33:02 +01:00
David Mehren
3e096e9cbe fix(note-user-permission): ensure whole row gets deleted
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>
2022-03-13 21:33:02 +01:00
Renovate Bot
264013430e chore(deps): update dependency http-proxy-middleware to v2.0.4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-13 18:33:25 +00:00
Renovate Bot
9efb50f7e2 fix(deps): update dependency rxjs to v7.5.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-12 09:04:09 +00:00
Renovate Bot
dee52d0cad chore(deps): update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-12 10:03:21 +01:00
Renovate Bot
df42e8bde8 chore(deps): update node.js to 8c62619
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-12 06:20:26 +00:00
Renovate Bot
d144442bcf chore(deps): update dependency @nestjs/schematics to v8.0.8
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-12 03:47:57 +00:00
Renovate Bot
5abc2a7a71 chore(deps): update node.js to v17
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 14:32:30 +01:00
Renovate Bot
981e2d423e chore(deps): update dependency @types/pg to v8.6.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 14:25:44 +01:00
Renovate Bot
c6db04ae2e chore(deps): pin dependencies
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 14:19:31 +01:00
David Mehren
c72bf5d851
ci: enable renovate digest pinning
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 14:18:46 +01:00
David Mehren
3fc8c0ccc7 ci: configure renovate for docker
See https://docs.renovatebot.com/docker/

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:55:07 +01:00
David Mehren
4c79d18e1f feat: add a dockerfile
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:55:07 +01:00
David Mehren
2ae8b0c44f refactor(frontend-integration): inline-import http-proxy-middleware
If no dev-dependencies are installed, the unconditional
import crashes the app.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:55:07 +01:00
David Mehren
4f40366e91 build: add workspace-tools yarn plugin
This is needed to install production-only dependencies
in Docker containers.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:55:07 +01:00
David Mehren
e7ca10bb66 refactor(history-entry-import-dto): rename lastVisited -> lastVisitedAt
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
2605e8894d refactor(media-service): delete unused method
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
c16d5bb79e fix(revision): DTOs should correctly extend BaseDto
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
09ec447069 feat(note): save createdAt in a separate column
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>
2022-03-07 13:54:43 +01:00
David Mehren
342efcd7b7 feat(note-metadata): replace primaryAlias with primaryAddress
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>
2022-03-07 13:54:43 +01:00
David Mehren
64b16c831e refactor(register-dto): rename displayname -> displayName
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
6f1bdcbaa5 feat(revision): include author details in metadata dto
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
a9f27731bd refactor(revision): make RevisionDto extend RevisionMetadataDto
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
3ea42fb048 feat(revision): include length in dto
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
7050c9f13b feat(revision): include edits in dto
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
50c8f39c0c feat(note): add version attribute
This attribute was defined in the dev docs,
but never implemented.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
6944094b9b fix(api/private/me): require and document displayName
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>
2022-03-07 13:54:43 +01:00
David Mehren
d6ea4d29fe feat(api/private/me): include authProvider in UserInfo
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>
2022-03-07 13:54:43 +01:00
David Mehren
3f8e3b0589 refactor(api/public/media): return MediaUpload object instead of url
This ensures the POST /media API behaves in the same way as /me/media

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
8e31f3a393 refactor(api/private/media): return MediaUpload object instead of url
This ensures the private POST /media API behaves in the same way as /me/media

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
David Mehren
4f10e17d40 fix(frontend-config): iframe origins should be non-optional
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-07 13:54:43 +01:00
Renovate Bot
67743b7cf5 chore(deps): lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-07 03:38:57 +00:00
Renovate Bot
13a44727c7 fix(deps): pin dependencies
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2022-03-06 22:41:11 +01:00
David Mehren
268b39154d ci: move node version into a variable
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
d73c9b8e86 ci: add config for e2e tests with multiple DBs
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
513d64493e test: add and use a mocked DatabaseConfig
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
89297e748f fix: TypeError in HistoryEntryImportDto
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>
2022-03-06 22:24:21 +01:00
David Mehren
f9448bb801 fix(session): limit subqueries for mariadb
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>
2022-03-06 22:24:21 +01:00
David Mehren
9c6d3d9dab test: test don't need to set up sessions by themselves
The setup is handled inside TestSetupBuilder.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
9030488025 test: make tests order-independent
MariaDB seems to order the returned media objects in a different way,
making our tests fail.

This refactors the tests to be independent of the order of returned data.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
c7e77d25a0 test: support running e2e tests with mariadb
Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
552cb05d92 refactor(api/private/tokens): validate POST data with DTO
This adds a `AuthTokenCreateDto` which allows
to fully validate incoming JSON data.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00
David Mehren
fd3fde9cc8 refactor(api/private/history): validate POST data with DTO
This adds a `HistoryEntryImportListDto` which allows
to fully validate incoming JSON data.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-03-06 22:24:21 +01:00