Stephan
8384a3eebb
Add controller for roleSchemas (unfinished)
...
+ Refine error messages for role schemas
+ Add role schema routes
+ Add RESULT_SCHEMA DataType
+ Add SchemaError.isSchemaError() type guard
2022-05-01 18:18:48 +02:00
Stephan
72ee918f00
Add schema valiation
...
+ Using zod for validation
+ Add SchemaError
2022-05-01 17:18:55 +02:00
Stephan
2034faa448
Add endpoint to delete disciplines
2022-05-01 16:09:10 +02:00
Stephan
9bafdebd31
Add function to create disciplines
...
+ Fix async errors
+ Extract name error
2022-04-29 10:35:39 +02:00
Stephan
3c8cea8c71
Add routes for getting disciplines
...
+ Throwing an error still crashes the server
2022-04-29 10:35:38 +02:00
Stephan
df9b47dbfd
Add router to delete groups
...
+ Add route to delete organisations
2022-04-29 10:35:31 +02:00
Stephan
6fb09b9f31
HOTFIX: next() only called when in development mode
...
+ Push fix, now the server should be working again
2022-04-29 10:25:13 +02:00
Stephan
51c744de26
Add debugging code
...
+ Small fix in the event controller
+ Add development flag to the dev container
2022-04-28 14:39:16 +02:00
Stephan
09931c78da
Add logger and remove unused code
2022-04-28 14:39:16 +02:00
Stephan
8bf18267d1
Fix: Add winston; And: Add custom error handlers
...
+ addCustomHandler()
+ removeCustomHandler()
2022-04-28 14:39:16 +02:00
Stephan
9ac4fb8efd
Add logger to main
...
+ Remove whitespace
2022-04-28 14:39:16 +02:00
Stephan
9516b60d93
Add logger using winston
...
+ Add formats
+ Add debug and error log files
2022-04-28 14:39:16 +02:00
Stephan
382a42d439
Add basic error handling
...
+ Add express-async-errors package to handle async errors
+ Add ForwaradableError class (Base class for all project-specific errors)
+ Add defaultErrorHandler middleware which handles errors and sends info to the client
2022-04-28 14:39:16 +02:00
Stephan
4a65dd4665
Add authorization
2022-04-28 12:49:05 +02:00
Stephan
6d471eced2
Add function for deleting events
2022-04-28 12:49:05 +02:00
Stephan
2936aa77f1
FIX: Event endpoints are now using the correct format
2022-04-28 12:49:05 +02:00
Stephan
9965acee40
Update name to organisation
2022-04-27 08:34:25 +02:00
Stephan
01077dab22
Change name from oragnisation to organisation
2022-04-27 08:34:25 +02:00
Stephan
bff9dcc5f8
Extract function to create an object by name
...
+ Add route to create groups
2022-04-26 16:04:26 +02:00
Stephan
fe6879ea56
Only show details when authenticated
2022-04-26 16:04:26 +02:00
Stephan
0c65aec96c
Add controller and routes for groups
2022-04-26 16:04:26 +02:00
Stephan
8aa4e5ef16
Improve error handling and simplify code
2022-04-26 16:04:26 +02:00
Stephan
ca11eba3d4
Add better error handling
2022-04-26 16:04:26 +02:00
Stephan
12034fa32a
Add function to update an organisation
...
+ Extract basicOrganisation and detailedOrganiation select types
2022-04-26 16:04:26 +02:00
Stephan
831017e7c2
Add routes for organisations
...
+ FIX: Change eventId type
2022-04-26 16:04:26 +02:00
Stephan
08e18db3c3
Extract common function to handle selecting organisations
2022-04-26 16:04:26 +02:00
Stephan
ab62e39d8e
Add function to create new organisations
...
+ Extract common functions from the admin controller
2022-04-26 16:04:26 +02:00
Stephan
37437152da
Add the organisation controller
...
+ Add function to get all organisation
+ Add function to get a specific organisation
2022-04-26 16:04:26 +02:00
Stephan
dce75d1a97
Port yens dev script to detleph
...
+ Provides more config options
+ Allows deleting and resetting the database
2022-04-26 15:15:22 +02:00
Stephan
d2de4e9208
HOTFIX: Name of uuid function
...
The prisma schema didn't compile with the previous schema
2022-04-23 14:52:23 +02:00
Stephan
d7e7694249
Fix: The server should always return 403 on failed login
2022-04-23 14:01:45 +02:00
Stephan
1be42be4e5
Merge pull request #25 from detleph/feature-user-auth
...
Implement user authentication and admin operations
2022-01-03 14:52:41 +01:00
Stephan
064497a4ca
Refactor the endpoints to share common code
2022-01-02 17:36:21 +01:00
Stephan
08419d581b
Update the admin revision on password change
...
+ Update type of revision to DateTime
2022-01-02 17:26:20 +01:00
Stephan
4d23eccba6
Restructure the process of changing a password
...
+ Requests are now dispatched to the according user ressource, not the collection
+ The current user can be referenced by setting the pid to 'current'
+ Refactored the error logic
2022-01-02 16:49:01 +01:00
Stephan
cc1c394dce
Change the controller for changing passwords to use PIDs and not usernames
2022-01-02 15:46:47 +01:00
Stephan
5b02905d71
Add a controller and router to update a user's password
...
+ Add a function to update the password internally
+ The current interface could be improved (made more RESTful)
2021-12-31 00:11:04 +01:00
Stephan
bfca7e8672
Add the permission_level 'ELEVATED' to the default user
2021-12-29 15:19:23 +01:00
Stephan
97fee47c6e
Allow for groups to be specified when POSTing /api/admins
...
+ Add the admin router to the global app
2021-12-29 15:19:22 +01:00
Stephan
3363039f79
Add code that ensures that an (admin) user is always present
2021-12-29 15:19:21 +01:00
Stephan
9b2c8b17c6
Add router for the /admin endpoint
2021-12-29 15:19:20 +01:00
Stephan
b57315d916
Add controller for adding a user
...
+ Add function to narrow type of string to AdminLevel
2021-12-29 15:19:19 +01:00
Stephan
b82a84322b
Extract code for error messages for better reusability
...
+ Create function for generating permission errors
2021-12-29 15:19:18 +01:00
Stephan
913e0ee0e0
Remove event <-> admin association and introduce a default value for revision
2021-12-29 15:19:17 +01:00
Stephan
59f4d53af5
Add a controller for getting all admin user details
...
+ Requires Authentication
2021-12-29 15:19:16 +01:00
Stephan
eb70a14c61
Add routes for admin authentication endpoints
...
+ Add router to the app
2021-12-29 15:19:10 +01:00
Stephan
584903e55d
FIX: The dev script can now run in any directory
...
Initially, the directory was required to be called 'server'; This is not the case anymore
2021-12-29 15:08:40 +01:00
Stephan
2a5e631d1f
Fix bug where nodemon restarts multiple times
...
- Nodemon was watching the whole file system and not only the /app directory
2021-12-03 10:21:43 +01:00
Stephan
a138bca256
Fix quotes
2021-12-03 10:21:43 +01:00
Stephan
2b061c5f65
Add a docker dev environment that starts a container without building the image
...
+ Add dev.sh script to start the dev environment
+ Add generated flags to the .gitignore file
2021-12-03 10:21:43 +01:00
Stephan
6b6ca57639
Add submodule for email templates
2021-11-30 10:38:51 +01:00
Stephan
278bfcdea8
Merge pull request #18 from detleph/feature-user-auth
...
Add user authentication
2021-11-17 15:45:10 +01:00
Stephan
8f85f062d7
HOTFIX: Add ending slash to copy commands
2021-11-15 08:48:37 +01:00
Stephan
3eb8e8bbbc
Merge pull request #17 from detleph/feature-dockerize
...
Dockerize the server
2021-11-15 08:46:09 +01:00
Stephan
c53e325f06
Change layer order (make caching more effecient)
2021-11-15 08:41:18 +01:00
Stephan
5a62d156ae
Add defaults for some environment variables
...
+ Remove port bindings for the 'postgres' service
2021-11-12 11:55:38 +01:00
Stephan
1cdbddf753
Dockerize the server
...
+ Add Dockerfile
+ Update 'server' docker-compose service
2021-11-12 10:18:13 +01:00
Stephan
6c535b16d1
Bugfix authentication controller
2021-11-11 12:02:48 +01:00
Stephan
4fd8a4c978
Add reference to custom Request typings
2021-11-11 11:57:36 +01:00
Stephan
60f7c8fff5
Export requireAuthentication
2021-11-10 16:12:55 +01:00
Stephan
c869863aea
Add middleware to require authentication on an endpoint
2021-11-10 16:04:26 +01:00
Stephan
1b7a40cf7c
Add the pid to the JWT payload
2021-11-10 15:11:29 +01:00
Stephan
fc78f730bd
Add redis
...
+ Add a public lib file for redis
+ Add an indexed auth client
+ Add a function to create promisified partial clients
+ Add password revisions to the auth redis index
2021-11-10 12:08:07 +01:00
Stephan
5ee5218d5a
Use the description attribute in add and get controllers
2021-11-10 11:31:22 +01:00
Stephan
aec6604d24
Update the code to use the latest database schema
2021-11-10 11:15:51 +01:00
Stephan
a1e56f7494
Merge branch 'dev' into feature-user-auth
2021-11-10 10:45:08 +01:00
Stephan
08e2f9fa2e
Merge branch 'feature-db-schema' into dev
...
+ Extend the admin model
+ more
2021-11-10 10:42:40 +01:00
Stephan
f45f3c7155
Merge branch 'dev' into feature-user-auth
...
+ Added new DB schema
2021-11-10 08:54:57 +01:00
Stephan
e4fab0f5b6
Merge pull request #16 from detleph/feature-db-schema
...
Updating DB-schema
2021-11-10 08:52:42 +01:00
Stephan
bc88ea3fe0
Merge branch 'dev' into feature-user-auth
2021-11-10 08:41:02 +01:00
Stephan
6d062ce1d7
Merge main with fix into dev
2021-11-10 08:38:30 +01:00
Stephan
25cd76313b
Merge pull request #15 from detleph/fix-superagent
...
Fix the error where the code doesn't compile
2021-11-10 08:24:04 +01:00
Stephan
3d961ab53d
Add controller for authenticating with admin name and password
...
+ Add function to create a JWT with the required payload
2021-11-10 08:19:17 +01:00
Stephan
f2e18e1656
Fix the error where the code doesn't compile
...
TypeScript is not used for browser development here, hence it does not know the type XMLHttpRequest (used by SuperAgent)
This is not an ideal solution
2021-11-09 15:40:38 +01:00
Stephan
eff8dd0860
Add the redis server to docker-compose.yml
2021-11-09 12:25:56 +01:00
Stephan and Stefan
d596670f6b
Add mail functionality into the development branch ( #12 )
...
* Added basic code for sending emails
+ Added tests for emails
+ Modified README.md to reflect changes to .env file
* [create-pull-request] push formatted files
* Added dkim
* Fixed mistake in docker-compose.yml
Co-authored-by: Stefan <[email protected] >
2021-11-03 11:01:37 +01:00
Stephan
e816e0beee
Check formatting on the dev branch
...
The dev branch should also enforce correct formatting;
2021-10-19 11:53:53 +02:00
Stephan
9a57610362
Merge pull request #10 from detleph/dev
...
Merge dev branch into main
2021-10-19 07:53:34 +02:00
Stephan
d62ae153b3
Merge pull request #9 from detleph/feature-test
...
Added tests for the event endpoints
2021-10-19 07:51:10 +02:00
Stephan
4b0615ac27
Merge pull request #6 from detleph/create-pull-request/patch
...
Reformat files using prettier
2021-10-15 16:10:45 +02:00
stephan418
c54d9492c8
[create-pull-request] push formatted files
2021-10-15 13:36:56 +00:00
Stephan
d74094970e
Create .prettierignore
2021-10-15 15:36:22 +02:00
Stephan
f1e8ea6671
Add action for format files
2021-10-15 15:28:37 +02:00
Stephan
4d37472726
Create workflow to check formatting
...
The workflow checks whether all the files are formatted correctly (.prettierrc)
2021-10-15 11:40:39 +02:00
Stephan
ee81acea24
Add name to events in the prisma schema
2021-10-15 11:08:42 +02:00
Stephan
5e9fb04632
Add .prettierrc file
...
Should be used in all environments for consistency
2021-10-14 14:44:53 +02:00
Stephan
a46c10018d
Update the main Prisma schema
...
- Added two distinct IDs (A private, serial PK and a public, UUIDv4-based, API ID)
- Added default values
- Applied some basic formatting (Field names, ...)
2021-10-14 13:43:06 +02:00
Stephan
dfcbe130ee
Remove migrations
...
Migrations should not be in the repository
2021-10-11 13:27:38 +02:00
Stephan
62cc1cc122
Ignore Prisma migrations
...
Prisma migration files should not be pushed
2021-10-11 13:26:59 +02:00