Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware for User/Project modification methods #32

Open
3 of 7 tasks
tmthecoder opened this issue Feb 6, 2024 · 0 comments · May be fixed by #67
Open
3 of 7 tasks

Middleware for User/Project modification methods #32

tmthecoder opened this issue Feb 6, 2024 · 0 comments · May be fixed by #67
Assignees

Comments

@tmthecoder
Copy link
Contributor

tmthecoder commented Feb 6, 2024

Create Middleware to guard user type changing and user creating

Context

We need to guard the endpoints that allow for user type-changing and creation as well as project creation

Requirements & Criteria

  • Middleware is added to the createUser, setUserType, and createProject methods in the api-gateway
  • This middleware checks the X-User-Email and X-User-Password headers to validate that the caller is a user with type superadmin. If not, the middleware fill fail and return a 401 response
  • Use the authenticate method within the auth-service to validate a user (Depends on Add user authentication functionality #31 to be able to use the authenticate method)
    • This method will fail if the user credentials are invalid or return the user information if valid.

Testing

  • Please ensure there are tests written for the following cases (at a minimum):
    • Calling each endpoint with no headers
    • Calling each endpoint with only one of the two headers
    • Calling each endpoint with both headers and invalid credentials
    • Calling each endpoint with valid credentials
@tmthecoder tmthecoder changed the title Middleware for user type-changing & creation endpoints Middleware for User modification methods Feb 6, 2024
@tmthecoder tmthecoder changed the title Middleware for User modification methods Middleware for User/Project modification methods Feb 6, 2024
@UZ9 UZ9 linked a pull request Mar 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants