Commit graph

4067 commits

Author SHA1 Message Date
renovate[bot]
32c42bfbc9
fix(deps): update dependency node-fetch to v2.6.2 (#1621)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-06 14:32:50 +00:00
David Mehren
7c618e7f9f
Merge pull request #1613 from hedgedoc/merge/tokenGuardAndStrategy 2021-09-06 12:12:44 +02:00
David Mehren
fe35f507b6
Merge pull request #1589 from hedgedoc/enhancement/getnotepipe 2021-09-06 12:12:15 +02:00
renovate[bot]
1d69dbf6fe
chore(deps): lock file maintenance (#1620)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-06 04:53:58 +00:00
renovate[bot]
d00b3a75e6
chore(deps): lock file maintenance (#1618)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-06 02:24:16 +00:00
David Mehren
9d21b5b786
Merge pull request #1615 from hedgedoc/readme-demo-develop
Update readme link to explanation page
2021-09-05 19:24:50 +02:00
Erik Michelson
419adb85bf
Update readme link to explanation page
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-09-05 11:57:45 +02:00
David Mehren
0dc472bba8
RevisionsService: Refactor getFirst/LastRevision
The functions now expect a `Note` object instead of a noteId to
make it more consistent with other functions.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
5c7a787d7e
MediaService: Refactor saveFile
The function now expects a `Note` object instead of a noteId
and a `User` instead of a username to
make it more consistent with other functions.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
279d90dad1
HistoryService: Remove getEntryByNoteIdOrAlias
As we now have a GetNotePipe, we can easily get rid of this function.
All clients can directly provide a `Note` instance
and use `getEntryByNote`.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
b552fc10b6
HistoryService: Refactor deleteHistoryEntry
The function now expects a `Note` object instead of a noteId to
make it more consistent with other functions.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
c515569299
HistoryService: Refactor updateHistoryEntry
The function now expects a `Note` object instead of a noteId to
make it more consistent with `updateHistoryEntryTimestamp`.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
99db4bc336
UserService: Improve method naming
This renames `createOrUpdateHistoryEntry` to `updateHistoryEntryTimestamp`,
which reduces confusion with the similarly named
`updateHistoryEntry` function.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
f667410b51
Public API: Test that forbidden notes can't be accessed
Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 22:40:15 +02:00
David Mehren
ea2dfafbd0
Private API: Use GetNotePipe
This replaces repeated calls to `noteService.getNoteByIdOrAlias`
and associated error handling with the `GetNotePipe`
in the `Param` decorator.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 21:42:54 +02:00
David Mehren
adc9ca6939
Public API: Remove superfluous try/catch
`getNoteMetadata` does not use a method that
can throw a `PermissionsUpdateInconsistentError`.
The try/catch-block seems to be a copy-paste error.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 21:42:54 +02:00
David Mehren
9da8d0efb0
Public API: Use GetNotePipe
This replaces repeated calls to `noteService.getNoteByIdOrAlias`
and associated error handling with the `GetNotePipe`
in the `Param` decorator.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 21:42:54 +02:00
David Mehren
1e3c08b3df
Implement GetNotePipe
This pipe transforms a note ID or alias to a Note object
by loading it from the database.
It also performs error handling

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 21:42:54 +02:00
David Mehren
5a47f208b4
Merge pull request #1599 from hedgedoc/renovate/develop-major-linters
chore(deps): update dependency eslint-plugin-prettier to v4 (develop)
2021-09-04 20:12:26 +02:00
David Mehren
1f017b33f2
Merge pull request #1598 from hedgedoc/renovate/develop-linters
chore(deps): update linters to v4.30.0 (develop) (minor)
2021-09-04 20:11:48 +02:00
Renovate Bot
bcdd42251b
chore(deps): update dependency eslint-plugin-prettier to v4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-09-04 17:19:26 +00:00
Renovate Bot
defb2522df
chore(deps): update linters to v4.30.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-09-04 17:19:14 +00:00
David Mehren
83c36ee3f9
Merge pull request #1588 from hedgedoc/enhancement/requestuser_decorator
Introduce RequestUser decorator
2021-09-04 18:40:03 +02:00
Philip Molares
c22727dad7 refactor: move TokenAuthGuard in the same file as TokenStrategy
This should help to make clear why code is executed when the TokenAuthGuard is encountered by a request. Currently, one has to connect both files via the string 'token', which is a bit cryptic

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-04 18:09:17 +02:00
David Mehren
dc6d9dfc20
Merge pull request #1612 from hedgedoc/fix-toAuthTokenDtoTest
Fix copy paste error in auth toAuthTokenDto test
2021-09-04 17:12:06 +02:00
David Mehren
ba2e4b0e3a
Public API: Introduce RequestUser decorator
This introduces the `RequestUser` decorator
to extract the `User` from a request.

It reduces code duplication across the public API
and allows us to drop the override of the `Request` type from express.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-04 17:05:38 +02:00
Yannick Bungers
9c7ab01016 Fix copy paste error in auth toAuthTokenDto test
Add an hour difference between createdAt and validUntil to better detect
these errors.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-09-03 19:19:55 +02:00
renovate[bot]
1a6e525446
chore(deps): update dependency mkdocs-material to v7.2.6 (#1606)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-01 22:18:35 +00:00
renovate[bot]
5dd0d21069
chore(deps): update dependency @types/node to v14.17.14 (#1603)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-01 00:40:16 +00:00
renovate[bot]
9b3f021a0b
chore(deps): update dependency @types/node to v14.17.13 (#1601)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 19:05:45 +00:00
renovate[bot]
99913acb8e
chore(deps): lock file maintenance (#1597)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-30 02:35:31 +00:00
David Mehren
664488e822
Merge pull request #1591 from hedgedoc/renovate/develop-pin-dependencies
chore(deps): pin dependency @trivago/prettier-plugin-sort-imports to 2.0.4 (develop)
2021-08-29 22:46:58 +02:00
David Mehren
bc04200f13
Merge pull request #1592 from hedgedoc/renovate/develop-linters
chore(deps): pin dependency eslint-plugin-prettier to 3.4.1 (develop)
2021-08-29 22:46:45 +02:00
Renovate Bot
de9e12e472
chore(deps): pin dependency eslint-plugin-prettier to 3.4.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 19:44:51 +00:00
Renovate Bot
d9c983d423
chore(deps): pin dependency @trivago/prettier-plugin-sort-imports to 2.0.4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 19:44:38 +00:00
Yannick Bungers
d92b39eae2
Merge pull request #1590 from hedgedoc/chore/sort_imports 2021-08-29 21:16:00 +02:00
David Mehren
502b1b3202
Merge pull request #1573 from hedgedoc/renovate/develop-tsconfig-paths-3.x
chore(deps): update dependency tsconfig-paths to v3.11.0 (develop)
2021-08-29 20:09:06 +02:00
David Mehren
de56f962d3
Run prettier format checks in ESLint
This enables the prettier ESLint plugin.
In contrast to the prettier ESLint config (which is already enabled),
the plugin also runs checks against prettiers format rules
as part of ESLint.
This enables instant feedback in the editor,
when code violates the format rules and allows for quick-fix actions.

See also https://github.com/prettier/eslint-plugin-prettier#recommended-configuration

Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 19:54:56 +02:00
David Mehren
3658204acb
Cleanup some imports
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 18:57:00 +02:00
David Mehren
bcc9ec9c75
Enforce import order with prettier
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 18:45:46 +02:00
David Mehren
68f1b2c703
Setup prettier plugin to sort imports
Signed-off-by: David Mehren <git@herrmehren.de>
2021-08-29 18:45:06 +02:00
Renovate Bot
1c777f42dd
chore(deps): update dependency tsconfig-paths to v3.11.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 14:11:47 +00:00
David Mehren
abdf28896c
Merge pull request #1585 from hedgedoc/renovate/develop-typescript-4.x
chore(deps): update dependency typescript to v4.4.2 (develop)
2021-08-29 16:10:45 +02:00
Renovate Bot
4e14d7789f
chore(deps): update dependency typescript to v4.4.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-29 13:48:58 +00:00
David Mehren
72e4253fc7
Merge pull request #1586 from hedgedoc/renovate/develop-test-packages
chore(deps): update dependency jest to v27.1.0 (develop)
2021-08-29 15:47:39 +02:00
Renovate Bot
bb7fd395d2
chore(deps): update dependency jest to v27.1.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-08-27 12:25:08 +00:00
renovate[bot]
d56e9369a6
fix(deps): update dependency @types/minio to v7.0.10 (#1581)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-26 10:06:09 +00:00
renovate[bot]
9defdf71b6
chore(deps): update dependency @types/node to v14.17.12 (#1579)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-26 03:09:55 +00:00
renovate[bot]
8681841fa8
chore(deps): update dependency mkdocs-material to v7.2.5 (#1577)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 08:56:08 +00:00
renovate[bot]
7e0f3d1006
chore(deps): update dependency eslint-plugin-import to v2.24.2 (#1575)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-25 02:27:59 +00:00