Skip to content

Commit 19703a2

Browse files
Found a bug in sample and encryption
1 parent 137ddba commit 19703a2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/sample_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ def _usage():
3434
# Not required for DSPs, but for those using UID2 sharing functionality this shows how to encrypt a raw UID2 into
3535
# a new advertising token.
3636
# IdentityScope could be UID2 or EUID
37-
new_ad_token = encrypt(ad_token, IdentityScope.UID2, decrypt_result.uid2)
37+
new_ad_token = encrypt(decrypt_result.uid2, IdentityScope.UID2, keys)
3838
print('New Ad Token =', new_ad_token)

uid2_client/encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def encrypt(uid2, identity_scope, keys, keyset_id=None, **kwargs):
219219
master_key = keys.get_by_keyset_key(keys.get_master_keyset_id(), now)
220220

221221
token_expiry = now + dt.timedelta(days=30) if keys.get_token_expiry_seconds() is None \
222-
else now + dt.timedelta(seconds=keys.get_token_expiry_seconds())
222+
else now + dt.timedelta(seconds=int(keys.get_token_expiry_seconds()))
223223

224224
site_id = keys.get_caller_site_id()
225225
if site_id is None:

0 commit comments

Comments
 (0)