hackforla / HomeUniteUs

We're working with community non-profits who have a Host Home or empty bedrooms initiative to develop a workflow management tool to make the process scalable (across all providers), reduce institutional bias, and effectively capture data.
https://homeunite.us/
GNU General Public License v2.0
39 stars 21 forks source link

Complete implementation of scopes and roles for user types in AWS Cognito #196

Open tylerthome opened 4 years ago

tylerthome commented 4 years ago

Other issues are covering this, but this could be helpful as documentation. Setting as draft until this is turned into an actionable issue. 9/12/24 Ariel Lasry

Overview

Create remaining scopes applicable to each user type within AWS Cognito, and add API route protection in Flask application

Resources/Instructions

Given these resource types:

Create the appropriate scopes in Auth0 and assign appropriate permissions to each role:

JRHutson commented 2 years ago

Please provide update

  1. Progress
  2. Blocker
  3. Availability
  4. ETA
JRHutson commented 2 years ago

Need to complete user flows before defining.

randelbrot commented 1 year ago

Hi @tylerthome, is this issue still in progress? If not, can you move this issue to the appropriate status column? Thanks!

Joshua-Douglas commented 1 year ago

Hey @tylerthome,

I've done some research into role based endpoint access, and I think I can begin putting together a design to achieve this.

Would it be possible to take over this issue? Thanks

erikguntner commented 1 year ago

@Joshua-Douglas here's a link to discussion regarding this topic from a little while ago in case it's any help: https://github.com/hackforla/HomeUniteUs/discussions/535

Joshua-Douglas commented 1 year ago

We can't effectively add role based access until we begin authenticating our endpoints. In order to determine if user has the correct role, you first need to verify their identity. This is what authentication helps us achieve.

We can start this issue after #577

tylerthome commented 6 months ago

Moving this to the dev team, @Joshua-Douglas @erikguntner @paulespinosa completed design and implementation for basic access control and user roles. This sounds like a good issue for someone ready to work with AWS and/or Terraform as we look toward setting up HUU in the incubator

Joshua-Douglas commented 6 months ago

@tylerthome, The user roles PR has been merged. Now each of the endpoints have access to the user's role, and it is easy to implement role-based access control, using naive approaches (e.g. add if user.role != Guest and user.role != Admin: return "invalid user access", 403).

I can add middleware to encapsulate user access role checks, but that'll take some research. I'm planning to focus on #462, but let me know if more work is required on this issue. Thanks!