@@ -291,10 +291,6 @@ private void setUpEncryptedRoutes(Router mainRouter, BodyHandler bodyHandler) {
291291 rc -> encryptedPayloadHandler .handle (rc , this ::handleTokenValidateV2 ), Role .GENERATOR ));
292292 mainRouter .post (V2_KEY_LATEST .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
293293 rc -> encryptedPayloadHandler .handle (rc , this ::handleKeysRequestV2 ), Role .ID_READER ));
294- mainRouter .post (V2_KEY_SHARING .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
295- rc -> encryptedPayloadHandler .handle (rc , this ::handleKeysSharing ), Role .SHARER , Role .ID_READER ));
296- mainRouter .post (V2_KEY_BIDSTREAM .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
297- rc -> encryptedPayloadHandler .handle (rc , this ::handleKeysBidstream ), Role .ID_READER ));
298294 mainRouter .post (V2_TOKEN_LOGOUT .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
299295 rc -> encryptedPayloadHandler .handleAsync (rc , this ::handleLogoutAsyncV2 ), Role .OPTOUT ));
300296 if (this .optOutStatusApiEnabled ) {
@@ -308,13 +304,21 @@ private void setUpEncryptedRoutes(Router mainRouter, BodyHandler bodyHandler) {
308304
309305 if (isAsyncBatchRequestsEnabled ) {
310306 LOGGER .info ("Async batch requests enabled" );
307+ mainRouter .post (V2_KEY_SHARING .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
308+ rc -> encryptedPayloadHandler .handleAsync (rc , this ::handleKeysSharingAsync ), Role .SHARER , Role .ID_READER ));
309+ mainRouter .post (V2_KEY_BIDSTREAM .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
310+ rc -> encryptedPayloadHandler .handleAsync (rc , this ::handleKeysBidstreamAsync ), Role .ID_READER ));
311311 mainRouter .post (V2_IDENTITY_BUCKETS .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
312312 rc -> encryptedPayloadHandler .handleAsync (rc , this ::handleBucketsV2Async ), Role .MAPPER ));
313313 mainRouter .post (V2_IDENTITY_MAP .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
314314 rc -> encryptedPayloadHandler .handleAsync (rc , this ::handleIdentityMapV2Async ), Role .MAPPER ));
315315 mainRouter .post (V3_IDENTITY_MAP .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
316316 rc -> encryptedPayloadHandler .handleAsync (rc , this ::handleIdentityMapV3Async ), Role .MAPPER ));
317317 } else {
318+ mainRouter .post (V2_KEY_SHARING .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
319+ rc -> encryptedPayloadHandler .handle (rc , this ::handleKeysSharing ), Role .SHARER , Role .ID_READER ));
320+ mainRouter .post (V2_KEY_BIDSTREAM .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
321+ rc -> encryptedPayloadHandler .handle (rc , this ::handleKeysBidstream ), Role .ID_READER ));
318322 mainRouter .post (V2_IDENTITY_BUCKETS .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
319323 rc -> encryptedPayloadHandler .handle (rc , this ::handleBucketsV2 ), Role .MAPPER ));
320324 mainRouter .post (V2_IDENTITY_MAP .toString ()).handler (bodyHandler ).handler (auth .handleV1 (
@@ -694,6 +698,20 @@ public void handleKeysBidstream(RoutingContext rc) {
694698 ResponseUtil .SuccessV2 (rc , resp );
695699 }
696700
701+ private Future <Void > handleKeysSharingAsync (RoutingContext rc ) {
702+ return computeWorkerPool .executeBlocking (() -> {
703+ handleKeysSharing (rc );
704+ return null ;
705+ });
706+ }
707+
708+ private Future <Void > handleKeysBidstreamAsync (RoutingContext rc ) {
709+ return computeWorkerPool .executeBlocking (() -> {
710+ handleKeysBidstream (rc );
711+ return null ;
712+ });
713+ }
714+
697715 private void addBidstreamHeaderFields (JsonObject resp , int maxBidstreamLifetimeSeconds ) {
698716 resp .put ("max_bidstream_lifetime_seconds" , maxBidstreamLifetimeSeconds + TOKEN_LIFETIME_TOLERANCE .toSeconds ());
699717 addIdentityScopeField (resp );
0 commit comments