2525import java .time .Clock ;
2626import java .time .Instant ;
2727import java .util .Base64 ;
28- import java .util .List ;
2928
3029public class Operator extends App {
3130 public enum Type {
@@ -263,9 +262,9 @@ public DecryptionResponse v2TokenDecrypt(String token) throws UID2ClientExceptio
263262
264263 // Need to use the manual mapping for error cases - SDK won't allow creating input with bad emails or disable optout check
265264 public JsonNode v2IdentityMap (String payload ) throws Exception {
266- V2Envelope envelope = v2CreateEnvelope (payload , getClientApiSecret () );
267- String encryptedResponse = HttpClient .post (getBaseUrl () + "/v2/identity/map" , envelope .envelope (), getClientApiKey () );
268- return v2DecryptEncryptedResponse (encryptedResponse , envelope .nonce (), getClientApiSecret () );
265+ V2Envelope envelope = v2CreateEnvelope (payload , CLIENT_API_SECRET );
266+ String encryptedResponse = HttpClient .post (getBaseUrl () + "/v2/identity/map" , envelope .envelope (), CLIENT_API_KEY );
267+ return v2DecryptEncryptedResponse (encryptedResponse , envelope .nonce (), CLIENT_API_SECRET );
269268 }
270269
271270 public IdentityMapResponse v2IdentityMap (IdentityMapInput input ) {
@@ -275,9 +274,9 @@ public IdentityMapResponse v2IdentityMap(IdentityMapInput input) {
275274
276275 // Need to use the manual mapping for error cases - SDK won't allow creating input with bad emails
277276 public JsonNode v3IdentityMap (String payload ) throws Exception {
278- V2Envelope envelope = v2CreateEnvelope (payload , getClientApiSecret () );
279- String encryptedResponse = HttpClient .post (getBaseUrl () + "/v3/identity/map" , envelope .envelope (), getClientApiKey () );
280- return v2DecryptEncryptedResponse (encryptedResponse , envelope .nonce (), getClientApiSecret () );
277+ V2Envelope envelope = v2CreateEnvelope (payload , CLIENT_API_SECRET );
278+ String encryptedResponse = HttpClient .post (getBaseUrl () + "/v3/identity/map" , envelope .envelope (), CLIENT_API_KEY );
279+ return v2DecryptEncryptedResponse (encryptedResponse , envelope .nonce (), CLIENT_API_SECRET );
281280 }
282281
283282 public IdentityMapV3Response v3IdentityMap (IdentityMapV3Input input ) {
@@ -303,14 +302,6 @@ public JsonNode v2KeySharing() throws Exception {
303302 return v2DecryptEncryptedResponse (encryptedResponse , envelope .nonce (), CLIENT_API_SECRET );
304303 }
305304
306- private String getClientApiKey () {
307- return CLIENT_API_KEY ;
308- }
309-
310- private String getClientApiSecret () {
311- return CLIENT_API_SECRET ;
312- }
313-
314305 private V2Envelope v2CreateEnvelope (String payload , String secret ) throws Exception {
315306 // Unencrypted envelope payload = timestamp + nonce + raw payload
316307 Instant timestamp = Instant .now ();
0 commit comments