mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
feat(athena): support DeleteWorkGroup action (#1213)
* feat(athena): support DeleteWorkGroup action * feat(athena): validate WorkGroup name and block deletion of primary workgroup * fix: validate WorkGroup name pattern in DeleteWorkGroup per AWS constraints --------- Co-authored-by: mansiverma897993 <vmansi756@gmaail.com>
This commit is contained in:
1 parent
2b466bf980
commit
e35d30bc42
2 files changed
+87
No files matched your search
@@ -94,6 +94,16 @@ public class AthenaJsonHandler {
|
||||
String tableName = request.get("TableName").asText();
|
||||
yield Response.ok(Map.of("TableMetadata", athenaService.getTableMetadata(catalog, database, tableName))).build();
|
||||
}
|
||||
case "DeleteWorkGroup" -> {
|
||||
String wg = request.path("WorkGroup").asText(null);
|
||||
if (wg == null || !wg.matches("[a-zA-Z0-9._-]{1,128}")) {
|
||||
throw new AwsException("InvalidRequestException", "WorkGroup is required.", 400);
|
||||
}
|
||||
if ("primary".equals(wg)) {
|
||||
throw new AwsException("InvalidRequestException", "The primary workgroup cannot be deleted.", 400);
|
||||
}
|
||||
yield Response.ok(Map.of()).build();
|
||||
}
|
||||
default -> throw new AwsException("InvalidAction", "Action " + action + " is not supported", 400);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user