Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

acuvity integration: fix guards and return data. #966

Merged
merged 6 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions plugins/acuvity/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,15 @@
"language_values": {
"type": "string",
"enum": [
"eng_Latn",
"zho_Hans",
"spa_Latn",
"ara_Arab",
"por_Latn",
"ind_Latn",
"vie_Latn"
"english",
"chinese",
"spanish",
"french",
"german",
"japanese",
"gibberish"
],
"enumNames": [
"English",
"Chinese (Simplified)",
"Spanish",
"Modern Standard Arabic",
"Portuguese",
"Indonesian",
"Vietnamese"
],
"default": "eng_Latn",
"default": "english",
"description": [
{
"type": "subHeading",
Expand Down
9 changes: 8 additions & 1 deletion plugins/acuvity/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,20 @@ export const handler: PluginHandler = async (
currentResults.forEach((result) => guardResults.add(result));
}

data = result.summary;
let hasPII = guardResults.has(GuardName.PII_DETECTOR);

if (redactionList.length > 0 && hasPII) {
setCurrentContentPart(context, eventType, transformedData, respTextArray);
transformed = true;
}

const scanResult: any = {
guards: guardResults,
transformed: transformed,
transformedData: transformedData,
};
data = scanResult;

// check if only PII/Secrets is enabled with redaction,
// if yes then return the redacted data with verdict = true.
// else verdict = false, as we found other detections.
Expand Down
Loading