From 6d0b296b5bc13e37bbc06c9b5a055dfaaffcd01f Mon Sep 17 00:00:00 2001 From: "ian.nara" Date: Wed, 11 Oct 2023 15:30:31 -0600 Subject: [PATCH 1/5] change policy to optout check --- README.md | 2 +- uid2_client/token_generate_input.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0878ad3..144935d 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ print(decrypted_token.uid2) >IMPORTANT: Be sure to call this function only when you have obtained legal basis to convert the user’s [directly identifying information (DII)](https://unifiedid.com/docs/ref-info/glossary-uid#gl-dii) to UID2 tokens for targeted advertising. - >`do_not_generate_tokens_for_opted_out()` applies `policy=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#token-generation-policy) call. Without this, `policy` is omitted to maintain backwards compatibility. + >`do_not_generate_tokens_for_opted_out()` applies `optout_check=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#unencrypted-json-body-parameters) call. Without this, `optout_check` is omitted to maintain backwards compatibility. ### Standard Integration diff --git a/uid2_client/token_generate_input.py b/uid2_client/token_generate_input.py index 8b71edf..06cf366 100644 --- a/uid2_client/token_generate_input.py +++ b/uid2_client/token_generate_input.py @@ -62,7 +62,7 @@ def _create_json_request_for_generate_token(property, value, tc_string, generate if tc_string is not None: json_object["tcf_consent_string"] = tc_string if not generate_for_opted_out: - json_object["policy"] = 1 + json_object["optout_check"] = 1 return json.dumps(json_object) def create_hashed_json_request_for_generate_token(self): From 2a7508b7e290486da1cacfdd051fb06516197a9a Mon Sep 17 00:00:00 2001 From: "ian.nara" Date: Wed, 11 Oct 2023 15:46:02 -0600 Subject: [PATCH 2/5] small fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 144935d..285502b 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ print(decrypted_token.uid2) >IMPORTANT: Be sure to call this function only when you have obtained legal basis to convert the user’s [directly identifying information (DII)](https://unifiedid.com/docs/ref-info/glossary-uid#gl-dii) to UID2 tokens for targeted advertising. - >`do_not_generate_tokens_for_opted_out()` applies `optout_check=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#unencrypted-json-body-parameters) call. Without this, `optout_check` is omitted to maintain backwards compatibility. + >`do_not_generate_tokens_for_opted_out()` applies `optout_check=1` in the [/token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) call. Without this, `optout_check` is omitted to maintain backwards compatibility. ### Standard Integration From 24fcf59922d4526ad49c27efcea763cfda403434 Mon Sep 17 00:00:00 2001 From: "ian.nara" Date: Wed, 11 Oct 2023 16:05:00 -0600 Subject: [PATCH 3/5] update history section --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 285502b..49f1de6 100644 --- a/README.md +++ b/README.md @@ -175,3 +175,6 @@ make example_auto_refresh BASE_URL=https://prod.uidapi.com AUTH_KEY=my-auth-key ### 2.2.0 (07/26/2023) * Added support for /token/generate * Added support for /token/refresh + +### 2.3.0 + * Update from deprecated "policy" parameter to "optout_check" parameter From 72f0de7a8a4fece6626fdbde43f6821743dd0f15 Mon Sep 17 00:00:00 2001 From: "ian.nara" Date: Wed, 11 Oct 2023 16:13:25 -0600 Subject: [PATCH 4/5] update history section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49f1de6..77a405a 100644 --- a/README.md +++ b/README.md @@ -176,5 +176,5 @@ make example_auto_refresh BASE_URL=https://prod.uidapi.com AUTH_KEY=my-auth-key * Added support for /token/generate * Added support for /token/refresh -### 2.3.0 +### 2.3.0 (10/11/2023) * Update from deprecated "policy" parameter to "optout_check" parameter From 9a80329f2626868cc5ed5b0b04f74b069667d019 Mon Sep 17 00:00:00 2001 From: "ian.nara" Date: Mon, 16 Oct 2023 13:57:50 -0600 Subject: [PATCH 5/5] improve test --- tests/test_publisher_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_publisher_client.py b/tests/test_publisher_client.py index d312a6a..b117802 100644 --- a/tests/test_publisher_client.py +++ b/tests/test_publisher_client.py @@ -1,3 +1,4 @@ +import json import os import unittest @@ -56,6 +57,7 @@ def test_integration_optout_generate_token(self): publisher_client = Uid2PublisherClient(self.EUID_BASE_URL, self.EUID_API_KEY, self.EUID_SECRET_KEY) tc_string = "CPhJRpMPhJRpMABAMBFRACBoALAAAEJAAIYgAKwAQAKgArABAAqAAA" input = TokenGenerateInput.from_email("optout@example.com").do_not_generate_tokens_for_opted_out().with_transparency_and_consent_string(tc_string) + self.assertEqual(1, json.loads(input.get_as_json_string())['optout_check']) token_generate_response = publisher_client.generate_token(input) self.assertTrue(token_generate_response.is_optout()) self.assertFalse(token_generate_response.is_success())