Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactoring UserIdentity logics #1097

Draft
wants to merge 174 commits into
base: syw-UID2-4159-token-gen-code-renaming
Choose a base branch
from

Conversation

sunnywu
Copy link
Contributor

@sunnywu sunnywu commented Oct 16, 2024

  1. Read changes here first
  2. Removed the UserIdentity's refreshedAt field as that's redundant and currently set to the same value as the AdvertisingTokenInput/RefreshTokenInput#createdAt timestamp.
  3. Renamed some token variable names to adTokenInput and refreshTokenInput to make it clearer
  4. Removed privacyBits and establishedAt from UserIdentity/HashedDiidentity/RawUidIdentity but only kept inside FirstLevelHashIdentity - these fields are only relevant when a first level hash is generated for token generation and then passed along into ad token/refresh token generation logic.
  5. As a result, privacyBits and establishedAt are generated from either a. in a brand new token generation call (by default should be 1 and the timestamp at the time of the call) b. or, during token refresh logic, these fields will be inherited from previous refresh token.
  6. RefreshTokenInput, AdvertisingTokenInput and IdentityRequest will now require to store privacyBits and establishedAt itself as a compromise.
  7. generateIdentity will now take in a privacyBits param.
  8. Updated a lot of codes as a result (more refinement required such as not hardcoding the "1, Instant.now()" in a lot of places)
  9. Created verifyFirstLevelHashIdentityAndEstablishedAt method for verifying FirstLevelHashIdentity and added more checks for FirstLevel and check the correctness of raw Uid/First level hash in various unit tests
  10. Added PrivacyBitsTest/IdentityResponseTest/RawUidResponseTest classes and added some extra check for firstLevelHash in existing tests
  11. Replace privacy bits type to PrivacyBits class instance

Ian-Nara and others added 30 commits October 4, 2024 12:58
…ugh-config' into ian-UID2-4235-enclave-debug-through-config
…ugh-config' into ian-UID2-4235-enclave-debug-through-config
…ugh-config' into ian-UID2-4235-enclave-debug-through-config
Release Workflow and others added 28 commits November 18, 2024 02:58
…echLab/uid2-operator into cbc-UID2-4461-upgrade-vertx-version
* Remove siteIdsUsingV4Tokens

* Remove site_ids_using_v4_tokens

* Remove v4 variable

* Remove test case which generate v2 token

* Set advertising_token_v4_percentage to be 100

* Remove siteId param
* Remove `advertising_token_v4_percentage` env var

* Always return advertising token v4 in tests

* Return token version v4 for EUID as well

* Remove duplicated code

* Remove PRNG

* Remove advertising_token_v3
…3df09ad1cc8e840

[CI Pipeline] Released Patch version: 5.42.17
Mainly renaming RefreshTokenRequest/RefreshResponse to
TokenRefreshRequest/TokenRefreshResponse
Refine response logging, client error, invalid http origin, and invalid app name responses are logged at info level
* Xuy UI d2 2578 Update share uid2 lib to 8.0.9, which added site name into metrics
…98db5cf400de8d7

[CI Pipeline] Released Minor version: 5.43.0
…entityMapRequestItem

- Renamed IUIDOperatorService.mapHashedDiiIdentity to mapHashedDii
… FirstLevelHash/HashedDii/RawUid

2. Removed the abstract class UserIdentity
3. fixed a unit test as removing UserIdentity broke it
2. In InputUtil, renamed Identity* member variable/methods to Dii* to indicate it's Dii
3. Change TokenUtils class getIdentityHash to getDiiHash and same for getDiiHashString
…orm-buffer-bytes

Increase max form buffer
…me identityV3Enabled to rawUidV3Enabled (#1190)

* Use correct raw UID version for UID2's UIDOperatorVerticleTest 
* renamed the variable/method useIdentityV3/identityV3Enabled to useRawUidV3/rawUidV3Enabled to be up to date with latest terminlogies
* Improved TokenEncodingTest#testAdvertisingTokenEncodings to tests all combo's of raw UID and ad token versions
@sunnywu sunnywu force-pushed the syw-UID2-4159-token-gen-code-refactoring-UserIdentity branch from 78a70d4 to a8f0915 Compare December 10, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.