Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update global masking (#8115)

ecmadaocb08a2dd8859
diff --git a/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue b/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
index b466dfdfa4..b861ccf582 100644
--- a/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
+++ b/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
@@ -2,10 +2,16 @@
<div class="gap-y-4 w-full">
<div class="flex items-stretch gap-x-4 overflow-hidden">
<div class="flex-1 space-y-2 py-4 overflow-x-hidden overflow-y-auto">
- <h3 class="font-medium text-sm text-control">
- {{ $t("custom-approval.security-rule.condition.self") }}
- {{ index }}
- </h3>
+ <input
+ v-model="state.title"
+ class="textfield w-64 ml-0.5"
+ :placeholder="`${t('custom-approval.security-rule.condition.self')} ${
+ props.index
+ }`"
+ type="text"
+ :disabled="readonly || disabled"
+ @input="state.dirty = true"
+ />
<ExprEditor
:expr="state.expr"
:allow-admin="!readonly"
@@ -17,7 +23,7 @@
/>
</div>
<div class="space-y-2 py-4">
- <h3 class="font-medium text-sm text-control">
+ <h3 class="font-medium text-sm text-main py-2">
{{ $t("settings.sensitive-data.masking-level.self") }}
</h3>
<NSelect
@@ -91,6 +97,7 @@ const emit = defineEmits<{
}>();
type LocalState = {
+ title: string;
expr: ConditionGroupExpr;
maskingLevel: MaskingLevel;
dirty: boolean;
@@ -98,6 +105,7 @@ type LocalState = {
const { t } = useI18n();
const state = ref<LocalState>({
+ title: "",
expr: wrapAsGroup(resolveCELExpr(CELExpr.fromJSON({}))),
maskingLevel: MaskingLevel.FULL,
dirty: false,
@@ -133,8 +141,10 @@ const resetLocalState = async () => {
const parsedExpr = await convertCELStringToParsedExpr(
rule.condition?.expression ?? ""
);
+
state.value = {
dirty: false,
+ title: rule.condition?.title ?? "",
maskingLevel: rule.maskingLevel,
expr: wrapAsGroup(resolveCELExpr(parsedExpr.expr ?? CELExpr.fromJSON({}))),
};
@@ -157,6 +167,7 @@ const onConfirm = async () => {
maskingLevel: state.value.maskingLevel,
condition: Expr.fromJSON({
expression,
+ title: state.value.title,
}),
});
state.value.dirty = false;
diff --git a/frontend/src/plugins/cel/types/operator.ts b/frontend/src/plugins/cel/types/operator.ts
index 9ee8247bcb..009b374496 100644
--- a/frontend/src/plugins/cel/types/operator.ts
+++ b/frontend/src/plugins/cel/types/operator.ts
@@ -80,7 +80,7 @@ const OperatorList: Record<Factor, Operator[]> = {
...CollectionOperatorList,
...StringOperatorList,
]),
- classification_level: uniq([...EqualityOperatorList]),
+ classification_level: uniq([...CollectionOperatorList]),
// Database group related fields.
"resource.environment_name": uniq(["_==_"]),