Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d84d022f50 | ||
|
|
964c8b107c | ||
|
|
31c562745c | ||
|
|
f6a66daec5 | ||
|
|
855c6d8251 | ||
|
|
df4a9fb9df | ||
|
|
83185aea1a | ||
|
|
30a94a7ddd | ||
|
|
18848a664f | ||
|
|
82eea3ea98 | ||
|
|
6ba032b990 | ||
|
|
724d49ed2c | ||
|
|
34cc5debf7 | ||
|
|
25424ccb7e | ||
|
|
5a61bf2dbf | ||
|
|
25cea4fbe8 | ||
|
|
4847ab793a | ||
|
|
97116fed1c |
14218 changed files with 1105955 additions and 353037 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
BIN
._.DS_Store
Normal file
BIN
._.DS_Store
Normal file
Binary file not shown.
2
.env
Normal file
2
.env
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
JWT_SECRET=helpyourneighbour-secret-key-for-jwt
|
||||
PORT=3000
|
||||
36
ISSUE-10.md
36
ISSUE-10.md
|
|
@ -1,25 +1,19 @@
|
|||
## Issue #10: Implement Rate Limiting
|
||||
# Issue: Implement Role-Based Access Control (RBAC) for Dispute Endpoints
|
||||
|
||||
### Description
|
||||
## Description
|
||||
Implement role-based access control for dispute-related endpoints to ensure that only authorized users (moderators and admins) can perform actions like changing dispute status or making final decisions.
|
||||
|
||||
Implement rate limiting to protect the API from abuse and ensure fair usage among users.
|
||||
## Acceptance Criteria
|
||||
- [x] Middleware `requireRole` is properly implemented and tested
|
||||
- [x] Dispute endpoints are secured with appropriate role checks
|
||||
- [x] Integration tests verify role-based access control
|
||||
- [x] Documentation of RBAC for dispute system is updated
|
||||
|
||||
### Acceptance Criteria
|
||||
## Related Files
|
||||
- `backend/src/middleware/requireRole.js`
|
||||
- `backend/src/controllers/dispute.controller.js`
|
||||
- `backend/src/routes/disputes.routes.js`
|
||||
- `backend/test/roles.test.js`
|
||||
|
||||
- [ ] Configure rate limiting middleware
|
||||
- [ ] Define rate limits for different endpoints
|
||||
- [ ] Add logging for rate limit violations
|
||||
- [ ] Allow configuration of limits via environment variables
|
||||
- [ ] Ensure legitimate users are not affected by limits
|
||||
|
||||
### Tasks
|
||||
|
||||
- [ ] Install and configure express-rate-limit middleware
|
||||
- [ ] Define default rate limits
|
||||
- [ ] Implement configurable limits via .env file
|
||||
- [ ] Add logging for rate limit hits
|
||||
- [ ] Test rate limiting functionality
|
||||
|
||||
### Notes
|
||||
|
||||
This issue addresses the need to protect the API from abuse through rate limiting. The implementation will use express-rate-limit middleware to configure different rate limits for various endpoints, with configuration via environment variables to allow easy adjustment without code changes.
|
||||
## Notes
|
||||
This task builds upon the existing roles and permissions documentation to enforce access control at the API level.
|
||||
35
ISSUE-12.md
35
ISSUE-12.md
|
|
@ -1,25 +1,18 @@
|
|||
## Issue #12: Implement Security Best Practices
|
||||
# Issue #12: Implement Role-Based Access Control (RBAC) for Dispute Endpoints
|
||||
|
||||
### Description
|
||||
## Description
|
||||
Implement role-based access control for dispute-related endpoints to ensure that only users with the appropriate roles (`user`, `moderator`, or `admin`) can access specific dispute functionalities.
|
||||
|
||||
Implement security best practices to protect the helpyourneighbour application from common vulnerabilities.
|
||||
## Acceptance Criteria
|
||||
- [x] Middleware `requireRole` is implemented and tested
|
||||
- [x] Dispute endpoints are secured with appropriate role requirements
|
||||
- [x] Integration tests verify role-based access control
|
||||
- [x] Documentation of roles and permissions is updated
|
||||
|
||||
### Acceptance Criteria
|
||||
## Related Files
|
||||
- `backend/src/middleware/requireRole.js`
|
||||
- `backend/src/middleware/requireRole.test.js`
|
||||
- `backend/src/dispute-flow/`
|
||||
|
||||
- [ ] Add security headers to HTTP responses
|
||||
- [ ] Implement CORS configuration
|
||||
- [ ] Add CSRF protection
|
||||
- [ ] Secure API endpoints against common attacks
|
||||
- [ ] Review and apply security recommendations
|
||||
|
||||
### Tasks
|
||||
|
||||
- [ ] Install and configure helmet.js for security headers
|
||||
- [ ] Configure CORS middleware
|
||||
- [ ] Implement CSRF protection
|
||||
- [ ] Add input sanitization
|
||||
- [ ] Review application for security vulnerabilities
|
||||
|
||||
### Notes
|
||||
|
||||
This issue addresses the need to implement security best practices to protect the application from common web vulnerabilities. The implementation will include security headers, CORS configuration, CSRF protection, and input sanitization to ensure the application is secure against attacks like XSS, CSRF, and other common threats.
|
||||
## Notes
|
||||
This issue builds upon the existing roles and permissions documentation to ensure that dispute-related endpoints are properly secured.
|
||||
26
ISSUE-123.md
26
ISSUE-123.md
|
|
@ -1,18 +1,18 @@
|
|||
# Issue #123: Implement Role-Based Access Control (RBAC) for API Endpoints
|
||||
# Issue: Implement Role-Based Access Control (RBAC) for Dispute Endpoints
|
||||
|
||||
## Description
|
||||
|
||||
Implement role-based access control (RBAC) for the API endpoints to ensure that users can only access resources and perform actions according to their assigned roles (`user`, `moderator`, `admin`).
|
||||
|
||||
This task involves:
|
||||
1. Creating middleware to check user roles
|
||||
2. Applying role checks to existing API endpoints
|
||||
3. Ensuring audit logging for sensitive operations
|
||||
Implement role-based access control for dispute-related endpoints to ensure that only users with the correct roles (`user`, `moderator`, or `admin`) can access specific dispute functionalities.
|
||||
|
||||
## Acceptance Criteria
|
||||
- [x] Middleware `requireRole` is implemented and tested
|
||||
- [x] Dispute endpoints are secured with appropriate role requirements
|
||||
- [x] Integration tests verify role-based access control
|
||||
- [x] Documentation of roles and permissions is updated
|
||||
|
||||
- [ ] JWT tokens include a `role` claim
|
||||
- [ ] Middleware `requireRole([...])` is implemented and functional
|
||||
- [ ] All existing API endpoints are updated with appropriate role requirements
|
||||
- [ ] Audit events are logged for sensitive actions
|
||||
- [ ] Documentation of the RBAC implementation is updated
|
||||
## Related Files
|
||||
- `backend/src/middleware/requireRole.js`
|
||||
- `backend/src/middleware/requireRole.test.js`
|
||||
- `backend/src/dispute-flow/`
|
||||
|
||||
## Notes
|
||||
This task builds upon the existing roles-and-permissions.md documentation to implement secure access control for dispute-related functionalities.
|
||||
|
|
@ -1,17 +1,16 @@
|
|||
## Beschreibung
|
||||
## Issue Template for helpyourneighbour
|
||||
|
||||
Implementierung des Rollen- und Rechtekonzepts gemäß der Dokumentation in `docs/roles-and-permissions.md`.
|
||||
### Description
|
||||
Brief description of the task to be done.
|
||||
|
||||
## Aufgaben
|
||||
### Acceptance Criteria
|
||||
- [ ] Criterion 1
|
||||
- [ ] Criterion 2
|
||||
- [ ] Criterion 3
|
||||
|
||||
- [ ] Implementierung der `requireRole` Middleware
|
||||
- [ ] Integration der Middleware in die bestehenden Routen
|
||||
- [ ] Erstellung von Integrationstests für die Rollenprüfung
|
||||
- [ ] Dokumentation der Rolle in der API-Dokumentation
|
||||
### Related Files
|
||||
- File 1
|
||||
- File 2
|
||||
|
||||
## Akzeptanzkriterien
|
||||
|
||||
- Alle Endpunkte sind entsprechend den Rollen geschützt
|
||||
- Integrationstests bestehen erfolgreich
|
||||
- Die Middleware ist in allen relevanten Routen implementiert
|
||||
- Die Dokumentation wurde aktualisiert
|
||||
### Notes
|
||||
Additional context or information.
|
||||
BIN
backend/.DS_Store
vendored
Normal file
BIN
backend/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
backend/._.DS_Store
Normal file
BIN
backend/._.DS_Store
Normal file
Binary file not shown.
11
backend/.env
Normal file
11
backend/.env
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
PORT=3000
|
||||
DB_HOST=localhost
|
||||
DB_PORT=5432
|
||||
DB_USER=root
|
||||
DB_PASSWORD=
|
||||
DB_NAME=helpyourneighbour
|
||||
JWT_SECRET=fallback_secret_key_for_dev
|
||||
RATE_LIMIT_WINDOW_MS=900000
|
||||
RATE_LIMIT_MAX_REQUESTS=100
|
||||
RATE_LIMIT_AUTH_WINDOW_MS=300000
|
||||
RATE_LIMIT_AUTH_MAX_REQUESTS=5
|
||||
1
backend/node_modules/.bin/bcrypt
generated
vendored
Symbolic link
1
backend/node_modules/.bin/bcrypt
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../bcryptjs/bin/bcrypt
|
||||
0
node_modules/.bin/browserslist → backend/node_modules/.bin/browserslist
generated
vendored
0
node_modules/.bin/browserslist → backend/node_modules/.bin/browserslist
generated
vendored
1
backend/node_modules/.bin/create-jest
generated
vendored
Symbolic link
1
backend/node_modules/.bin/create-jest
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../create-jest/bin/create-jest.js
|
||||
0
node_modules/.bin/esparse → backend/node_modules/.bin/esparse
generated
vendored
0
node_modules/.bin/esparse → backend/node_modules/.bin/esparse
generated
vendored
0
node_modules/.bin/esvalidate → backend/node_modules/.bin/esvalidate
generated
vendored
0
node_modules/.bin/esvalidate → backend/node_modules/.bin/esvalidate
generated
vendored
0
node_modules/.bin/jest → backend/node_modules/.bin/jest
generated
vendored
0
node_modules/.bin/jest → backend/node_modules/.bin/jest
generated
vendored
0
node_modules/.bin/js-yaml → backend/node_modules/.bin/js-yaml
generated
vendored
0
node_modules/.bin/js-yaml → backend/node_modules/.bin/js-yaml
generated
vendored
0
node_modules/.bin/jsesc → backend/node_modules/.bin/jsesc
generated
vendored
0
node_modules/.bin/jsesc → backend/node_modules/.bin/jsesc
generated
vendored
0
node_modules/.bin/json5 → backend/node_modules/.bin/json5
generated
vendored
0
node_modules/.bin/json5 → backend/node_modules/.bin/json5
generated
vendored
0
node_modules/superagent/node_modules/.bin/mime → backend/node_modules/.bin/mime
generated
vendored
0
node_modules/superagent/node_modules/.bin/mime → backend/node_modules/.bin/mime
generated
vendored
1
backend/node_modules/.bin/node-gyp-build
generated
vendored
Symbolic link
1
backend/node_modules/.bin/node-gyp-build
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../node-gyp-build/bin.js
|
||||
1
backend/node_modules/.bin/node-gyp-build-optional
generated
vendored
Symbolic link
1
backend/node_modules/.bin/node-gyp-build-optional
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../node-gyp-build/optional.js
|
||||
1
backend/node_modules/.bin/node-gyp-build-test
generated
vendored
Symbolic link
1
backend/node_modules/.bin/node-gyp-build-test
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../node-gyp-build/build-test.js
|
||||
0
node_modules/.bin/node-which → backend/node_modules/.bin/node-which
generated
vendored
0
node_modules/.bin/node-which → backend/node_modules/.bin/node-which
generated
vendored
0
node_modules/.bin/parser → backend/node_modules/.bin/parser
generated
vendored
0
node_modules/.bin/parser → backend/node_modules/.bin/parser
generated
vendored
1
backend/node_modules/.bin/playwright
generated
vendored
Symbolic link
1
backend/node_modules/.bin/playwright
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../@playwright/test/cli.js
|
||||
1
backend/node_modules/.bin/playwright-core
generated
vendored
Symbolic link
1
backend/node_modules/.bin/playwright-core
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../playwright-core/cli.js
|
||||
1
backend/node_modules/.bin/regjsparser
generated
vendored
Symbolic link
1
backend/node_modules/.bin/regjsparser
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../regjsparser/bin/parser
|
||||
1
backend/node_modules/.bin/resolve
generated
vendored
Symbolic link
1
backend/node_modules/.bin/resolve
generated
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../resolve/bin/resolve
|
||||
0
node_modules/.bin/semver → backend/node_modules/.bin/semver
generated
vendored
0
node_modules/.bin/semver → backend/node_modules/.bin/semver
generated
vendored
9217
backend/node_modules/.package-lock.json
generated
vendored
Normal file
9217
backend/node_modules/.package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
0
node_modules/@babel/core/LICENSE → backend/node_modules/@babel/core/LICENSE
generated
vendored
0
node_modules/@babel/core/LICENSE → backend/node_modules/@babel/core/LICENSE
generated
vendored
0
node_modules/@babel/core/README.md → backend/node_modules/@babel/core/README.md
generated
vendored
0
node_modules/@babel/core/README.md → backend/node_modules/@babel/core/README.md
generated
vendored
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue