-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
134 additions
and
64 deletions.
There are no files selected for viewing
45 changes: 34 additions & 11 deletions
45
components/anonyflow/actions/protect-sensitive-data/protect-sensitive-data.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,49 @@ | ||
import anonyflow from "../../anonyflow.app.mjs"; | ||
import { axios } from "@pipedream/platform"; | ||
import app from "../../anonyflow.app.mjs"; | ||
|
||
export default { | ||
key: "anonyflow-protect-sensitive-data", | ||
name: "Protect Sensitive Data", | ||
description: "Encrypts sensitive data using AnonyFlow encryption service with a unique private key managed by AnonyFlow. [See the documentation](https://anonyflow.com/api)", | ||
version: "0.0.{{ts}}", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
anonyflow, | ||
sensitiveData: { | ||
app, | ||
data: { | ||
propDefinition: [ | ||
anonyflow, | ||
"sensitiveData", | ||
app, | ||
"data", | ||
], | ||
}, | ||
keys: { | ||
propDefinition: [ | ||
app, | ||
"keys", | ||
], | ||
}, | ||
}, | ||
methods: { | ||
anonyPacket(args = {}) { | ||
return this.app.post({ | ||
path: "/anony-packet", | ||
...args, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const encryptedResponse = await this.anonyflow.encryptData({ | ||
sensitiveData: this.sensitiveData, | ||
const { | ||
anonyPacket, | ||
data, | ||
keys, | ||
} = this; | ||
|
||
const response = await anonyPacket({ | ||
$, | ||
data: { | ||
data, | ||
keys, | ||
}, | ||
}); | ||
$.export("$summary", "Sensitive data encrypted successfully"); | ||
return encryptedResponse; | ||
$.export("$summary", `Successfully protected the data with status \`${response.status}\``); | ||
return response; | ||
}, | ||
}; |
44 changes: 33 additions & 11 deletions
44
components/anonyflow/actions/unprotect-sensitive-data/unprotect-sensitive-data.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,49 @@ | ||
import anonyflow from "../../anonyflow.app.mjs"; | ||
import { axios } from "@pipedream/platform"; | ||
import app from "../../anonyflow.app.mjs"; | ||
|
||
export default { | ||
key: "anonyflow-unprotect-sensitive-data", | ||
name: "Unprotect Sensitive Data", | ||
description: "Decrypts protected data using AnonyFlow decryption service with a unique private key, managed by AnonyFlow. [See the documentation](https://anonyflow.com/api)", | ||
version: "0.0.{{ts}}", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
anonyflow, | ||
encryptedData: { | ||
app, | ||
data: { | ||
propDefinition: [ | ||
anonyflow, | ||
"encryptedData", | ||
app, | ||
"data", | ||
], | ||
}, | ||
keys: { | ||
propDefinition: [ | ||
app, | ||
"keys", | ||
], | ||
}, | ||
}, | ||
methods: { | ||
deanonyPacket(args = {}) { | ||
return this.app.post({ | ||
path: "/deanony-packet", | ||
...args, | ||
}); | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.anonyflow.decryptData({ | ||
encryptedData: this.encryptedData, | ||
}); | ||
const { | ||
deanonyPacket, | ||
data, | ||
keys, | ||
} = this; | ||
|
||
$.export("$summary", "Successfully decrypted the data"); | ||
const response = await deanonyPacket({ | ||
$, | ||
data: { | ||
data, | ||
keys, | ||
}, | ||
}); | ||
$.export("$summary", `Successfully unprotected the data with status \`${response.status}\``); | ||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@pipedream/anonyflow", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Pipedream AnonyFlow Components", | ||
"main": "anonyflow.app.mjs", | ||
"keywords": [ | ||
|
@@ -11,5 +11,8 @@ | |
"author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@pipedream/platform": "^1.6.0" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.