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 masking strategy override to FidesMeta #23

Merged
merged 7 commits into from
Nov 11, 2024
Merged

Conversation

Linker44
Copy link

@Linker44 Linker44 commented Oct 31, 2024

Closes #

Description Of Changes

Add new field called masking_strategy_override to FidesMeta

Code Changes

  • Added FieldMaskingOverride class
  • edited Field class to have a masking_strategy_override attribute

Steps to Confirm

  • list any manual steps taken to confirm the changes

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation Updated
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md

@Linker44 Linker44 self-assigned this Oct 31, 2024
@Linker44 Linker44 marked this pull request as draft October 31, 2024 20:13
@Linker44 Linker44 requested a review from galvana November 1, 2024 18:00
@Linker44 Linker44 changed the title add masking_strategy_override to FidesMeta Add masking_strategy_override to FidesMeta Nov 1, 2024
@Linker44 Linker44 changed the title Add masking_strategy_override to FidesMeta Add masking strategy verride to FidesMeta Nov 1, 2024
@Linker44 Linker44 changed the title Add masking strategy verride to FidesMeta Add masking strategy override to FidesMeta Nov 1, 2024
@Linker44 Linker44 marked this pull request as ready for review November 4, 2024 02:06
"""Overrides field-level masking strategies."""

strategy: str
configuration: Dict
Copy link

Choose a reason for hiding this comment

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

nit: I'd make this optional so that configuration-less overrides can be done with just the strategy name.

Copy link
Author

Choose a reason for hiding this comment

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

Good idea!

Copy link
Author

@Linker44 Linker44 Nov 5, 2024

Choose a reason for hiding this comment

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

since setting is as an Optional will make mypy implicitly interpret it as Dict[Any, Any] which is incompatible with our strategy configuration definition in fides that is Dict[str, Any] (it also wont accept Optional[]). i had to explicitly set it as Optional[Dict[str, Any]] and since pydantic BaseModel doesnt like Any types i had to type ignore. also setting is as Optional[] forces me to type ignore inside fides too because the strategy class states that configuration is not an optional field.

i guess this poses the question, Is it worth to do so?

@Linker44 Linker44 requested a review from NevilleS November 4, 2024 20:47
@Linker44 Linker44 requested a review from a team November 7, 2024 19:08
@Linker44 Linker44 merged commit 3a18406 into main Nov 11, 2024
37 checks passed
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