feat: protect sensitive catalog samples
This commit is contained in:
@@ -89,6 +89,7 @@ export interface CatalogColumn {
|
||||
sourceComment: string | null;
|
||||
description: string | null;
|
||||
generatedDescription: string | null;
|
||||
sensitive: boolean;
|
||||
lastSyncedDatabaseVersion: number | null;
|
||||
lastSyncedAt: string | null;
|
||||
version: number;
|
||||
@@ -96,6 +97,15 @@ export interface CatalogColumn {
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface SensitiveDataSuggestion {
|
||||
columnId: string;
|
||||
sensitive: boolean;
|
||||
}
|
||||
|
||||
export interface SensitiveDataSuggestions {
|
||||
suggestions: SensitiveDataSuggestion[];
|
||||
}
|
||||
|
||||
export interface CatalogRelationshipColumn {
|
||||
position: number;
|
||||
sourceColumnId: string;
|
||||
@@ -341,11 +351,18 @@ export const updateCatalogColumnMetadata = (
|
||||
version: number,
|
||||
description: string | null,
|
||||
generatedDescription: string | null,
|
||||
sensitive?: boolean,
|
||||
) => apiFetch<CatalogColumn>(
|
||||
`/catalog/databases/${encodeURIComponent(databaseId)}/tables/${encodeURIComponent(tableId)}/columns/${encodeURIComponent(columnId)}`,
|
||||
{ method: "PATCH", body: JSON.stringify({ version, description, generatedDescription }) },
|
||||
{ method: "PATCH", body: JSON.stringify({ version, description, generatedDescription, sensitive }) },
|
||||
);
|
||||
|
||||
export const suggestSensitiveFields = (databaseId: string, modelId: string) =>
|
||||
apiFetch<SensitiveDataSuggestions>(
|
||||
`/catalog/databases/${encodeURIComponent(databaseId)}/sensitive-data-suggestions`,
|
||||
{ method: "POST", body: JSON.stringify({ modelId }) },
|
||||
);
|
||||
|
||||
export const listCatalogRelationships = (databaseId: string) =>
|
||||
apiFetch<CatalogRelationship[]>(`/catalog/databases/${encodeURIComponent(databaseId)}/relationships`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user