Skip to content

Commit

Permalink
renamed IUIDOperatorService#mapIdentity to mapHashedDiiIdentity
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnywu committed Nov 4, 2024
1 parent da549b0 commit c6586a5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface IUIDOperatorService {

RefreshResponse refreshIdentity(RefreshTokenInput input);

RawUidResponse mapIdentity(MapRequest request);
RawUidResponse mapHashedDiiIdentity(MapRequest request);

@Deprecated
RawUidResponse map(HashedDiiIdentity hashedDiiIdentity, Instant asOf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public RefreshResponse refreshIdentity(RefreshTokenInput input) {
}

@Override
public RawUidResponse mapIdentity(MapRequest request) {
public RawUidResponse mapHashedDiiIdentity(MapRequest request) {
final FirstLevelHashIdentity firstLevelHashIdentity = getFirstLevelHashIdentity(request.hashedDiiIdentity,
request.asOf);
if (request.shouldCheckOptOut() && getGlobalOptOutResult(firstLevelHashIdentity, false).isOptedOut()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ private JsonObject handleIdentityMapCommon(RoutingContext rc, InputUtil.InputVal
for (int i = 0; i < count; ++i) {
final InputUtil.InputVal input = inputList[i];
if (input != null && input.isValid()) {
final RawUidResponse rawUidResponse = idService.mapIdentity(
final RawUidResponse rawUidResponse = idService.mapHashedDiiIdentity(
new MapRequest(
input.toHashedDiiIdentity(this.identityScope),
OptoutCheckPolicy.respectOptOut(),
Expand Down
24 changes: 12 additions & 12 deletions src/test/java/com/uid2/operator/UIDOperatorServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,15 @@ public void testIdentityMapForOptOutUser(IdentityType type, String identity, Ide
if (scope == IdentityScope.UID2) {
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(false);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(true);
rawUidResponse = uid2Service.mapIdentity(mapRequestForceMap);
rawUidResponse = uid2Service.mapHashedDiiIdentity(mapRequestForceMap);
reset(shutdownHandler);
rawUidResponseShouldBeOptOut = uid2Service.mapIdentity(mapRequestRespectOptOut);
rawUidResponseShouldBeOptOut = uid2Service.mapHashedDiiIdentity(mapRequestRespectOptOut);
} else {
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(false);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(true);
rawUidResponse = euidService.mapIdentity(mapRequestForceMap);
rawUidResponse = euidService.mapHashedDiiIdentity(mapRequestForceMap);
reset(shutdownHandler);
rawUidResponseShouldBeOptOut = euidService.mapIdentity(mapRequestRespectOptOut);
rawUidResponseShouldBeOptOut = euidService.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(false);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(true);
Expand Down Expand Up @@ -471,10 +471,10 @@ void testSpecialIdentityOptOutIdentityMap(TestIdentityInputType type, String id,

final RawUidResponse rawUidResponse;
if(scope == IdentityScope.EUID) {
rawUidResponse = euidService.mapIdentity(mapRequestRespectOptOut);
rawUidResponse = euidService.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
else {
rawUidResponse = uid2Service.mapIdentity(mapRequestRespectOptOut);
rawUidResponse = uid2Service.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(false);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(true);
Expand Down Expand Up @@ -585,10 +585,10 @@ void testSpecialIdentityRefreshOptOutIdentityMap(TestIdentityInputType type, Str

final RawUidResponse rawUidResponse;
if(scope == IdentityScope.EUID) {
rawUidResponse = euidService.mapIdentity(mapRequestRespectOptOut);
rawUidResponse = euidService.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
else {
rawUidResponse = uid2Service.mapIdentity(mapRequestRespectOptOut);
rawUidResponse = uid2Service.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(false);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(true);
Expand Down Expand Up @@ -656,10 +656,10 @@ void testSpecialIdentityValidateIdentityMap(TestIdentityInputType type, String i

final RawUidResponse rawUidResponse;
if(scope == IdentityScope.EUID) {
rawUidResponse = euidService.mapIdentity(mapRequestRespectOptOut);
rawUidResponse = euidService.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
else {
rawUidResponse = uid2Service.mapIdentity(mapRequestRespectOptOut);
rawUidResponse = uid2Service.mapHashedDiiIdentity(mapRequestRespectOptOut);
}
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(false);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(true);
Expand Down Expand Up @@ -775,10 +775,10 @@ void testExpiredSaltsNotifiesShutdownHandler(TestIdentityInputType type, String
final RawUidResponse rawUidResponse;
reset(shutdownHandler);
if(scope == IdentityScope.EUID) {
rawUidResponse = euidService.mapIdentity(mapRequest);
rawUidResponse = euidService.mapHashedDiiIdentity(mapRequest);
}
else {
rawUidResponse = uid2Service.mapIdentity(mapRequest);
rawUidResponse = uid2Service.mapHashedDiiIdentity(mapRequest);
}
verify(shutdownHandler, atLeastOnce()).handleSaltRetrievalResponse(true);
verify(shutdownHandler, never()).handleSaltRetrievalResponse(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public RawUidResponse IdentityMapRawThroughput() {
@Benchmark
@BenchmarkMode(Mode.Throughput)
public RawUidResponse IdentityMapWithOptOutThroughput() {
return uidService.mapIdentity(new MapRequest(hashedDiiIdentities[(idx++) & 65535], OptoutCheckPolicy.RespectOptOut, Instant.now()));
return uidService.mapHashedDiiIdentity(new MapRequest(hashedDiiIdentities[(idx++) & 65535], OptoutCheckPolicy.RespectOptOut, Instant.now()));
}
}

0 comments on commit c6586a5

Please sign in to comment.