Skip to content

Commit 8fddc77

Browse files
committed
more v0v1 related code removed
1 parent 4b460e4 commit 8fddc77

1 file changed

Lines changed: 0 additions & 74 deletions

File tree

src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -603,15 +603,6 @@ public void handleKeysRequestV2(RoutingContext rc) {
603603
}
604604
}
605605

606-
public void handleKeysRequest(RoutingContext rc) {
607-
try {
608-
handleKeysRequestCommon(rc, keys -> sendJsonResponse(rc, keys));
609-
} catch (Exception e) {
610-
LOGGER.error("Unknown error while handling keys request", e);
611-
rc.fail(500);
612-
}
613-
}
614-
615606
public void handleKeysSharing(RoutingContext rc) {
616607
RuntimeConfig config = this.getConfigFromRc(rc);
617608
int sharingTokenExpirySeconds = config.getSharingTokenExpirySeconds();
@@ -1287,33 +1278,6 @@ private Map<String, InputUtil.InputVal[]> processIdentityMapMixedInput(RoutingCo
12871278
return normalizedIdentities;
12881279
}
12891280

1290-
private void handleIdentityMapBatch(RoutingContext rc) {
1291-
try {
1292-
final JsonObject obj = rc.body().asJsonObject();
1293-
final InputUtil.InputVal[] inputList;
1294-
final JsonArray emails = obj.getJsonArray("email");
1295-
final JsonArray emailHashes = obj.getJsonArray("email_hash");
1296-
if (emails == null && emailHashes == null) {
1297-
ResponseUtil.LogInfoAndSend400Response(rc, ERROR_INVALID_INPUT_EMAIL_MISSING);
1298-
return;
1299-
} else if (emails != null && !emails.isEmpty()) {
1300-
if (emailHashes != null && !emailHashes.isEmpty()) {
1301-
ResponseUtil.LogInfoAndSend400Response(rc, ERROR_INVALID_INPUT_EMAIL_TWICE);
1302-
return;
1303-
}
1304-
inputList = createInputList(emails, false);
1305-
} else {
1306-
inputList = createInputList(emailHashes, true);
1307-
}
1308-
1309-
final JsonObject resp = handleIdentityMapCommon(rc, inputList);
1310-
sendJsonResponse(rc, resp);
1311-
} catch (Exception e) {
1312-
LOGGER.error("Unknown error while mapping batched identity", e);
1313-
rc.fail(500);
1314-
}
1315-
}
1316-
13171281
private static String getApiContact(RoutingContext rc) {
13181282
String apiContact;
13191283
try {
@@ -1564,24 +1528,6 @@ private void recordRefreshDurationStats(Integer siteId, String apiContact, Durat
15641528
c.increment();
15651529
}
15661530

1567-
private InputUtil.InputVal[] createInputList(JsonArray a, boolean inputAsHash) {
1568-
if (a == null || a.size() == 0) {
1569-
return new InputUtil.InputVal[0];
1570-
}
1571-
final int size = a.size();
1572-
final InputUtil.InputVal[] resp = new InputUtil.InputVal[size];
1573-
1574-
for (int i = 0; i < size; ++i) {
1575-
if (inputAsHash) {
1576-
resp[i] = InputUtil.normalizeEmailHash(a.getString(i));
1577-
} else {
1578-
resp[i] = InputUtil.normalizeEmail(a.getString(i));
1579-
}
1580-
}
1581-
return resp;
1582-
1583-
}
1584-
15851531
private InputUtil.InputVal[] createInputListV1(JsonArray a, IdentityType identityType, InputUtil.IdentityInputType inputType) {
15861532
if (a == null || a.isEmpty()) {
15871533
return new InputUtil.InputVal[0];
@@ -1673,7 +1619,6 @@ private boolean meetPolicyCheckRequirements(RoutingContext rc) {
16731619
return true;
16741620
}
16751621

1676-
16771622
private Tuple.Tuple2<OptoutCheckPolicy, String> readOptoutCheckPolicy(JsonObject req) {
16781623
if(req.containsKey(OPTOUT_CHECK_POLICY_PARAM)) {
16791624
return new Tuple.Tuple2<>(OptoutCheckPolicy.fromValue(req.getInteger(OPTOUT_CHECK_POLICY_PARAM)), OPTOUT_CHECK_POLICY_PARAM);
@@ -1768,25 +1713,6 @@ private static JsonObject toJson(KeysetKey key) {
17681713
return json;
17691714
}
17701715

1771-
private JsonObject toJson(IdentityTokens t) {
1772-
final JsonObject json = new JsonObject();
1773-
json.put("advertisement_token", t.getAdvertisingToken());
1774-
json.put("advertising_token", t.getAdvertisingToken());
1775-
json.put("refresh_token", t.getRefreshToken());
1776-
1777-
return json;
1778-
}
1779-
1780-
private void sendJsonResponse(RoutingContext rc, JsonObject json) {
1781-
rc.response().putHeader(HttpHeaders.CONTENT_TYPE, HttpMediaType.APPLICATION_JSON.getType())
1782-
.end(json.encode());
1783-
}
1784-
1785-
private void sendJsonResponse(RoutingContext rc, JsonArray json) {
1786-
rc.response().putHeader(HttpHeaders.CONTENT_TYPE, HttpMediaType.APPLICATION_JSON.getType())
1787-
.end(json.encode());
1788-
}
1789-
17901716
private void logInvalidOriginOrAppName(int siteId, String originOrAppName) {
17911717
siteIdToInvalidOriginsAndAppNames.computeIfAbsent(siteId, k -> new HashSet<>())
17921718
.add(originOrAppName);

0 commit comments

Comments
 (0)