Closed Stchena closed 1 year ago
Hi @entechlog , wanted to reach out to you regarding the pull request and ask if there's a chance for a review sometime soon 😉
Hello @Stchena , Apologies for the delay. I have busy with some end of Q1 effort at work. I am looking into this one today and will keep you posted
61 Conditional Masking Policy
Description
dbt-snow-mask
currently supports only simple, static rules based just on the meta-masked column and user's role. The introduction of conditional masking policies can add a lot of flexibility to thedbt-snow-mask
tool. Users will be able to define masking policies that are more specific and nuanced than what is currently possible with static rules. This can make the tool more powerful and easier to use in complex data environments.Moreover, this change is non-breaking - existing policies do not need to change. The
create_masking_policy_*
call's parameterization is dependent on whethermp_conditional_columns
was set in.yml
or not:How it works & How to use
If you want to use a Conditional Masking Policy for your column, provide an additional
meta
parameter calledmp_conditional_columns
. It needs to contain a list of columns to use for conditions.get_meta_objects
macro picks up and passes this list to theALTER
statements when applying the masking policies (duringapply_masking_policy
macro execution. If conditional columns are specified, the conditional masking policy's DDL also needs to contain the actual name of the masked column instead ofval
.Example DDLs
Conditional Masking Policy DDL:
Standard, non-conditional Masking Policy DDL
Extra
Closes: #61