Skip to content

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

refactor: deprecate masking type (#7801)

h3n4l5cd57f2e2ba3
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index d57dfc065f..241ebccf7a 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -349,13 +349,11 @@ func (s *SQLService) doExport(ctx context.Context, request *v1pb.ExportRequest,
start := time.Now().UnixNano()
result, err := driver.QueryConn(ctx, conn, request.Statement, &db.QueryContext{
- Limit: int(request.Limit),
- ReadOnly: true,
- CurrentDatabase: request.ConnectionDatabase,
- // TODO(rebelice): we cannot deal with multi-SensitiveDataMaskType now. Fix it.
- SensitiveDataMaskType: db.SensitiveDataMaskTypeDefault,
- SensitiveSchemaInfo: sensitiveSchemaInfo,
- EnableSensitive: s.licenseService.IsFeatureEnabledForInstance(api.FeatureSensitiveData, instance) == nil,
+ Limit: int(request.Limit),
+ ReadOnly: true,
+ CurrentDatabase: request.ConnectionDatabase,
+ SensitiveSchemaInfo: sensitiveSchemaInfo,
+ EnableSensitive: s.licenseService.IsFeatureEnabledForInstance(api.FeatureSensitiveData, instance) == nil,
})
durationNs := time.Now().UnixNano() - start
if err != nil {
@@ -1082,13 +1080,11 @@ func (s *SQLService) doQuery(ctx context.Context, request *v1pb.QueryRequest, in
start := time.Now().UnixNano()
results, err := driver.QueryConn(ctx, conn, request.Statement, &db.QueryContext{
- Limit: int(request.Limit),
- ReadOnly: true,
- CurrentDatabase: request.ConnectionDatabase,
- // TODO(rebelice): we cannot deal with multi-SensitiveDataMaskType now. Fix it.
- SensitiveDataMaskType: db.SensitiveDataMaskTypeDefault,
- SensitiveSchemaInfo: sensitiveSchemaInfo,
- EnableSensitive: s.licenseService.IsFeatureEnabledForInstance(api.FeatureSensitiveData, instance) == nil,
+ Limit: int(request.Limit),
+ ReadOnly: true,
+ CurrentDatabase: request.ConnectionDatabase,
+ SensitiveSchemaInfo: sensitiveSchemaInfo,
+ EnableSensitive: s.licenseService.IsFeatureEnabledForInstance(api.FeatureSensitiveData, instance) == nil,
})
select {
case <-ctx.Done():
diff --git a/backend/plugin/db/driver.go b/backend/plugin/db/driver.go
index 82120db2a7..18b7b34692 100644
--- a/backend/plugin/db/driver.go
+++ b/backend/plugin/db/driver.go
@@ -459,10 +459,9 @@ type ConnectionContext struct {
// QueryContext is the context to query.
type QueryContext struct {
// Limit is the maximum row count returned. No limit enforced if limit <= 0
- Limit int
- ReadOnly bool
- SensitiveDataMaskType SensitiveDataMaskType
- SensitiveSchemaInfo *SensitiveSchemaInfo
+ Limit int
+ ReadOnly bool
+ SensitiveSchemaInfo *SensitiveSchemaInfo
// EnableSensitive will set to be true if the database instance has license.
EnableSensitive bool
@@ -617,15 +616,6 @@ func FormatParamNameInNumberedPosition(paramNames []string) string {
return fmt.Sprintf("WHERE %s ", strings.Join(parts, " AND "))
}
-// SensitiveDataMaskType is the mask type for sensitive data.
-type SensitiveDataMaskType string
-
-const (
- // SensitiveDataMaskTypeDefault is the sensitive data type to hide data with a default method.
- // The default method is subject to change.
- SensitiveDataMaskTypeDefault SensitiveDataMaskType = "DEFAULT"
-)
-
// SensitiveSchemaInfo is the schema info using to extract sensitive fields.
type SensitiveSchemaInfo struct {
// IgnoreCaseSensitive is the flag to ignore case sensitive.