-
Notifications
You must be signed in to change notification settings - Fork 77
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
7 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# GPP Integration POC | ||
|
||
This is a POC to establish the viability of running a JS script to interact with the IAB GPP JS library, and call this Javascript script from a Python function. | ||
|
||
## Running the POC | ||
|
||
Run the fides backend as usual: `nox -s dev -- shell`. | ||
|
||
In the fides container, go to the `gpp-js-integration-poc` folder: `cd gpp-js-integration-poc`. | ||
|
||
Run the python script: `python gpp-helpers.py` . |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import subprocess | ||
|
||
from fides.api.db.base import * | ||
from fides.api.models.privacy_experience import PrivacyExperience | ||
from fides.api.api.deps import get_db_contextmanager as get_db | ||
|
||
|
||
def run_gpp_poc(): | ||
print("RUNNING NODE POC...") | ||
|
||
with get_db() as db: | ||
privacy_experience = db.query(PrivacyExperience).first() | ||
print("PRIVACY EXPERIENCE: ", privacy_experience) | ||
|
||
result = subprocess.run(["npm", "run", "poc"], stdout=subprocess.PIPE) | ||
print("NODE POC FINISHED: ", result) | ||
print("STDOUT: ", result.stdout) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_gpp_poc() |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { GppModel } = require('@iabgpp/cmpapi'); | ||
|
||
/** CMP ID assigned to us by the IAB */ | ||
const ETHYCA_CMP_ID = 407; | ||
|
||
const testCallCmpApi = () => { | ||
// const cmpApi = new CmpApi(ETHYCA_CMP_ID, 1); | ||
console.log("TEST"); | ||
const model = new GppModel(); | ||
console.log("model", model); | ||
|
||
} | ||
|
||
module.exports = { | ||
testCallCmpApi | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "gpp-poc", | ||
"private": true, | ||
"type": "commonjs", | ||
"scripts": { | ||
"poc": "node -e 'require(\"./gpp-poc.js\").testCallCmpApi()'", | ||
"poc2": "node gpp-poc.js" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "22.10.7" | ||
}, | ||
"dependencies": { | ||
"@iabgpp/cmpapi": "^3.1.4", | ||
"@iabgpp/stub": "^3.1.5" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |