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 873 commits into
base: syw-UID2-4159-token-gen-code-renaming
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
873 commits
Select commit Hold shift + click to select a range
0eaa890
Merge pull request #1716 from IABTechLab/aul-UID2-5338-upgrade-shared
aulme Apr 30, 2025
ba54957
[CI Pipeline] Released patch version: 5.50.102
May 1, 2025
ed600d3
updated eclipse-temurin to 21.0.7_6-jre-alpine-3.21
sophia-chen-ttd May 1, 2025
277b522
Merge pull request #1719 from IABTechLab/sch-UID2-5409-vulnerability-…
sophia-chen-ttd May 1, 2025
74976bb
[CI Pipeline] Released Patch version: 5.50.104
May 1, 2025
7bf56ac
ignore SIGTERM
Ian-Nara May 1, 2025
2c6dee6
update comments
Ian-Nara May 1, 2025
619860c
updating eclipse-temurin to 21.0.7_6-jre-alpine-3.21
sophia-chen-ttd May 1, 2025
3b7c39a
Merge pull request #1722 from IABTechLab/sch-UID2-5409-vulnerability-…
sophia-chen-ttd May 2, 2025
9acd2b3
[CI Pipeline] Released patch version: 5.50.106
May 2, 2025
984fc90
PodTerminationMonitor
Ian-Nara May 2, 2025
a19d116
update ms value
Ian-Nara May 2, 2025
ccce565
fix typo
Ian-Nara May 2, 2025
ca649c5
add imports
Ian-Nara May 2, 2025
0b2c7f4
[CI Pipeline] Released Snapshot version: 5.50.105-alpha-183-SNAPSHOT
May 2, 2025
f2d0da4
Update pom.xml
Ian-Nara May 2, 2025
8e84d47
remove sigterm handler
Ian-Nara May 2, 2025
b0cdf09
Merge branch 'ian-UID2-5118-ignore-sigterm-signal' of github.com:IABT…
Ian-Nara May 2, 2025
84504d6
remove unused imports
Ian-Nara May 2, 2025
9b4c107
undo whitespace change
Ian-Nara May 2, 2025
18f3bfb
[CI Pipeline] Released Snapshot version: 5.50.105-alpha-184-SNAPSHOT
May 2, 2025
1ea6faa
whitespace change
Ian-Nara May 2, 2025
f2ce648
Update pom.xml
Ian-Nara May 2, 2025
3fc9292
Merge pull request #1721 from IABTechLab/ian-UID2-5118-ignore-sigterm…
Ian-Nara May 2, 2025
75a0907
[CI Pipeline] Released Minor version: 5.51.0
May 2, 2025
dfeaf7c
[CI Pipeline] Released patch version: 5.51.1
May 3, 2025
9250e4a
[CI Pipeline] Released patch version: 5.51.2
May 4, 2025
faa11e5
[CI Pipeline] Released patch version: 5.51.3
May 5, 2025
6e36c0b
update dockerfile to include directoy for prestop hook (#1732)
Ian-Nara May 5, 2025
f5ff3a6
[CI Pipeline] Released Patch version: 5.51.5
May 5, 2025
e68f685
Merge pull request #1733 from IABTechLab/ci-6e36c0b0fbb5500b99ce281ec…
github-actions[bot] May 5, 2025
4cd0e22
[CI Pipeline] Released patch version: 5.51.7
May 6, 2025
99d445e
[CI Pipeline] Released patch version: 5.51.8
May 7, 2025
91a0444
[CI Pipeline] Released patch version: 5.51.9
May 8, 2025
6ff9faa
Added logfmt for log level, class and thread
gmsdelmundo May 8, 2025
f4aac49
Added stacktrace logging
gmsdelmundo May 8, 2025
e521110
Added logfmt for log level, class and thread for GCP and Azure
gmsdelmundo May 8, 2025
37d10dc
Updated casing
gmsdelmundo May 8, 2025
6c20297
Fixed thread logfmt
gmsdelmundo May 8, 2025
a44d787
[CI Pipeline] Released patch version: 5.51.10
May 9, 2025
540327f
[CI Pipeline] Released patch version: 5.51.11
May 10, 2025
57dca99
[CI Pipeline] Released patch version: 5.51.12
May 11, 2025
8eff35b
[CI Pipeline] Released patch version: 5.51.13
May 12, 2025
45cfd41
Merge pull request #1737 from IABTechLab/gdm-UID2-5079-logfmt
gmsdelmundo May 12, 2025
4fadc5e
[CI Pipeline] Released Patch version: 5.51.16
May 12, 2025
940fbb3
[CI Pipeline] Released patch version: 5.51.17
May 13, 2025
d30abc3
[CI Pipeline] Released patch version: 5.51.18
May 14, 2025
5a94fad
[CI Pipeline] Released patch version: 5.51.19
May 15, 2025
5503e14
preliminary implementation of v3 identity map
sophia-chen-ttd May 15, 2025
b894db0
Added RoutingContextUtil
gmsdelmundo May 15, 2025
fe08437
Fixed util test dir and cleaned up DomainNameCheckUtilTest
gmsdelmundo May 15, 2025
93d14a5
Added path to uid2.client_sdk_versions metric
gmsdelmundo May 15, 2025
cfc33ad
Added API contact tracking for SDK usage
gmsdelmundo May 15, 2025
d2ca791
Fixed site ID/API contact logic for SDK usage metric
gmsdelmundo May 15, 2025
285d0d6
Fixed site ID/API contact logic for SDK usage metric
gmsdelmundo May 15, 2025
1d03143
Fixed null handling for SDK usage metric
gmsdelmundo May 15, 2025
863307d
[CI Pipeline] Released patch version: 5.51.20
May 16, 2025
2ae6ee8
[CI Pipeline] Released patch version: 5.51.21
May 17, 2025
9a53c02
[CI Pipeline] Released patch version: 5.51.22
May 18, 2025
578d2c0
[CI Pipeline] Released patch version: 5.51.23
May 19, 2025
2cade91
implementing mixed input for identity map v3
sophia-chen-ttd May 19, 2025
76785ec
Merge pull request #1746 from IABTechLab/gdm-client-version-metric
gmsdelmundo May 19, 2025
6abb232
[CI Pipeline] Released Patch version: 5.51.28
May 19, 2025
0bb734d
added unit tests for mapped identity
sophia-chen-ttd May 19, 2025
cc068a8
v3 identity map logic
sophia-chen-ttd May 19, 2025
eceae2a
added previous id and refresh from fields
sophia-chen-ttd May 19, 2025
e1d1c88
added tests for identity map refresh from and previous id
sophia-chen-ttd May 19, 2025
f2339e1
added refresh from tests
sophia-chen-ttd May 19, 2025
a029797
cleanup
sophia-chen-ttd May 19, 2025
19248a3
parsing in multiple field input for v3 identity map
sophia-chen-ttd May 19, 2025
29f5692
cleanup
sophia-chen-ttd May 19, 2025
6e6584c
clean up
sophia-chen-ttd May 19, 2025
95fa116
[CI Pipeline] Released patch version: 5.51.29
May 20, 2025
71bb66e
input parsing error handling
sophia-chen-ttd May 20, 2025
48c5fcf
renaming variables
sophia-chen-ttd May 20, 2025
ae35c64
cleanup
sophia-chen-ttd May 20, 2025
abd3766
Merge remote-tracking branch 'origin/main' into sch-UID2-5484-v3-iden…
sophia-chen-ttd May 20, 2025
cfe7116
Merge branch 'sch-UID2-5484-v3-identity-map-operator-logic' into sch-…
sophia-chen-ttd May 20, 2025
cf79bd3
more testing for v3 identity map api
sophia-chen-ttd May 20, 2025
edc388c
tested edge cases with previous salts
sophia-chen-ttd May 20, 2025
c626c14
Merge branch 'sch-UID2-5484-v3-identity-map-operator-logic' into sch-…
sophia-chen-ttd May 20, 2025
5c0e378
cleaned up tests for v3 identity map
sophia-chen-ttd May 20, 2025
0e37b0f
small cleanup
sophia-chen-ttd May 20, 2025
73cafab
removed sdk metrics for v3
sophia-chen-ttd May 20, 2025
0a21c45
fixed request input format for v3 identity map tests
sophia-chen-ttd May 20, 2025
771b03d
better error handling for v3 identity map
sophia-chen-ttd May 20, 2025
43fc8b9
Removing vulnerable package
aulme May 20, 2025
3065ea7
Upgrading Werzeug due to CVE-2024-49767
aulme May 20, 2025
c973ac0
[CI Pipeline] Released patch version: 5.51.30
May 21, 2025
a589392
[CI Pipeline] Released Snapshot version: 5.51.30-alpha-186-SNAPSHOT
May 21, 2025
848ce17
Merge branch 'main' into aul-UID2-5532-remove-vulnerable-package
aulme May 21, 2025
839850b
Merge pull request #1755 from IABTechLab/aul-UID2-5532-remove-vulnera…
aulme May 21, 2025
881a1ec
[CI Pipeline] Released Patch version: 5.51.35
May 21, 2025
68a98d3
[CI Pipeline] Released Patch version: 5.51.36
May 21, 2025
b6660e5
Merge pull request #1759 from IABTechLab/ci-881a1ec5ce149dd9f3d1099d3…
github-actions[bot] May 21, 2025
7efad0a
[CI Pipeline] Released Patch version: 5.51.38
May 21, 2025
3e8c40b
[CI Pipeline] Released patch version: 5.51.39
May 22, 2025
b892be5
added identity map v3 object mapper to parse request
sophia-chen-ttd May 22, 2025
68e0aed
cleaned up code
sophia-chen-ttd May 23, 2025
2f62162
removed unused imports and functions
sophia-chen-ttd May 23, 2025
d1b5ce2
[CI Pipeline] Released patch version: 5.51.40
May 23, 2025
9207916
used primitive array
sophia-chen-ttd May 23, 2025
3803f77
Metrics for component failures
aulme May 23, 2025
149ded4
Merge pull request #1766 from IABTechLab/aul-UID2-5555-metrics-for-co…
aulme May 23, 2025
3c1732b
[CI Pipeline] Released Patch version: 5.51.43
May 23, 2025
d4a5aef
Merge pull request #1767 from IABTechLab/ci-149ded4919fafb16f7c62fd46…
github-actions[bot] May 23, 2025
910fd64
added classcastexception catch to v3identitymap
sophia-chen-ttd May 23, 2025
6c28ea2
minor cleanup
sophia-chen-ttd May 23, 2025
1d85e53
[CI Pipeline] Released patch version: 5.51.45
May 24, 2025
df8a84a
[CI Pipeline] Released patch version: 5.51.46
May 25, 2025
d844383
[CI Pipeline] Released patch version: 5.51.47
May 26, 2025
438aa47
[CI Pipeline] Released patch version: 5.51.48
May 27, 2025
35202de
added identity map response type enum
sophia-chen-ttd May 27, 2025
4b7c61a
[CI Pipeline] Released patch version: 5.51.49
May 28, 2025
13f749d
updated shared version
sophia-chen-ttd May 28, 2025
a4b2156
[CI Pipeline] Released patch version: 5.51.50
May 29, 2025
36d4524
added v3 version to tests
sophia-chen-ttd May 29, 2025
5e3a04f
Merge branch 'main' into sch-UID2-5484-v3-identity-map-operator-logic
sophia-chen-ttd May 29, 2025
d74ff65
fixed merge conflicts
sophia-chen-ttd May 29, 2025
85a2180
[CI Pipeline] Released Snapshot version: 5.51.51-alpha-305-SNAPSHOT
May 29, 2025
fdb2ef7
Merge pull request #1752 from IABTechLab/sch-UID2-5484-v3-identity-ma…
sophia-chen-ttd May 29, 2025
8453c2c
Merge pull request #1754 from IABTechLab/sch-UID2-5484-v3-identity-ma…
sophia-chen-ttd May 29, 2025
e261000
[CI Pipeline] Released Minor version: 5.52.0
May 29, 2025
e0e6282
[CI Pipeline] Released patch version: 5.52.1
May 30, 2025
935d0cf
[CI Pipeline] Released patch version: 5.52.2
May 31, 2025
e34dc22
[CI Pipeline] Released patch version: 5.52.3
Jun 1, 2025
8bc04aa
[CI Pipeline] Released patch version: 5.52.4
Jun 2, 2025
329c55c
[CI Pipeline] Released patch version: 5.52.5
Jun 3, 2025
0f354c1
[CI Pipeline] Released patch version: 5.52.6
Jun 4, 2025
a054786
Add service instance ID and UID trace ID to core and opt out requests
vishalegbert-ttd Jun 4, 2025
5c86fa1
Fix build and tests
vishalegbert-ttd Jun 4, 2025
76aef5e
[CI Pipeline] Released patch version: 5.52.7
Jun 5, 2025
2bd257d
Rename
vishalegbert-ttd Jun 5, 2025
693175f
Rename
vishalegbert-ttd Jun 5, 2025
f78e064
Test trace ID and instance ID, refactor headers in tests
vishalegbert-ttd Jun 5, 2025
e487059
Update local configs, send instance ID on attest
vishalegbert-ttd Jun 5, 2025
c76d412
[CI Pipeline] Released patch version: 5.52.8
Jun 6, 2025
52d7f7d
Add instance_id_prefix in AWS, Azure, and GCP (#1786)
abuabraham-ttd Jun 6, 2025
8da3560
[CI Pipeline] Released patch version: 5.52.10
Jun 7, 2025
0057b48
[CI Pipeline] Released patch version: 5.52.11
Jun 8, 2025
3697a19
[CI Pipeline] Released patch version: 5.52.12
Jun 9, 2025
aa6fba2
Update shared
vishalegbert-ttd Jun 9, 2025
f11dac5
Merge pull request #1784 from IABTechLab/vse-UID2-5593-add-service-in…
vishalegbert-ttd Jun 9, 2025
cc8955a
[CI Pipeline] Released Minor version: 5.53.0
Jun 9, 2025
f5d512d
[CI Pipeline] Released Patch version: 5.53.1
Jun 9, 2025
b0f2e91
Update entrypoint.sh (#1799)
abuabraham-ttd Jun 9, 2025
37a329d
[CI Pipeline] Released Patch version: 5.53.3
Jun 9, 2025
a31d2b8
[CI Pipeline] Released patch version: 5.53.4
Jun 10, 2025
31897b0
Update snapshot consuming after migrating to maven central portal (#1…
caroline-ttd Jun 10, 2025
070f089
[CI Pipeline] Released patch version: 5.53.6
Jun 11, 2025
951dd97
[CI Pipeline] Released patch version: 5.53.7
Jun 12, 2025
bea38c8
sch-UID2-5557 adding binary payloads to v2 and v3 endpoints
sophia-chen-ttd Jun 12, 2025
3bb9782
[CI Pipeline] Released Minor version: 5.54.0
Jun 12, 2025
a379cda
Unwrap DII string in V3 Identity Map inputs
aulme Jun 12, 2025
438ba4b
Using the same error statuses for Identity Map as in V2 to make migra…
aulme Jun 12, 2025
f6a5ffc
Merge pull request #1814 from IABTechLab/aul-UID2-5485-adjust-v3-api
aulme Jun 12, 2025
4aebbc7
[CI Pipeline] Released Minor version: 5.55.0
Jun 12, 2025
7b92b7c
[CI Pipeline] Released patch version: 5.55.1
Jun 13, 2025
7dd544d
[CI Pipeline] Released patch version: 5.55.2
Jun 14, 2025
556aa05
[CI Pipeline] Released patch version: 5.55.3
Jun 15, 2025
d1b77da
[CI Pipeline] Released patch version: 5.55.4
Jun 16, 2025
25438e8
Update shared (#1820)
abuabraham-ttd Jun 16, 2025
4cac635
[CI Pipeline] Released Patch version: 5.55.6
Jun 16, 2025
b434071
Merge pull request #1821 from IABTechLab/ci-25438e89a493f0477f293d545…
github-actions[bot] Jun 16, 2025
f32da28
[CI Pipeline] Released patch version: 5.55.8
Jun 17, 2025
c02ca7e
[CI Pipeline] Released patch version: 5.55.9
Jun 18, 2025
76f09fb
[CI Pipeline] Released patch version: 5.55.10
Jun 19, 2025
aa3519f
[CI Pipeline] Released patch version: 5.55.11
Jun 20, 2025
ed19040
[CI Pipeline] Released patch version: 5.55.12
Jun 21, 2025
f905c22
[CI Pipeline] Released patch version: 5.55.13
Jun 22, 2025
e9da483
[CI Pipeline] Released patch version: 5.55.14
Jun 23, 2025
f455711
update main file
lizk886 Jun 23, 2025
3320fdd
update error message
lizk886 Jun 23, 2025
fc0becf
[CI Pipeline] Released patch version: 5.55.15
Jun 24, 2025
53fb28c
update metrics naming standards
lizk886 Jun 24, 2025
c0e6ca6
[CI Pipeline] Released patch version: 5.55.16
Jun 25, 2025
42e8cb5
need more attention on CloudSyncOptOutStore.java as the way it build…
lizk886 Jun 25, 2025
bb5687f
udapte metric names in test
lizk886 Jun 25, 2025
69443f6
update test
lizk886 Jun 25, 2025
8e03b55
[CI Pipeline] Released patch version: 5.55.17
Jun 26, 2025
3103a3a
update error message for better debug
lizk886 Jun 26, 2025
594e028
[CI Pipeline] Released patch version: 5.55.18
Jun 27, 2025
2c00f42
[CI Pipeline] Released Snapshot version: 5.55.5-alpha-349-SNAPSHOT
Jun 27, 2025
f69982b
Merge pull request #1830 from IABTechLab/wzh-UID2-5081-replace-print-…
lizk886 Jun 27, 2025
d0b0592
[CI Pipeline] Released Patch version: 5.55.20
Jun 27, 2025
e7cb5f4
[CI Pipeline] Released Patch version: 5.55.21
Jun 27, 2025
0da078b
Merge pull request #1839 from IABTechLab/ci-d0b0592775d1cb4e89b55d5c8…
github-actions[bot] Jun 27, 2025
1075aed
[CI Pipeline] Released patch version: 5.55.23
Jun 28, 2025
13703b6
[CI Pipeline] Released patch version: 5.55.24
Jun 29, 2025
90e6021
[CI Pipeline] Released patch version: 5.55.25
Jun 30, 2025
5a64c94
[CI Pipeline] Released Snapshot version: 5.55.6-alpha-194-SNAPSHOT
Jun 30, 2025
833b96d
Merge branch 'main' into wzh-UID2-5498-update-metrics-name-standard
lizk886 Jun 30, 2025
a902cb7
[CI Pipeline] Released Snapshot version: 5.55.26-alpha-195-SNAPSHOT
Jun 30, 2025
8a21798
[CI Pipeline] Released patch version: 5.55.26
Jul 1, 2025
bd727c3
Merge branch 'main' into wzh-UID2-5498-update-metrics-name-standard
lizk886 Jul 1, 2025
9b2d512
Merge pull request #1834 from IABTechLab/wzh-UID2-5498-update-metrics…
lizk886 Jul 1, 2025
a913307
[CI Pipeline] Released Patch version: 5.55.30
Jul 1, 2025
7eefbca
Merge pull request #1848 from IABTechLab/ci-9b2d512d80a3b8c17406b1a17…
github-actions[bot] Jul 1, 2025
ac0a0a0
check servicelink disabled (#1844)
Ian-Nara Jul 1, 2025
2146db4
[CI Pipeline] Released Minor version: 5.56.0
Jul 1, 2025
35b9df5
[CI Pipeline] Released patch version: 5.56.1
Jul 2, 2025
5179c63
Include prefix in string replaced similar to core_url (#1851)
abuabraham-ttd Jul 2, 2025
3bf6d4f
[CI Pipeline] Released patch version: 5.56.3
Jul 3, 2025
2ca7897
Always use millisecond precision for ISO8601 timestamps in identity/b…
Ian-Nara Jul 3, 2025
af00fd5
[CI Pipeline] Released Patch version: 5.56.5
Jul 3, 2025
4384809
Merge pull request #1855 from IABTechLab/ci-2ca789796a0d06753ec6a8ffc…
github-actions[bot] Jul 3, 2025
61f4e85
Update CFT and uid2-shared-actions version for publishing private ope…
caroline-ttd Jul 3, 2025
c730416
[CI Pipeline] Released patch version: 5.56.8
Jul 4, 2025
ae77892
update scan vulnerability file usage
lizk886 Jul 4, 2025
8e8a407
[CI Pipeline] Released patch version: 5.56.9
Jul 5, 2025
5893b7d
[CI Pipeline] Released patch version: 5.56.10
Jul 6, 2025
b24eac9
[CI Pipeline] Released patch version: 5.56.11
Jul 7, 2025
3967e28
Add a new file for all AMI (#1863)
abuabraham-ttd Jul 7, 2025
7c53a01
[CI Pipeline] Released Patch version: 5.56.13
Jul 7, 2025
a5193c5
revert (#1865)
abuabraham-ttd Jul 7, 2025
1bad557
[CI Pipeline] Released Snapshot version: 5.52.6-alpha-363-SNAPSHOT
Jul 7, 2025
c8606d1
Merge branch 'main' into wzh-5347-vulnerability-scan-refactor
lizk886 Jul 7, 2025
06e002d
Update pom.xml
lizk886 Jul 7, 2025
3b175ce
Merge pull request #1859 from IABTechLab/wzh-5347-vulnerability-scan-…
lizk886 Jul 7, 2025
293c652
[CI Pipeline] Released patch version: 5.56.18
Jul 8, 2025
6a80abe
remove all presences of v1
lizk886 Jul 8, 2025
3aa5732
remove more presences of v1
lizk886 Jul 8, 2025
0b61ec7
remove more presences of v1
lizk886 Jul 8, 2025
0a2f2ee
remove more v0v1 related code
lizk886 Jul 8, 2025
6332142
remove more v0 related function code
lizk886 Jul 8, 2025
4b460e4
remove more v0 related function code
lizk886 Jul 8, 2025
f5845eb
[CI Pipeline] Released patch version: 5.56.19
Jul 9, 2025
8fddc77
more v0v1 related code removed
lizk886 Jul 9, 2025
ba7c470
rename jsonv1 to a better name
lizk886 Jul 9, 2025
5163949
rename createInputListv1
lizk886 Jul 9, 2025
22bf583
test
lizk886 Jul 9, 2025
d9a2c02
Update action.yaml
lizk886 Jul 9, 2025
66ed0fa
[CI Pipeline] Released patch version: 5.56.20
Jul 10, 2025
92f7ec0
Merge pull request #1871 from IABTechLab/wzh-5234-cleanup-v0v1-api-code
lizk886 Jul 10, 2025
cd701c8
[CI Pipeline] Released Patch version: 5.56.30
Jul 10, 2025
1ec1f9e
[CI Pipeline] Released patch version: 5.56.31
Jul 11, 2025
3979ca4
Merge remote-tracking branch 'origin/main' into syw-UID2-4159-token-g…
sunnywu Jul 11, 2025
994096f
[CI Pipeline] Released patch version: 5.56.32
Jul 12, 2025
50474de
[CI Pipeline] Released patch version: 5.56.33
Jul 13, 2025
60f0be3
[CI Pipeline] Released patch version: 5.56.34
Jul 14, 2025
6df4278
[CI Pipeline] Released Patch version: 5.56.35
Jul 14, 2025
9329e23
[CI Pipeline] Released Patch version: 5.56.36
Jul 14, 2025
2eb9c50
Merge pull request #1904 from IABTechLab/ci-6df42784516cc7b59aad92d44…
github-actions[bot] Jul 14, 2025
2b1eb8a
UID2-5407 reduce log entries in private operator (#1878)
caroline-ttd Jul 14, 2025
a52e030
[CI Pipeline] Released patch version: 5.56.39
Jul 15, 2025
a1a354b
UID2-5741 aks cce failure (#1906)
cYKatherine Jul 15, 2025
b0072ab
[CI Pipeline] Released patch version: 5.56.41
Jul 16, 2025
c7af957
[CI Pipeline] Released patch version: 5.56.42
Jul 17, 2025
ddd77eb
Merge remote-tracking branch 'origin/main' into syw-UID2-4159-token-g…
sunnywu Jul 17, 2025
7a26361
[CI Pipeline] Released Snapshot version: 5.56.43-alpha-201-SNAPSHOT
Jul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ public class AdvertisingTokenInput extends VersionedToken {
public final OperatorIdentity operatorIdentity;
public final SourcePublisher sourcePublisher;
public final RawUidIdentity rawUidIdentity;
public final int privacyBits;
public final Instant establishedAt;

public AdvertisingTokenInput(TokenVersion version, Instant createdAt, Instant expiresAt, OperatorIdentity operatorIdentity,
SourcePublisher sourcePublisher, RawUidIdentity rawUidIdentity) {
SourcePublisher sourcePublisher, RawUidIdentity rawUidIdentity, int privacyBits,
Instant establishedAt) {
super(version, createdAt, expiresAt);
this.operatorIdentity = operatorIdentity;
this.sourcePublisher = sourcePublisher;
this.rawUidIdentity = rawUidIdentity;
this.privacyBits = privacyBits;
this.establishedAt = establishedAt;
}
}

22 changes: 22 additions & 0 deletions src/main/java/com/uid2/operator/model/IdentityRequest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
package com.uid2.operator.model;

import com.uid2.operator.model.userIdentity.HashedDiiIdentity;
import com.uid2.operator.util.PrivacyBits;

import java.time.Instant;

public final class IdentityRequest {
public final SourcePublisher sourcePublisher;
public final HashedDiiIdentity hashedDiiIdentity;
public final OptoutCheckPolicy optoutCheckPolicy;

public final int privacyBits;
public final Instant establishedAt;

public IdentityRequest(
SourcePublisher sourcePublisher,
HashedDiiIdentity hashedDiiIdentity,
OptoutCheckPolicy tokenGeneratePolicy,
int privacyBits,
Instant establishedAt)
{
this.sourcePublisher = sourcePublisher;
this.hashedDiiIdentity = hashedDiiIdentity;
this.optoutCheckPolicy = tokenGeneratePolicy;
this.privacyBits = privacyBits;
this.establishedAt = establishedAt;
}

public IdentityRequest(
SourcePublisher sourcePublisher,
HashedDiiIdentity hashedDiiIdentity,
Expand All @@ -15,6 +35,8 @@ public IdentityRequest(
this.sourcePublisher = sourcePublisher;
this.hashedDiiIdentity = hashedDiiIdentity;
this.optoutCheckPolicy = tokenGeneratePolicy;
this.privacyBits = PrivacyBits.DEFAULT_PRIVACY_BIT_VALUE;
this.establishedAt = Instant.now();
}

public boolean shouldCheckOptOut() {
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/uid2/operator/model/IdentityResponse.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.uid2.operator.model;

import com.uid2.shared.model.TokenVersion;
import io.vertx.core.json.JsonObject;

import java.time.Instant;

Expand Down Expand Up @@ -52,4 +53,25 @@ public Instant getRefreshFrom() {
public boolean isOptedOut() {
return advertisingToken == null || advertisingToken.isEmpty();
}

// for v1/v2 token/generate and token/refresh and client/generate (CSTG) endpoints
public JsonObject toJsonV1() {
final JsonObject json = new JsonObject();
json.put("advertising_token", getAdvertisingToken());
json.put("refresh_token", getRefreshToken());
json.put("identity_expires", getIdentityExpires().toEpochMilli());
json.put("refresh_expires", getRefreshExpires().toEpochMilli());
json.put("refresh_from", getRefreshFrom().toEpochMilli());
return json;
}

// for the original/legacy token/generate and token/refresh endpoint
public JsonObject toJsonV0() {
final JsonObject json = new JsonObject();
json.put("advertisement_token", getAdvertisingToken());
json.put("advertising_token", getAdvertisingToken());
json.put("refresh_token", getRefreshToken());

return json;
}
}
6 changes: 5 additions & 1 deletion src/main/java/com/uid2/operator/model/RefreshTokenInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ public class RefreshTokenInput extends VersionedToken {
public final OperatorIdentity operatorIdentity;
public final SourcePublisher sourcePublisher;
public final FirstLevelHashIdentity firstLevelHashIdentity;
// by default, inherited from the previous refresh token's privacy bits
public final int privacyBits;


public RefreshTokenInput(TokenVersion version, Instant createdAt, Instant expiresAt, OperatorIdentity operatorIdentity,
SourcePublisher sourcePublisher, FirstLevelHashIdentity firstLevelHashIdentity) {
SourcePublisher sourcePublisher, FirstLevelHashIdentity firstLevelHashIdentity, int privacyBits) {
super(version, createdAt, expiresAt);
this.operatorIdentity = operatorIdentity;
this.sourcePublisher = sourcePublisher;
this.firstLevelHashIdentity = firstLevelHashIdentity;
this.privacyBits = privacyBits;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
public class FirstLevelHashIdentity extends UserIdentity {
public final byte[] firstLevelHash;

public FirstLevelHashIdentity(IdentityScope identityScope, IdentityType identityType, byte[] firstLevelHash, int privacyBits,
Instant establishedAt, Instant refreshedAt) {
super(identityScope, identityType, privacyBits, establishedAt, refreshedAt);
// for brand new token generation, it should be the time it is generated
// if the first level hash is from token/refresh call, it will be when the raw UID was originally created in the earliest token generation
public final Instant establishedAt;

public FirstLevelHashIdentity(IdentityScope identityScope, IdentityType identityType, byte[] firstLevelHash,
Instant establishedAt) {
super(identityScope, identityType);
this.firstLevelHash = firstLevelHash;
this.establishedAt = establishedAt;
}

public boolean matches(FirstLevelHashIdentity that) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
public class HashedDiiIdentity extends UserIdentity {
public final byte[] hashedDii;

public HashedDiiIdentity(IdentityScope identityScope, IdentityType identityType, byte[] hashedDii, int privacyBits,
Instant establishedAt, Instant refreshedAt) {
super(identityScope, identityType, privacyBits, establishedAt, refreshedAt);
public HashedDiiIdentity(IdentityScope identityScope, IdentityType identityType, byte[] hashedDii) {
super(identityScope, identityType);
this.hashedDii = hashedDii;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
public class RawUidIdentity extends UserIdentity {
public final byte[] rawUid;

public RawUidIdentity(IdentityScope identityScope, IdentityType identityType, byte[] rawUid, int privacyBits,
Instant establishedAt, Instant refreshedAt) {
super(identityScope, identityType, privacyBits, establishedAt, refreshedAt);
public RawUidIdentity(IdentityScope identityScope, IdentityType identityType, byte[] rawUid) {
super(identityScope, identityType);
this.rawUid = rawUid;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ public abstract class UserIdentity {

public final IdentityScope identityScope;
public final IdentityType identityType;
public final int privacyBits;
public final Instant establishedAt;
public final Instant refreshedAt;

public UserIdentity(IdentityScope identityScope, IdentityType identityType, int privacyBits, Instant establishedAt, Instant refreshedAt) {
public UserIdentity(IdentityScope identityScope, IdentityType identityType) {
this.identityScope = identityScope;
this.identityType = identityType;
this.privacyBits = privacyBits;
this.establishedAt = establishedAt;
this.refreshedAt = refreshedAt;
}
}
46 changes: 27 additions & 19 deletions src/main/java/com/uid2/operator/service/EncryptedTokenEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private byte[] encodeIntoAdvertisingTokenV2(AdvertisingTokenInput t, KeysetKey m

Buffer b2 = Buffer.buffer();
b2.appendLong(t.expiresAt.toEpochMilli());
encodeSiteIdentityV2(b2, t.sourcePublisher, t.rawUidIdentity, siteKey);
encodeSiteIdentityV2(b2, t.sourcePublisher, t.rawUidIdentity, siteKey, t.privacyBits, t.establishedAt);

final byte[] encryptedId = AesCbc.encrypt(b2.getBytes(), masterKey).getPayload();

Expand All @@ -53,9 +53,10 @@ private byte[] encodeIntoAdvertisingTokenV2(AdvertisingTokenInput t, KeysetKey m
private byte[] encodeIntoAdvertisingTokenV3(AdvertisingTokenInput t, KeysetKey masterKey, KeysetKey siteKey) {
final Buffer sitePayload = Buffer.buffer(69);
encodePublisherRequesterV3(sitePayload, t.sourcePublisher);
sitePayload.appendInt(t.rawUidIdentity.privacyBits);
sitePayload.appendLong(t.rawUidIdentity.establishedAt.toEpochMilli());
sitePayload.appendLong(t.rawUidIdentity.refreshedAt.toEpochMilli());
sitePayload.appendInt(t.privacyBits);
sitePayload.appendLong(t.establishedAt.toEpochMilli());
// this is the refreshedAt field in the spec - but effectively it is the time this advertising token is generated
sitePayload.appendLong(t.createdAt.toEpochMilli());
sitePayload.appendBytes(t.rawUidIdentity.rawUid); // 32 or 33 bytes

final Buffer masterPayload = Buffer.buffer(130);
Expand Down Expand Up @@ -126,8 +127,9 @@ private RefreshTokenInput decodeRefreshTokenV2(Buffer b) {
TokenVersion.V2, createdAt, validTill,
new OperatorIdentity(0, OperatorType.Service, 0, 0),
new SourcePublisher(siteId, 0, 0),
new FirstLevelHashIdentity(IdentityScope.UID2, IdentityType.Email, identity, privacyBits,
Instant.ofEpochMilli(establishedMillis), null));
new FirstLevelHashIdentity(IdentityScope.UID2, IdentityType.Email, identity,
Instant.ofEpochMilli(establishedMillis)),
privacyBits);
}

private RefreshTokenInput decodeRefreshTokenV3(Buffer b, byte[] bytes) {
Expand Down Expand Up @@ -160,7 +162,8 @@ private RefreshTokenInput decodeRefreshTokenV3(Buffer b, byte[] bytes) {

return new RefreshTokenInput(
TokenVersion.V3, createdAt, expiresAt, operatorIdentity, sourcePublisher,
new FirstLevelHashIdentity(identityScope, identityType, firstLevelHash, privacyBits, establishedAt, null));
new FirstLevelHashIdentity(identityScope, identityType, firstLevelHash, establishedAt),
privacyBits);
}

@Override
Expand Down Expand Up @@ -228,8 +231,9 @@ public AdvertisingTokenInput decodeAdvertisingTokenV2(Buffer b) {
Instant.ofEpochMilli(expiresMillis),
new OperatorIdentity(0, OperatorType.Service, 0, masterKeyId),
new SourcePublisher(siteId, siteKeyId, 0),
new RawUidIdentity(IdentityScope.UID2, IdentityType.Email, rawUid, privacyBits,
Instant.ofEpochMilli(establishedMillis), null)
new RawUidIdentity(IdentityScope.UID2, IdentityType.Email, rawUid),
privacyBits,
Instant.ofEpochMilli(establishedMillis)
);

} catch (Exception e) {
Expand All @@ -252,6 +256,7 @@ public AdvertisingTokenInput decodeAdvertisingTokenV3orV4(Buffer b, byte[] bytes
final SourcePublisher sourcePublisher = decodeSourcePublisherV3(sitePayload, 0);
final int privacyBits = sitePayload.getInt(16);
final Instant establishedAt = Instant.ofEpochMilli(sitePayload.getLong(20));
// refreshedAt is currently not used
final Instant refreshedAt = Instant.ofEpochMilli(sitePayload.getLong(28));
final byte[] rawUid = sitePayload.slice(36, sitePayload.length()).getBytes();
final IdentityScope identityScope = rawUid.length == 32 ? IdentityScope.UID2 : decodeIdentityScopeV3(rawUid[0]);
Expand All @@ -269,7 +274,8 @@ public AdvertisingTokenInput decodeAdvertisingTokenV3orV4(Buffer b, byte[] bytes

return new AdvertisingTokenInput(
tokenVersion, createdAt, expiresAt, operatorIdentity, sourcePublisher,
new RawUidIdentity(identityScope, identityType, rawUid, privacyBits, establishedAt, refreshedAt)
new RawUidIdentity(identityScope, identityType, rawUid),
privacyBits, establishedAt
);
}

Expand Down Expand Up @@ -304,7 +310,8 @@ public byte[] encodeIntoRefreshTokenV2(RefreshTokenInput t, KeysetKey serviceKey
// give an extra minute for clients which are trying to refresh tokens close to or at the refresh expiry timestamp
b.appendLong(t.expiresAt.plusSeconds(60).toEpochMilli());
b.appendInt(serviceKey.getId());
final byte[] encryptedIdentity = encryptIdentityV2(t.sourcePublisher, t.firstLevelHashIdentity, serviceKey);
final byte[] encryptedIdentity = encryptIdentityV2(t.sourcePublisher, t.firstLevelHashIdentity, serviceKey,
t.privacyBits);
b.appendBytes(encryptedIdentity);
return b.getBytes();
}
Expand All @@ -315,7 +322,7 @@ public byte[] encodeIntoRefreshTokenV3(RefreshTokenInput t, KeysetKey serviceKey
refreshPayload.appendLong(t.createdAt.toEpochMilli());
encodeOperatorIdentityV3(refreshPayload, t.operatorIdentity);
encodePublisherRequesterV3(refreshPayload, t.sourcePublisher);
refreshPayload.appendInt(t.firstLevelHashIdentity.privacyBits);
refreshPayload.appendInt(t.privacyBits);
refreshPayload.appendLong(t.firstLevelHashIdentity.establishedAt.toEpochMilli());
refreshPayload.appendByte(encodeIdentityTypeV3(t.firstLevelHashIdentity.identityScope, t.firstLevelHashIdentity.identityType));
refreshPayload.appendBytes(t.firstLevelHashIdentity.firstLevelHash);
Expand All @@ -330,9 +337,9 @@ public byte[] encodeIntoRefreshTokenV3(RefreshTokenInput t, KeysetKey serviceKey
}

private void encodeSiteIdentityV2(Buffer b, SourcePublisher sourcePublisher, RawUidIdentity rawUidIdentity,
KeysetKey siteEncryptionKey) {
KeysetKey siteEncryptionKey, int privacyBits, Instant establishedAt) {
b.appendInt(siteEncryptionKey.getId());
final byte[] encryptedIdentity = encryptIdentityV2(sourcePublisher, rawUidIdentity, siteEncryptionKey);
final byte[] encryptedIdentity = encryptIdentityV2(sourcePublisher, rawUidIdentity, siteEncryptionKey, privacyBits, establishedAt);
b.appendBytes(encryptedIdentity);
}

Expand Down Expand Up @@ -364,15 +371,16 @@ private String generateAdvertisingTokenString(AdvertisingTokenInput advertisingT
return bytesToBase64Token(advertisingTokenBytes, advertisingTokenInput.version);
}

private byte[] encryptIdentityV2(SourcePublisher sourcePublisher, FirstLevelHashIdentity firstLevelHashIdentity, KeysetKey key) {
return encryptIdentityV2(sourcePublisher, firstLevelHashIdentity.firstLevelHash, firstLevelHashIdentity.privacyBits,
private byte[] encryptIdentityV2(SourcePublisher sourcePublisher, FirstLevelHashIdentity firstLevelHashIdentity,
KeysetKey key, int privacyBits) {
return encryptIdentityV2(sourcePublisher, firstLevelHashIdentity.firstLevelHash, privacyBits,
firstLevelHashIdentity.establishedAt, key);
}

private byte[] encryptIdentityV2(SourcePublisher sourcePublisher, RawUidIdentity rawUidIdentity,
KeysetKey key) {
return encryptIdentityV2(sourcePublisher, rawUidIdentity.rawUid, rawUidIdentity.privacyBits,
rawUidIdentity.establishedAt, key);
KeysetKey key, int privacyBits, Instant establishedAt) {
return encryptIdentityV2(sourcePublisher, rawUidIdentity.rawUid, privacyBits,
establishedAt, key);
}


Expand Down
7 changes: 2 additions & 5 deletions src/main/java/com/uid2/operator/service/InputUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,11 @@ public boolean isValid() {
return valid;
}

public HashedDiiIdentity toHashedDiiIdentity(IdentityScope identityScope, int privacyBits, Instant establishedAt) {
public HashedDiiIdentity toHashedDiiIdentity(IdentityScope identityScope) {
return new HashedDiiIdentity(
identityScope,
this.identityType,
getIdentityInput(),
privacyBits,
establishedAt,
establishedAt);
getIdentityInput());
}
}

Expand Down
Loading