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

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

Open
Tracked by #769
tylerthome opened this issue Jun 11, 2020 · 8 comments
Open
Tracked by #769
Labels
Complexity: Large Issue requires some research and solution is only loosely defined. draft Feature: Architecture p-Feature: IAM Identity Access Management points: 3 Can be done in 13-18 hours Role: Back End

Comments

@tylerthome
Copy link
Member

tylerthome commented Jun 11, 2020

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:

  • Guest Questions (and associated response types/values)
  • Host Questions (and associated response types/values)
  • Guest Details
  • Host Details
  • Guest Responses
  • Host Responses
  • Restrictions
  • Matches

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

  • User Types
    • Guest
      • READ ONLY
        • Guest Questions
        • Match Results for current user
        • Host Details (for matched hosts only)
      • READ/WRITE
        • Guest Response Values
        • Guest Details
    • Host
      • READ ONLY
        • Host Questions
        • Match Results for current user
        • Guest Details (for matched guests only)
      • READ/WRITE
        • Host Response Values for current user
        • Host Details for current user
    • Case Worker / Org Employee (or "admin")
      • READ ONLY
        • Match Results for assigned Guests
        • Host Details
        • Host Questions and Responses
      • READ/WRITE
        • Match Results for assigned Guests (to manipulate status values for manual business processes)
    • Organization Administrator (or "super admin")
      • READ ONLY
        • Host and Guest Details
        • Host and Guest Responses
      • READ/WRITE
        • Host and Guest Questions (and associated response types/values)
        • Match Results (status)
        • (proposed) Permissions of Case Workers / Org Employees to access system resources
@tylerthome tylerthome self-assigned this Jun 11, 2020
@tylerthome tylerthome added this to the Host Registration milestone Jul 25, 2020
@abbyhipp abbyhipp modified the milestones: Host Registration, MVP Sep 2, 2020
@abbyhipp abbyhipp added p-Feature: IAM Identity Access Management and removed Feature: Architecture labels Sep 5, 2020
@tylerthome tylerthome added points: 3 Can be done in 13-18 hours and removed points: missing labels Aug 31, 2021
@kpoints kpoints assigned kpoints and unassigned tylerthome Feb 9, 2022
@JRHutson
Copy link
Member

Please provide update

  1. Progress
  2. Blocker
  3. Availability
  4. ETA

@JRHutson
Copy link
Member

Need to complete user flows before defining.

@rossbb rossbb self-assigned this Sep 14, 2022
@randelbrot
Copy link
Member

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

@tylerthome tylerthome changed the title Complete implementation of scopes and roles for user types in Auth0 Complete implementation of scopes and roles for user types in AWS Cognito Jan 18, 2023
@Joshua-Douglas
Copy link
Member

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
Copy link
Collaborator

erikguntner commented Aug 16, 2023

@Joshua-Douglas here's a link to discussion regarding this topic from a little while ago in case it's any help:
#535

@Joshua-Douglas
Copy link
Member

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 tylerthome assigned Joshua-Douglas and unassigned rossbb Apr 9, 2024
@tylerthome
Copy link
Member Author

tylerthome commented Apr 9, 2024

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
Copy link
Member

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Large Issue requires some research and solution is only loosely defined. draft Feature: Architecture p-Feature: IAM Identity Access Management points: 3 Can be done in 13-18 hours Role: Back End
Projects
Status: New Issue Approval
Development

No branches or pull requests