From fe3bd05847d6e83d81610ed3cfd281f5473ff7ab Mon Sep 17 00:00:00 2001 From: BeckaL Date: Wed, 22 May 2024 15:42:30 +0100 Subject: [PATCH] BAU: Remove source ip from mfa service This is no longer required to set the ip in headers, since the common headers library that is now used gets this from the request that we now pass through. --- src/components/common/mfa/mfa-service.ts | 2 -- src/components/common/mfa/send-mfa-controller.ts | 1 - src/components/common/mfa/tests/mfa-service.test.ts | 3 +-- src/components/common/mfa/tests/send-mfa-controller.test.ts | 1 - src/components/common/mfa/types.ts | 1 - src/components/enter-password/enter-password-controller.ts | 1 - .../enter-password/tests/enter-password-controller.test.ts | 1 - .../reset-password-2fa-sms-controller.ts | 1 - src/components/reset-password/reset-password-controller.ts | 1 - 9 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/components/common/mfa/mfa-service.ts b/src/components/common/mfa/mfa-service.ts index 13382635ad..e1dd9d273f 100644 --- a/src/components/common/mfa/mfa-service.ts +++ b/src/components/common/mfa/mfa-service.ts @@ -18,7 +18,6 @@ export function mfaService(axios: Http = http): MfaServiceInterface { sessionId: string, clientSessionId: string, emailAddress: string, - sourceIp: string, persistentSessionId: string, isResendCodeRequest: boolean, userLanguage: string, @@ -36,7 +35,6 @@ export function mfaService(axios: Http = http): MfaServiceInterface { { sessionId: sessionId, clientSessionId: clientSessionId, - sourceIp: sourceIp, persistentSessionId: persistentSessionId, userLanguage: userLanguage, }, diff --git a/src/components/common/mfa/send-mfa-controller.ts b/src/components/common/mfa/send-mfa-controller.ts index 1f12fd35bc..78032bab28 100644 --- a/src/components/common/mfa/send-mfa-controller.ts +++ b/src/components/common/mfa/send-mfa-controller.ts @@ -21,7 +21,6 @@ export function sendMfaGeneric( sessionId, clientSessionId, email, - req.ip, persistentSessionId, isResendCodeRequest, xss(req.cookies.lng as string), diff --git a/src/components/common/mfa/tests/mfa-service.test.ts b/src/components/common/mfa/tests/mfa-service.test.ts index 419703fa32..cd152c5e1c 100644 --- a/src/components/common/mfa/tests/mfa-service.test.ts +++ b/src/components/common/mfa/tests/mfa-service.test.ts @@ -35,7 +35,7 @@ describe("mfa service", () => { }); it("successfully calls the API to make a request to send an mfa code", async () => { - const { email, sessionId, clientSessionId, ip, diPersistentSessionId } = + const { email, sessionId, clientSessionId, diPersistentSessionId } = commonVariables; const req = createMockRequest(PATH_NAMES.ENTER_MFA, { headers: requestHeadersWithIpAndAuditEncoded, @@ -63,7 +63,6 @@ describe("mfa service", () => { sessionId, clientSessionId, email, - ip, diPersistentSessionId, isResendCodeRequest, userLanguage, diff --git a/src/components/common/mfa/tests/send-mfa-controller.test.ts b/src/components/common/mfa/tests/send-mfa-controller.test.ts index 34d9ac307d..fbd548e77c 100644 --- a/src/components/common/mfa/tests/send-mfa-controller.test.ts +++ b/src/components/common/mfa/tests/send-mfa-controller.test.ts @@ -62,7 +62,6 @@ describe("send mfa controller", () => { sinon.match.any, sinon.match.any, sinon.match.any, - sinon.match.any, JOURNEY_TYPE.REAUTHENTICATION ); }); diff --git a/src/components/common/mfa/types.ts b/src/components/common/mfa/types.ts index 016173f29e..b33451c9b5 100644 --- a/src/components/common/mfa/types.ts +++ b/src/components/common/mfa/types.ts @@ -7,7 +7,6 @@ export interface MfaServiceInterface { sessionId: string, clientSessionId: string, emailAddress: string, - sourceIp: string, persistentSessionId: string, isResendCodeRequest: boolean, userLanguage: string, diff --git a/src/components/enter-password/enter-password-controller.ts b/src/components/enter-password/enter-password-controller.ts index 41c68a1e88..a49a79e9c4 100644 --- a/src/components/enter-password/enter-password-controller.ts +++ b/src/components/enter-password/enter-password-controller.ts @@ -201,7 +201,6 @@ export function enterPasswordPost( sessionId, clientSessionId, email, - req.ip, persistentSessionId, false, xss(req.cookies.lng as string), diff --git a/src/components/enter-password/tests/enter-password-controller.test.ts b/src/components/enter-password/tests/enter-password-controller.test.ts index c0146c04f8..4d4321edcc 100644 --- a/src/components/enter-password/tests/enter-password-controller.test.ts +++ b/src/components/enter-password/tests/enter-password-controller.test.ts @@ -133,7 +133,6 @@ describe("enter password controller", () => { sinon.match.any, sinon.match.any, sinon.match.any, - sinon.match.any, JOURNEY_TYPE.REAUTHENTICATION ); }); diff --git a/src/components/reset-password-2fa-sms/reset-password-2fa-sms-controller.ts b/src/components/reset-password-2fa-sms/reset-password-2fa-sms-controller.ts index c62e5929fe..269eb5459f 100644 --- a/src/components/reset-password-2fa-sms/reset-password-2fa-sms-controller.ts +++ b/src/components/reset-password-2fa-sms/reset-password-2fa-sms-controller.ts @@ -60,7 +60,6 @@ export function resetPassword2FASmsGet( sessionId, clientSessionId, email, - req.ip, persistentSessionId, false, xss(req.cookies.lng as string), diff --git a/src/components/reset-password/reset-password-controller.ts b/src/components/reset-password/reset-password-controller.ts index 9b64724f3a..c28b199d5b 100644 --- a/src/components/reset-password/reset-password-controller.ts +++ b/src/components/reset-password/reset-password-controller.ts @@ -132,7 +132,6 @@ export function resetPasswordPost( sessionId, clientSessionId, email, - req.ip, persistentSessionId, false, xss(req.cookies.lng as string),