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

BB2-2829 update script for access grants #1147

Merged
merged 8 commits into from
Dec 5, 2023

Conversation

ajshred
Copy link
Contributor

@ajshred ajshred commented Nov 21, 2023

JIRA Ticket:
BB2-2829

What Does This PR Do?

Adding a script to update existing access grants.
13-month type application grants will update to 13 months from the date the script is run.
One time access grants will be deleted by the script.
Research study grants will be ignored.

Also, this changes the save function on an application.
Previously when an application's data access type changed,
it would delete all existing access grants associated.
The update changes this to mirror the script's function.
So it now behaves the same way as the script.

What Should Reviewers Watch For?

If you're reviewing this PR, please check these things, in particular:

  • Create some grants of each type to setup your environment.
  • Run the script and verify the results as listed above.

What Security Implications Does This PR Have?

Submitters should complete the following questionnaire:

  • If the answer to any of the questions below is Yes, then here's a link to the associated Security Impact Assessment (SIA), security checklist, or other similar document in Confluence: N/A.
    • Does this PR add any new software dependencies? No.
    • Does this PR modify or invalidate any of our security controls? No.
    • Does this PR store or transmit data that was not stored or transmitted before? No.
  • If the answer to any of the questions below is Yes, then please add StewGoin as a reviewer, and note that this PR should not be merged unless/until he also approves it.
    • Do you think this PR requires additional review of its security implications for other reasons? No.

Any Migrations?

  • Yes, there are migrations
    • The migrations should be run PRIOR to the code being deployed
    • The migrations should be run AFTER the code is deployed
    • There is a more complicated migration plan (downtime, etc)
  • No migrations

Submitter Checklist

I have gone through and verified that...:

  • This PR is reasonably limited in scope, to help ensure that:
    1. It doesn't unnecessarily tie a bunch of disparate features, fixes, refactorings, etc. together.
    2. There isn't too much of a burden on reviewers.
    3. Any problems it causes have a small "blast radius".
    4. It'll be easier to rollback if that becomes necessary.
  • I have named this PR and its branch such that they'll be automatically be linked to the (most) relevant Jira issue, per: https://confluence.atlassian.com/adminjiracloud/integrating-with-development-tools-776636216.html.
  • This PR includes any required documentation changes, including README updates and changelog / release notes entries.
  • All new and modified code is appropriately commented, such that the what and why of its design would be reasonably clear to engineers, preferably ones unfamiliar with the project.
  • All tech debt and/or shortcomings introduced by this PR are detailed in TODO and/or FIXME comments, which include a JIRA ticket ID for any items that require urgent attention.
  • Reviews are requested from both:
    • At least two other engineers on this project, at least one of whom is a senior engineer or owns the relevant component(s) here.
    • Any relevant engineers on other projects (e.g. BFD, SLS, etc.).
  • Any deviations from the other policies in the DASG Engineering Standards are specifically called out in this PR, above.
    • Please review the standards every few months to ensure you're familiar with them.

apps/dot_ext/models.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dtisza1 dtisza1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajshred Looking good. Still doing some more local testing.

Found one error. Just needing to remove the True param.

apps/dot_ext/models.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sharonfruit sharonfruit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revisions look good to me, with caveat I have not checked out and tried it.

dtisza1
dtisza1 previously requested changes Dec 1, 2023
Copy link
Contributor

@dtisza1 dtisza1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few change requests and suggestion for naming.

For the naming, I was thinking we should change the following log type naming to:
Would change the " " to "_" to better match our other type names.

            "type": "application_data_access_type_change",

Local testing was looking good. Seeing expected grant updates when performing saves in the Admin and using the Django command.

apps/dot_ext/models.py Outdated Show resolved Hide resolved
apps/dot_ext/models.py Outdated Show resolved Hide resolved
apps/dot_ext/models.py Outdated Show resolved Hide resolved
@ajshred ajshred requested a review from dtisza1 December 1, 2023 19:59
@ajshred ajshred dismissed dtisza1’s stale review December 4, 2023 18:28

Changes made.

Copy link
Contributor

@dtisza1 dtisza1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajshred This looks good to me!

Good work on this!

@ajshred ajshred merged commit 16fe342 into master Dec 5, 2023
6 checks passed
@ajshred ajshred deleted the ajones/bb2-2829-update-script-for-access-grants branch December 5, 2023 16:55
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 this pull request may close these issues.

3 participants