Commit graph

6259 commits

Author SHA1 Message Date
renovate[bot]
97bc3995ad
fix(deps): update nestjs packages (#1866)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-04 13:02:24 +00:00
renovate[bot]
a42632d034
fix(deps): update dependency minio to v7.0.23 (#1865)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-04 10:11:24 +00:00
renovate[bot]
5591d8cccf
fix(deps): update dependency joi to v17.4.3 (#1864)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-04 05:49:23 +00:00
renovate[bot]
6372ed7dfd
chore(deps): update dependency @types/node to v16.11.11 (#1862)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-12-04 03:38:06 +00:00
Philip Molares
10b5b11269
feat: replace GetNotePipe with GetNoteInterceptor and RequestNote
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-30 22:33:20 +01:00
Philip Molares
5a45ff2d0b
feat: add request note decorator
This extracts the note inserted with the get note interceptor into the request to be used by the controller service.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-30 22:26:55 +01:00
Philip Molares
470b32ed5e
feat: refactor get note pipe to interceptor
This is necessary, because of the order of operations in nestjs, the validation pipe is not able to get the note as the noteIdOrAlias will be transformed by the get note pipe after the validation did run.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-30 22:20:49 +01:00
Philip Molares
0cb3b65998
test: fix note e2e test 'fails with non-existing alias'
Because the rejection now happens automatically in the permissions guard it does not get to the controller method and does not report the Content-Type to text/markdown

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 18:04:47 +01:00
Philip Molares
988909eb0b
test: fix note e2e test 'fails, when user can't read note'
Because the rejection now happens automatically in the permissions guard it now returns a 403 instead of 401

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 18:03:29 +01:00
Philip Molares
3e4abb561d
refactor: move permissions service calls into permissions guard
This commit removes all previous calls to the permissions service at the beginning of the controller methods to the permissions guard. This should make the code a bit cleaner and remove boilerplate code.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 17:19:57 +01:00
Philip Molares
3b92226bab
feat: create permissions guard
This guard protects resources and let's users only access them if they hold the correct permission

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 17:18:23 +01:00
Philip Molares
7404ebf5ea
feat: create permission decorator
This gathers the permission a user needs to hold to access a resource for the PermissionsGuard.

See https://docs.nestjs.com/guards#setting-roles-per-handler

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 17:17:33 +01:00
Philip Molares
4a7ccc8178
feat: create permission enum
This enum makes it possible which permissions a user needs to hold to access a specific resource

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 17:16:12 +01:00
Philip Molares
82643cd790
chore: extract getNote code from GetNotePipe.transform
This was done so the same code could be used in the PermissionsGuard

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 17:12:35 +01:00
Philip Molares
7927ac2217
chore: move get-note-pipe to api utils
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 17:05:27 +01:00
Yannick Bungers
9093e5fabc
Add missing null in type in permissions service
The parameters of the permission checking methods were missing a null value for not set user. This is the case if user is not logged in and operating as guest.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-11-29 22:42:31 +01:00
Renovate Bot
fdddedf6b3
fix(deps): update dependency passport to v0.5.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-11-21 23:20:49 +00:00
Renovate Bot
02eef978b3
chore(deps): update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-11-23 07:50:47 +00:00
Renovate Bot
c49fb069ab
fix(deps): update dependency class-transformer to v0.5.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-11-22 19:53:40 +00:00
Renovate Bot
7ff54b1c3f
chore(deps): update dependency tsconfig-paths to v3.12.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-11-21 23:20:22 +00:00
Philip Molares
e9fab8c568
test: fix test name in alias.e2e-spec.ts
This seems to be a copy/paste bug

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-21 18:06:41 +01:00
renovate[bot]
fdb4ac3af3
fix(deps): update dependency minio to v7.0.20 (#1842)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-21 01:15:29 +00:00
Renovate Bot
453431282b
chore(deps): update dependency typescript to v4.5.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 15:08:40 +00:00
renovate[bot]
33332808c4
fix(deps): update dependency class-validator to v0.13.2 (#1839)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 15:05:49 +00:00
renovate[bot]
3958a4ac05
fix(deps): update dependency typeorm to v0.2.41 (#1836)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 12:20:22 +00:00
renovate[bot]
9eeb6ab152
chore(deps): update nestjs packages (#1835)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 10:40:44 +00:00
renovate[bot]
bf1567614e
chore(deps): update dependency source-map-support to v0.5.21 (#1834)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 08:38:19 +00:00
renovate[bot]
b9feed1811
chore(deps): update dependency @types/node to v16.11.9 (#1833)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 04:10:49 +00:00
renovate[bot]
b59340831d
chore(deps): update dependency @types/jest to v27.0.3 (#1832)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-20 02:13:10 +00:00
Renovate Bot
321d545907
chore(deps): update linters to v5.4.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-11-17 08:34:13 +00:00
David Mehren
bc2bef913f
ci(renovate): separate major updates
Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-16 18:01:48 +01:00
David Mehren
803685fd3f
ci(renovate): run only on weekends
Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-16 17:59:02 +01:00
David Mehren
8b4e4b86f2
ci(renovate): remove explicit dependencyDashboard
The `config:base` preset now includes this option

Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-16 17:55:15 +01:00
renovate[bot]
88fe0f9c0c
fix(deps): update dependency raw-body to v2.4.2 (#1828)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-17 05:38:10 +00:00
David Mehren
7ef380241d
fix(seed): fix create method usage
Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-14 21:49:31 +01:00
David Mehren
b9d3c95d2d
fix(note): fix type for owner param
To make the create method easier to use in conjunction
with the authentication framework, this commit changes the type of
the `owner` parameter from `User | undefined` to `User | null`.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-14 21:44:59 +01:00
David Mehren
c675dd0e9e
fix(alias): remove default for primary
To make the create method more consistent with the
guidelines,
this commit removes the default value from the `primary` parameter.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-14 21:22:22 +01:00
David Mehren
04412826a7
fix(media-upload): remove backendData parameter
`Create` methods should only contain optional properties

Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-14 21:14:03 +01:00
David Mehren
3fe1bb0edf
fix(identity): remove default for syncSource
To make the create method more consistent with the
guidelines,
this commit removes the default value from the `syncSource` parameter.

An Identity will be created as sync source,
when the associated account is created using an external provider.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-14 20:56:17 +01:00
David Mehren
178513a3a0
fix(group): add special flag to create method
To make the create method more consistent with the
guidelines, this commit adds the `special` flag to
the parameters.
As this function will only be used to create the two hard-coded groups
and to handle API requests at one or two places, adding the parameter
should not be too problematic.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-11-14 20:53:45 +01:00
Philip Molares
d0239f3a24
docs: add dev documentation for create methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-11 22:07:00 +01:00
Philip Molares
62037acc97
fix(media-upload): rework create and media services saveFile
This was done to make the create method more concise.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-11 22:06:30 +01:00
Philip Molares
ed5367d456
test(private-api): fix aliases expect
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-11-08 21:40:36 +01:00
Renovate Bot
994d22eb35 Update dependency katex to v0.14.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-10-31 00:17:10 +02:00
Renovate Bot
4844ff4552 Update dependency katex to v0.13.23
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-10-30 14:17:50 +02:00
renovate[bot]
8fc8343018
Update dependency @types/jest to v27 (#1605)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-30 10:34:14 +02:00
renovate[bot]
279b0a3845
Update dependency katex to v0.13.22 (#1604)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-30 10:33:28 +02:00
Tilman Vatteroth
c7c7c9ac74 Change scss import of reveal to css
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-10-29 23:03:01 +02:00
Renovate Bot
9c0e4c2f7e Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-10-29 22:39:57 +02:00
Renovate Bot
060b1822d2 Update dependency sass to v1.43.4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-10-29 22:19:10 +02:00