Skip to content

Refactoring UserIdentity logics #1097

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

Draft
wants to merge 542 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

@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
@sunnywu sunnywu changed the base branch from syw-UID2-4159-token-gen-code-refactoring to syw-UID2-4159-token-gen-code-renaming October 22, 2024 00:42
@@ -3,6 +3,9 @@

public class PrivacyBits {

// For historical reason this bit is set
public static final int DEFAULT_PRIVACY_BIT_VALUE = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be PrivacyBits instead?

    public static final PrivacyBits DEFAULT = PrivacyBits.fromInt(1);

Copy link
Contributor Author

@sunnywu sunnywu Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed all uses of int PrivacyBits and use PrivacyBits class instead. Added unit tests to test the class

@sunnywu sunnywu force-pushed the syw-UID2-4159-token-gen-code-refactoring-UserIdentity branch from 78a70d4 to a8f0915 Compare December 10, 2024 06:44
BehnamMozafari and others added 23 commits February 3, 2025 16:11
…-application

Runtime config retrieval and application
…b589b79605ca602

[CI Pipeline] Released Minor version: 5.46.0
…f59fa469241a184

[CI Pipeline] Released Minor version: 5.47.0
- retrieve `useDynamicConfig` toggle from correct location in feat-flag.json file
* Update to fix new config errors, change exception name
…ndling

Fail operator start up if ConfigService initialisation fails
- change default to feat flag off
- remove unused const
- add comment for json structure
github-actions bot and others added 30 commits March 26, 2025 05:40
…298854f5e1bdc50

[CI Pipeline] Released Patch version: 5.50.12
Updated run E2E pipeline target description
removing all old sdk tracking code except for version 2
Reverted target_environment description change
- Add error checking.
- Fix path to generate.py.
- Some sed commands should have been on ${INPUT_DIR}/generated.rego.
- Collapse multiple sed commands into one for simpler error checking.
* Re-adding encryption, flag to toggle. 

---- 
Co-authored-by: Release Workflow <[email protected]>
Co-authored-by: Vishal Egbert <[email protected]>
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.