From db0e2d33e7d607a0c90ed15ac7d4e627f75b7d1a Mon Sep 17 00:00:00 2001 From: Ross Edfort Date: Fri, 3 Feb 2023 13:06:17 -0700 Subject: [PATCH] Revert "Include credentials with the data codec decode request (#1050)" (#1113) This reverts commit c486661545da2cdcf882cb4ffe747b51ea763c12. --- src/lib/services/data-encoder.ts | 1 - src/lib/utilities/decode-payload.test.ts | 25 ------------------------ 2 files changed, 26 deletions(-) diff --git a/src/lib/services/data-encoder.ts b/src/lib/services/data-encoder.ts index 6a4d9ea33..db91481a4 100644 --- a/src/lib/services/data-encoder.ts +++ b/src/lib/services/data-encoder.ts @@ -39,7 +39,6 @@ export async function convertPayloadsWithCodec({ const encoderResponse: Promise = fetch(endpoint + '/decode', { headers, method: 'POST', - credentials: 'include', body: stringifyWithBigInt(payloads), }) .then((r) => r.json()) diff --git a/src/lib/utilities/decode-payload.test.ts b/src/lib/utilities/decode-payload.test.ts index 8f4a48cd4..b6737b54a 100644 --- a/src/lib/utilities/decode-payload.test.ts +++ b/src/lib/utilities/decode-payload.test.ts @@ -290,31 +290,6 @@ describe('convertPayloadToJsonWithCodec', () => { const dataConverterStatus = get(lastDataEncoderStatus); expect(dataConverterStatus).toEqual('notRequested'); }); - it('Should include credentials with the request for cookie based authentication of data converters', async () => { - const mockFetch = vi.fn(async () => { - return { - json: () => Promise.resolve({ payloads: [JsonPlainEncoded] }), - }; - }); - - vi.stubGlobal('fetch', mockFetch); - - const endpoint = 'http://localhost:1337'; - await convertPayloadToJsonWithCodec({ - attributes: parseWithBigInt(stringifyWithBigInt(workflowStartedEvent)), - namespace: 'default', - settings: { - codec: { - endpoint, - }, - }, - }); - - expect(mockFetch).toBeCalledWith( - expect.any(String), - expect.objectContaining({ credentials: 'include' }), - ); - }); }); // Integration test