Commit graph

4043 commits

Author SHA1 Message Date
Yannick Bungers
aa8455a079 change getTokensByUsername to getTokensByUser
Signed-off-by: Yannick Bungers <git@innay.de>
2021-10-13 22:22:08 +02:00
Yannick Bungers
141b1bf5e8 Add e2e tests for tokens
Signed-off-by: Yannick Bungers <git@innay.de>
2021-10-13 20:54:27 +02:00
Yannick Bungers
276d423ee2 Fix tests with using sessions in e2e tests of private api
Signed-off-by: Yannick Bungers <git@innay.de>
2021-10-13 20:54:27 +02:00
Yannick Bungers
28266bca0b Get user from Session instead of hardcoded value
Signed-off-by: Yannick Bungers <git@innay.de>
2021-10-13 20:52:39 +02:00
David Mehren
b2ae4a85c3
Merge pull request #1668 from hedgedoc/renovate/develop-mkdocs-material-7.x 2021-09-23 15:53:43 +02:00
David Mehren
a031de4522
Merge pull request #1359 from hedgedoc/feat/aliases
add list of aliases to note entity
2021-09-23 15:52:06 +02:00
Renovate Bot
26449adef7
chore(deps): update dependency mkdocs-material to v7.3.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-09-23 09:07:52 +00:00
Philip Molares
49c1c8de34 docs: add primary aliases to the dev doc about notes
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:45 +02:00
Philip Molares
7bb70649a0 fix: the seed command handles the new aliases
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:45 +02:00
Philip Molares
9f38b9036c test: fix e2e tests to handle the new aliases
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:45 +02:00
Philip Molares
b95a6f56b6 test: fix service tests to handle the new aliases
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:45 +02:00
Philip Molares
e9d4a81922 feat: add alias controller to private and public api
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:45 +02:00
Philip Molares
3b7a06913b feat: add aliases to service files
This commit makes it possible to identifier notes via any alias in the note and history service.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:44 +02:00
Philip Molares
794be4a5dc chore: create getIdentifier utility function
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:44 +02:00
Philip Molares
10ed40f9f1 chore: create getPrimaryAlias utility function
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:44 +02:00
Philip Molares
0db7a41d1a feat: add alias service
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-22 20:43:44 +02:00
renovate[bot]
ba903d8c7e
fix(deps): update dependency node-fetch to v2.6.5 (#1666)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-22 16:14:38 +00:00
David Mehren
e4fb29b0f2
Merge pull request #1664 from hedgedoc/security-file 2021-09-22 16:02:01 +02:00
renovate[bot]
4ae8051d50
chore(deps): update dependency @types/node to v14.17.18 (#1665)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-21 21:54:36 +00:00
renovate[bot]
54d1439dc5
fix(deps): update dependency node-fetch to v2.6.4 (#1662)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-21 15:25:35 +00:00
Erik Michelson
c383206afd
Update security.md to match state in master branch
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2021-09-21 15:20:40 +02:00
Philip Molares
aaef0f72ba feat: add list of aliases to note entity
One of the aliases can be primary for each note, but all can be used to get information from the apis.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-21 15:14:00 +02:00
Philip Molares
7dd4f97d64 chore: add PrimaryAliasDeletionForbiddenError
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-21 15:14:00 +02:00
Philip Molares
dd2667b523 chore: add alias dtos
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-21 15:14:00 +02:00
David Mehren
990665745a
Merge pull request #1663 from hedgedoc/fix/issue_template_titles
Add missing title property to issue templates
2021-09-21 15:10:07 +02:00
David Mehren
acc17abb7c Add missing title property to issue templates
Signed-off-by: David Mehren <git@herrmehren.de>
2021-09-21 15:04:21 +02:00
David Mehren
90b74a3cf2
Merge pull request #1645 from hedgedoc/new-issue-templates
Use GitHub issue forms
2021-09-21 14:57:39 +02:00
renovate[bot]
df3ad63645
chore(deps): update dependency @types/jest to v27.0.2 (#1661)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-21 04:04:44 +00:00
renovate[bot]
6a8e34a3ff
fix(deps): update dependency node-fetch to v2.6.3 (#1660)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-20 23:33:07 +00:00
renovate[bot]
50c7f4a6e5
chore(deps): update dependency ts-loader to v9.2.6 (#1659)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-20 21:58:44 +00:00
renovate[bot]
4081def3db
chore(deps): update linters to v4.31.2 (#1658)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-20 19:16:34 +00:00
renovate[bot]
7159d616f4
chore(deps): update dependency jest to v27.2.1 (#1624)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-20 15:21:31 +00:00
renovate[bot]
1d78babc04
chore(deps): update dependency mkdocs-material to v7.2.8 (#1657)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-20 13:02:26 +00:00
renovate[bot]
0b9936b45e
chore(deps): lock file maintenance (#1655)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-20 02:00:07 +00:00
renovate[bot]
5069aa0a78
chore(deps): update dependency mkdocs-material to v7.2.7 (#1653)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-19 16:24:07 +00:00
renovate[bot]
76be847866
fix(deps): update dependency eslint-plugin-jest to v24.4.2 (#1648)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-17 10:18:05 +00:00
renovate[bot]
b67dc943d0
chore(deps): update dependency @types/node to v14.17.17 (#1647)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-17 02:37:16 +00:00
renovate[bot]
16724df739
chore(deps): pin dependencies (#1646)
Signed-off-by: Renovate Bot <bot@renovateapp.com>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-09-17 00:45:34 +00:00
Yannick Bungers
83f0bbb986
Merge pull request #1517 from hedgedoc/privateApi/auth/email
Add local login with username and password
2021-09-17 00:06:17 +02:00
Philip Molares
67baa51b93 feat: add auth e2e tests
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-17 00:00:00 +02:00
Philip Molares
b153615637 feat: add auth controller with internal login, registration, password change and logout
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-17 00:00:00 +02:00
Philip Molares
1a96900224 feat: add LoginEnabledGuard and RegistrationEnabledGuard
These guards check if the login or registration are enabled in the config. If so the guarded method is executed, if not the client will get the HTTP Error 400 Forbidden as an answer

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-17 00:00:00 +02:00
Philip Molares
53f5713905 fix: update seed.ts
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-17 00:00:00 +02:00
Philip Molares
28be215aad feat: add session handling
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-17 00:00:00 +02:00
Philip Molares
ce68184578 feat: add identity module
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-16 23:59:59 +02:00
Philip Molares
9fa0994497 feat: add local auth strategy
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-16 23:59:59 +02:00
Philip Molares
6ad11e47cc feat: add identity service
This service handles all the authentication of the private api.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-16 23:59:59 +02:00
Philip Molares
021a0c9440 feat: add getFirstIdentityFromUser helper function
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-16 23:59:59 +02:00
Philip Molares
cda8c7ac63 feat: change email auth config to local
This was done to use the same term. Also email was the old term from HedgeDoc 1 and wildly inaccurate. As we never checked any mail addresses, in fact it was more of a username than anything else.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-16 23:59:59 +02:00
Philip Molares
df08d56f28 feat: add session to AuthConfig
this handles the settings for the cookie session. The secret and the lifeTime of the cookie can be configured.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-09-16 23:59:59 +02:00