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

Add audit backend #1886

Merged
merged 42 commits into from
Aug 13, 2024
Merged

Add audit backend #1886

merged 42 commits into from
Aug 13, 2024

Commits on Mar 6, 2024

  1. Add AuditRecord model

    waxlamp committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    5b92f2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5ad7856 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    31472ee View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    eccedd9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c50290b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fdb49a5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1ad599d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7f0fc96 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2c9c6b3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    01f1b85 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    52ff47e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    08b26c6 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. Configuration menu
    Copy the full SHA
    5134ef7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7f21061 View commit details
    Browse the repository at this point in the history
  3. Use the user fixture directly

    waxlamp committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    38d1a29 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    50d80e6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    90c8bc8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6e204c5 View commit details
    Browse the repository at this point in the history
  7. Remove Dandiset add_owner() and remove_owner() methods

    This came up during development of the audit functionality. It turns out
    that add_owner() was only called during Dandiset creation to add the
    creating user as the only owner, and remove_owner() is never called.
    Instead, in the method that changes the owner set, assign_perm() is used
    in all cases to add and remove owners as needed. Since no other point of
    use exists for adding/removing users, it makes sense to remove these
    methods.
    waxlamp committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    f772fc5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0337f41 View commit details
    Browse the repository at this point in the history
  9. Report live metadata to audit records

    Retrieving the metadata fresh from the model enables two things:
    1. To report all "computed" metadata values that are derived from the
       supplied metadata.
    2. To enable a changed `name` field on the Dandiset model to be properly
       reported via the metadata.
    waxlamp committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    751d8b5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6c125bd View commit details
    Browse the repository at this point in the history
  11. Suppress ruff warnings for complexity and number of arguments

    The `add_asset_to_version()` service function represents essential
    complexity in the actual domain. We may be able to simplify it by
    refactoring the function into smaller parts, but we will look into that
    independently.
    waxlamp committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    fcd288c View commit details
    Browse the repository at this point in the history
  12. Reformat long line

    waxlamp committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    cbff890 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Use the user fixture directly

    waxlamp committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    a6489b6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e120f86 View commit details
    Browse the repository at this point in the history
  3. Eliminate the need for manually calling .save()

    Now that the audit records are generated within service functions, it
    makes less sense to leak the detail of an AuditRecord instance coming
    from the function that must then be saved to the database--the service
    itself can just take care of this.
    waxlamp committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    6e4c2bb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2c2ce5d View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. Remove references to deleted model fields

    The `blob`/`embargoed_blob` distinction was removed in the embargo
    redesign.
    waxlamp committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    c5380de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9501e03 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9fa7b41 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Add tests

    waxlamp committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    222a15f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3483e50 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4a33a6b View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Configuration menu
    Copy the full SHA
    b5ad8b2 View commit details
    Browse the repository at this point in the history
  2. Use nested transaction to handle integrity error

    The notes in the "avoid catching exceptions" callout here
    (https://docs.djangoproject.com/en/5.0/topics/db/transactions/#controlling-transactions-explicitly)
    say to do something like this to isolate error handling without stepping
    on the operation of the transactions themselves.
    waxlamp committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    7e04c83 View commit details
    Browse the repository at this point in the history
  3. Add explanatory comment

    Co-authored-by: Jacob Nesbitt <[email protected]>
    waxlamp and jjnesbitt authored Aug 8, 2024
    Configuration menu
    Copy the full SHA
    1a0faf7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cee70a5 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Configuration menu
    Copy the full SHA
    9a2a2b2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8af0957 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a225f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    84b37bc View commit details
    Browse the repository at this point in the history