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

UID2-3243 token lifetime check fix for token v2 #66

Merged

Conversation

caroline-ttd
Copy link
Contributor

Token lifetime check fix for token v2.

Did Unit tests & integration tests locally.

Copy link
Contributor

@asloobq asloobq left a comment

Choose a reason for hiding this comment

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

some minor comments in tests. Otherwise LGTM

callAndVerifyRefreshJson(identityScope);
public void smokeTestForBidstream(IdentityScope identityScope, TokenVersionForTesting tokenVersion) throws Exception {
Instant now = Instant.now();
String advertisingToken = AdvertisingTokenBuilder.builder().withScope(identityScope).withVersion(tokenVersion).withEstablished(now.minus(120, ChronoUnit.DAYS)).withGenerated(now.plus(-1, ChronoUnit.DAYS)).withExpiry(now.plus(2, ChronoUnit.DAYS)).build();
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: better to say now.minus(1, ChronoUnit.DAYS) instead of now.plus(-1, ChronoUnit.DAYS)

callAndVerifyRefreshJson(identityScope);
public void smokeTestForBidstream(IdentityScope identityScope, TokenVersionForTesting tokenVersion) throws Exception {
Instant now = Instant.now();
String advertisingToken = AdvertisingTokenBuilder.builder().withScope(identityScope).withVersion(tokenVersion).withEstablished(now.minus(120, ChronoUnit.DAYS)).withGenerated(now.plus(-1, ChronoUnit.DAYS)).withExpiry(now.plus(2, ChronoUnit.DAYS)).build();
Copy link
Contributor

Choose a reason for hiding this comment

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

120 days in the past is unrealistic for bidstream tokens. Probably 3 days in the past is normal

Copy link
Contributor

@jon8787 jon8787 Apr 23, 2024

Choose a reason for hiding this comment

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

Not true, we actually get tokens that are generated months ago and are refreshed regularly. That's why we're making this PR. Feel free to add that as a comment if it's not clear though.

Copy link
Contributor

Choose a reason for hiding this comment

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

that's right. I mixed up established and generated

@caroline-ttd caroline-ttd merged commit 8fb7f36 into main Apr 24, 2024
3 checks passed
@caroline-ttd caroline-ttd deleted the ccm-UID2-3243-token-lifetime-check-fix-for-token-v2 branch April 24, 2024 20: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.

3 participants