Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

add number of masked records into masking endpoint log message #692

Conversation

adamsachs
Copy link
Contributor

@adamsachs adamsachs commented Jun 21, 2022

Purpose

Changes

  • add number of masked records into masking endpoint log message

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #687

@adamsachs adamsachs added the fidesops-plus Identifies work that is needed by the fidesops plus team label Jun 21, 2022
@@ -29,7 +29,9 @@ def mask_value(request: MaskingAPIRequest) -> MaskingAPIResponse:
strategy = MaskingStrategyFactory.get_strategy(
masking_strategy.strategy, masking_strategy.configuration
)
logger.info(f"Starting masking with strategy {masking_strategy.strategy}")
logger.info(
f"Starting masking of {values.__len__()} values with strategy {masking_strategy.strategy}"
Copy link
Contributor

@seanpreston seanpreston Jun 21, 2022

Choose a reason for hiding this comment

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

A couple points:

  • The Python convention here is to use len(values).
  • Are you sure request.values will never be None? UPDATE: looks like it's required in the schema

Copy link
Contributor Author

@adamsachs adamsachs Jun 21, 2022

Choose a reason for hiding this comment

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

updated in ab911da:

  • now use len() convention
  • confirmed that an empty array in request is indeed passed through as an empty list into request model and handled well by backend; confirmed that if user does not provide any values field in the request body then the request is invalid and rejected wholesale before getting to this point in the code. don't think there's any other way for request.values to be None, so chose to keep it like this to be as concise and readable as possible

@seanpreston seanpreston merged commit 8690f79 into main Jun 21, 2022
@seanpreston seanpreston deleted the 687-masking-engine-field-count-and-masking-strategy-for-fidesops-plus-14 branch June 21, 2022 22:08
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* add number of masked records into masking endpoint log message

* update changelog

* update to use proper python convention for list lenght

* tweak log message with optional plural

Co-authored-by: Adam Sachs <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fidesops-plus Identifies work that is needed by the fidesops plus team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Masking Engine] field count and masking strategy for fidesops-plus #14
2 participants