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

HaztrakProfile for managing Remote signer access #637

Merged
merged 11 commits into from
Nov 8, 2023

Conversation

dpgraham4401
Copy link
Member

Description

This is a relatively big PR that includes the following...

  1. A new HaztrakProfile ORM model which now serves as the users central profile
  2. A new SitePermissions ORM model which contains the RBAC that a user has to a given haztrak site.

These models take the existing role of the RcraProfile and RcraSitePermissions models. These models where dependent on the user's RCRAInfo profile information. These were implemented before the e-Manifest Remote Signer Policy.

it also implements the following

  1. Renames a number of models for consistency such as RcraSitePermission to RcraSitePermissions, and use the term "RCRAInfo" to indicate that a model or object is from rcrainfo versus a haztrak defined model/object.
  2. restructure the global state of our application to use the new HaztrakProfile and relegate the RcraProfile to a sub-field
  3. initiate the refactor of things like retrieving user data from the server into a service object HtApi which is just an object with a number of functions for doing just that. This starts the work fr refactor client side logic into services #634

Issue ticket number and link

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

The HaztrakProfile will act as the new user base profile, while the RcraProfile is relegated to only storing a user's RCRAInfo user/profile information. This moves us towards a reference implementation for the Remote Signer Policy.

update pre-commit to use ruff formatter and remove black

SitePermission model which represents what role based access a haztrak user has that will dictate what a user is allowed to do
…(HaztrakProfile). We moved the RcraProfile state to a sub object of the user's Profile state

rename rcraProfileSlice to profileSlice, add HaztrakProfile to RcraProfile redux toolkit slice
…crasitepermissions

now a user will only see the tables that the admin has given them access to
…date test suites with new preloaded state that reflects our new global state structure.

adjust structure of the profile slice to use the 'sites' field to store a record of sites a user has access to in Haztrak (instead of just relying on what sites a user has access to in RCRAInfo)
…rakProfile model instance of their RcraProfile
attach admin rcrainfo profile to a haztrak site instead of the user's profile
rename last_sync_date to last_rcrainfo_manifest_sync to be more clear on what is being synced
add properties to haztrak profile to use an admin's rcrainfo profile
rename last_rcra_sync to last_rcrainfo_manifest_sync for clarity
… connected to a user's haztrak profile) versus the old RcraSitePermissions which was dependent on a user's RCRAInfo permissions

rename RcraSitePermission to RcraSitePermissions, add development fixtures, when syncing a user's RCRAInfo profile, it does not create new HaztrakSites (only RcraSites)
convert foreign key to HaztrakSite to RcraSite in the RcraSitePermission (makes sense when you write it our) now we will be implementing the Remote Signer policy into our application so access will be granted by a remote signer (or the Haztrak Admin)
rename 'Site' model to 'HaztrakSite' to distinguish it from the 'RcraSite' model
@github-actions github-actions bot added client Related to front end workings (React/Redux) database changes that require modification to the database schema documentation Improvements or additions to documentation server Related to backend workings (Django/Rest API) test Unit tests are, or need to be, included labels Nov 8, 2023
@dpgraham4401 dpgraham4401 changed the title Remote signer HaztrakProfile for managing Remote signer access Nov 8, 2023
@dpgraham4401 dpgraham4401 merged commit 3ef6bcb into USEPA:main Nov 8, 2023
7 checks passed
@dpgraham4401 dpgraham4401 deleted the remote_signer_site_permissions branch November 8, 2023 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to front end workings (React/Redux) database changes that require modification to the database schema documentation Improvements or additions to documentation server Related to backend workings (Django/Rest API) test Unit tests are, or need to be, included
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant