This branch introduces the features of login and logout, user creation, user reading, and password updating.
However, users can currently not be updated (eg. changing of groups); I still think it would be a good idea to merge this.
Quickly reading through the code would be appreciated as there might be some issues - even tough the code is tested. (Particularly the security of the code should be asserted)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/detleph/server/pull/25
**Author:** [@stephan418](https://github.com/stephan418)
**Created:** 1/2/2022
**Status:** ✅ Merged
**Merged:** 1/3/2022
**Merged by:** [@stephan418](https://github.com/stephan418)
**Base:** `dev` ← **Head:** `feature-user-auth`
---
### 📝 Commits (10+)
- [`eb70a14`](https://github.com/detleph/server/commit/eb70a14c6125e9d67123952d6166f020410b9362) Add routes for admin authentication endpoints
- [`59f4d53`](https://github.com/detleph/server/commit/59f4d53af5ba2c08714bba7282ff8648cf90960c) Add a controller for getting all admin user details
- [`913e0ee`](https://github.com/detleph/server/commit/913e0ee0e05b4d4e7d5fdffe41926062980939e2) Remove event <-> admin association and introduce a default value for revision
- [`b82a843`](https://github.com/detleph/server/commit/b82a84322b2fced9d5a70811942e1d97b7436c2c) Extract code for error messages for better reusability
- [`b57315d`](https://github.com/detleph/server/commit/b57315d916c647f46de3545a1116c9fda428eba2) Add controller for adding a user
- [`9b2c8b1`](https://github.com/detleph/server/commit/9b2c8b17c61acbd2510146961b80c375b702910a) Add router for the /admin endpoint
- [`3363039`](https://github.com/detleph/server/commit/3363039f79bb63087fc2a07afe87df65d13bc0d6) Add code that ensures that an (admin) user is always present
- [`97fee47`](https://github.com/detleph/server/commit/97fee47c6e27eefd900e4eacf9f87c9bc5dfacfb) Allow for groups to be specified when POSTing /api/admins
- [`bfca7e8`](https://github.com/detleph/server/commit/bfca7e8672adaba09f091efc1e44fa44872652d3) Add the permission_level 'ELEVATED' to the default user
- [`5b02905`](https://github.com/detleph/server/commit/5b02905d7169a0a1b272fadf22aa178d084f4dbe) Add a controller and router to update a user's password
### 📊 Changes
**8 files changed** (+303 additions, -16 deletions)
<details>
<summary>View changed files</summary>
📝 `prisma/schema.prisma` (+3 -7)
➕ `src/Controllers/admin.controller.ts` (+234 -0)
📝 `src/Controllers/admin_auth.controller.ts` (+4 -8)
➕ `src/Controllers/common.ts` (+20 -0)
📝 `src/Middleware/auth/auth.ts` (+1 -1)
➕ `src/Routes/admin.routes.ts` (+14 -0)
➕ `src/Routes/admin_auth.routes.ts` (+8 -0)
📝 `src/app.ts` (+19 -0)
</details>
### 📄 Description
This branch introduces the features of login and logout, user creation, user reading, and password updating.
However, users can currently not be updated (eg. changing of groups); I still think it would be a good idea to merge this.
Quickly reading through the code would be appreciated as there might be some issues - even tough the code is tested. (Particularly the security of the code should be asserted)
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/detleph/server/pull/25
Author: @stephan418
Created: 1/2/2022
Status: ✅ Merged
Merged: 1/3/2022
Merged by: @stephan418
Base:
dev← Head:feature-user-auth📝 Commits (10+)
eb70a14Add routes for admin authentication endpoints59f4d53Add a controller for getting all admin user details913e0eeRemove event <-> admin association and introduce a default value for revisionb82a843Extract code for error messages for better reusabilityb57315dAdd controller for adding a user9b2c8b1Add router for the /admin endpoint3363039Add code that ensures that an (admin) user is always present97fee47Allow for groups to be specified when POSTing /api/adminsbfca7e8Add the permission_level 'ELEVATED' to the default user5b02905Add a controller and router to update a user's password📊 Changes
8 files changed (+303 additions, -16 deletions)
View changed files
📝
prisma/schema.prisma(+3 -7)➕
src/Controllers/admin.controller.ts(+234 -0)📝
src/Controllers/admin_auth.controller.ts(+4 -8)➕
src/Controllers/common.ts(+20 -0)📝
src/Middleware/auth/auth.ts(+1 -1)➕
src/Routes/admin.routes.ts(+14 -0)➕
src/Routes/admin_auth.routes.ts(+8 -0)📝
src/app.ts(+19 -0)📄 Description
This branch introduces the features of login and logout, user creation, user reading, and password updating.
However, users can currently not be updated (eg. changing of groups); I still think it would be a good idea to merge this.
Quickly reading through the code would be appreciated as there might be some issues - even tough the code is tested. (Particularly the security of the code should be asserted)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.