Skip to content

Identity Map V3 #83

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Identity Map V3 #83

wants to merge 10 commits into from

Conversation

aulme
Copy link

@aulme aulme commented Jun 3, 2025

No description provided.

@aulme aulme requested a review from jon8787 June 5, 2025 06:17
IdentityMapV3Response.MappedIdentity mappedIdentity = identityMapResponse.getMappedIdentities().get(dii);
assertNotNull(mappedIdentity);
assertFalse(mappedIdentity.getCurrentUid().isEmpty());
assertTrue(mappedIdentity.getRefreshFromSeconds() > Instant.now().minusSeconds(24 * 60 * 60).getEpochSecond());
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, why do we return seconds rather than a timestamp?
or rather, why is it getRefreshFromSeconds rather than getRefreshFromTimestampUtc or similar?

Copy link
Author

@aulme aulme Jun 6, 2025

Choose a reason for hiding this comment

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

You mean make it an ISO string? We've had an unfortunate IM recently where clients tried to parse ISO strings with string parsing.
I've changed it to Instant, that would be the most idiomatic and least ambiguous.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm curious, why did you think I meant a string?

Copy link
Author

Choose a reason for hiding this comment

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

We're already returning an epoch timestamp so you don't mean that, then it sounds like an ISO timestamp. Did you mean Instant? In any case, already changed it to that.

Copy link
Contributor

@jon8787 jon8787 Jun 10, 2025

Choose a reason for hiding this comment

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

Thanks, returning Instant is better

return currentUid;
}

public String getPreviousUid() {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add tests for this as well?

getPreviousRawUid ?

Copy link
Author

@aulme aulme Jun 6, 2025

Choose a reason for hiding this comment

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

Rename - sure.
Re test - it's hard to assert anything about it. Those are integration tests, so they run against real operators and data. We can't even assert whether there is a previous UID or it is null, because previous UID disappears 90 days after rotation.
On the other hand, if this would be a unit test, we would be just testing a getter.
I will try to cover this in E2E tests where we can check that at least some responses have previousRawUid.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, why are previous UIDs no longer available after 90 days?


Response response = new Response(identityMapInput);

response.assertUnmapped("INVALID", "this is not a hashed email");
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, why have the errors changed to CAPS and a single word?

Copy link
Author

@aulme aulme Jun 6, 2025

Choose a reason for hiding this comment

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

That's the code we return from the APIs. I don't know why we've changed the codes from the previous version. Perhaps @gmsdelmundo has some context one he's back next week. I didn't realize it was not always like that.
I guess this makes it look more like an error code and less like an end-user message.

Copy link
Contributor

Choose a reason for hiding this comment

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

So this means error handling is no longer a drop-in replacement? Especially concerned about optout - if we change this to caps we will break someone.

Copy link
Author

Choose a reason for hiding this comment

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

Good point, but a discussion on the API side, not in SDK - here we just return whatever APIs return.
We'll consider changing this in API.

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