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 4 commits into
base: syw-UID2-4159-token-gen-code-refactoring
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. AdvertisingTokenInput and IdentityRequest will now require to store privacyBits and establishedAt itself as a compromise.
  7. Updated a lot of codes as a result (more refinement required such as not hardcoding the "1, Instant.now()" in a lot of places)

…dentity/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 generation logic.

2. 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.
3. Updated a lot of codes as a result (more refinement required such as
   not hardcoding the "1, Instant.now()" in a lot of places)
@sunnywu sunnywu changed the title 1. Refactoring UserIdentity logics Oct 16, 2024
@sunnywu sunnywu changed the base branch from syw-UID2-4159-token-gen-code-refactoring to syw-UID2-4159-token-gen-code-renaming October 16, 2024 07:56
@sunnywu sunnywu changed the base branch from syw-UID2-4159-token-gen-code-renaming to syw-UID2-4159-token-gen-code-refactoring October 16, 2024 07:56
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.

1 participant