FIX #20252 - Add Auto Classification bot (#20254)

* FIX #20252 - Add Auto Classification bot

* format
This commit is contained in:
Pere Miquel Brull 2025-03-14 15:49:34 +01:00 committed by GitHub
parent 581ab6ce71
commit 4350fed406
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 64 additions and 5 deletions

View File

@ -91,10 +91,6 @@ public class OpenMetadataConnectionBuilder {
String type = IngestionPipelineRepository.getPipelineWorkflowType(ingestionPipeline);
botName = String.format("%sApplicationBot", type);
}
// TODO: Remove this once we internalize the DataInsights app
// For now we need it since DataInsights has its own pipelineType inherited from when it was
// a standalone workflow
case DATA_INSIGHT -> botName = "DataInsightsApplicationBot";
default -> botName =
String.format("%s-bot", ingestionPipeline.getPipelineType().toString().toLowerCase());
}
@ -195,7 +191,8 @@ public class OpenMetadataConnectionBuilder {
private User retrieveBotUser(String botName) {
User botUser = retrieveIngestionBotUser(botName);
if (botUser == null) {
throw new IllegalArgumentException("Please, verify that the ingestion-bot is present.");
throw new IllegalArgumentException(
String.format("Please, verify that the bot [%s] is present.", botName));
}
return botUser;
}

View File

@ -0,0 +1,11 @@
{
"name": "autoClassification-bot",
"displayName": "AutoClassificationBot",
"description": "Bot used for ingesting Sample Data and adding PII classification.",
"fullyQualifiedName": "autoClassification-bot",
"botUser": {
"name" : "autoClassification-bot",
"type" : "user"
},
"provider": "system"
}

View File

@ -0,0 +1,9 @@
{
"name": "autoClassification-bot",
"roles": [
{
"name": "AutoClassificationBotRole",
"type": "role"
}
]
}

View File

@ -0,0 +1,25 @@
{
"name": "AutoClassificationBotPolicy",
"displayName": "AutoClassification Bot Policy",
"fullyQualifiedName": "AutoClassificationBotPolicy",
"description": "Policy for AutoClassification Bot to perform operations on metadata entities.",
"enabled": true,
"allowDelete": false,
"provider": "system",
"rules": [
{
"name": "AutoClassificationBotRule-Allow-Table",
"description" : "Allow adding tags and sample data to the tables",
"resources" : ["Table"],
"operations": ["EditAll", "ViewAll"],
"effect": "allow"
},
{
"name": "AutoClassificationBotRule-ViewAll",
"description" : "Allow viewing all assets",
"resources" : ["All"],
"operations": ["ViewAll"],
"effect": "allow"
}
]
}

View File

@ -0,0 +1,17 @@
{
"name": "AutoClassificationBotRole",
"displayName": "Auto Classification bot role",
"description": "Role corresponding to a Auto Classification bot.",
"allowDelete": false,
"provider": "system",
"policies" : [
{
"type" : "policy",
"name" : "DefaultBotPolicy"
},
{
"type" : "policy",
"name" : "AutoClassificationBotPolicy"
}
]
}