Skip to content

Commit

Permalink
Merge pull request #1603 from govuk-one-login/BAU/remove-landing-service
Browse files Browse the repository at this point in the history
BAU: Remove landing service
  • Loading branch information
BeckaL authored May 7, 2024
2 parents 49e0b5a + aa46393 commit 4f6a524
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 81 deletions.
34 changes: 0 additions & 34 deletions src/components/landing/landing-service.ts

This file was deleted.

38 changes: 1 addition & 37 deletions src/components/landing/tests/landing-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@ import { describe } from "mocha";
import { sinon } from "../../../../test/utils/test-utils";
import nock = require("nock");
import decache from "decache";
import { HTTP_STATUS_CODES, PATH_NAMES } from "../../../app.constants";
import { LandingServiceInterface, StartAuthResponse } from "../types";
import { createApiResponse } from "../../../utils/http";
import { AxiosResponse } from "axios";
import { PATH_NAMES } from "../../../app.constants";

describe("Integration:: landing", () => {
let app: any;

before(async () => {
decache("../../../app");
decache("../landing-service");
decache("../../../middleware/session-middleware");
const landingService = require("../landing-service");
const sessionMiddleware = require("../../../middleware/session-middleware");
sinon
.stub(sessionMiddleware, "validateSessionMiddleware")
Expand All @@ -30,37 +25,6 @@ describe("Integration:: landing", () => {
next();
});

sinon
.stub(landingService, "landingService")
.callsFake((): LandingServiceInterface => {
async function start() {
const fakeAxiosResponse: AxiosResponse = {
data: {
client: {
serviceType: "MANDATORY",
clientName: "test-client",
scopes: ["openid"],
cookieConsentEnabled: true,
consentEnabled: true,
redirectUri: "http://test-redirect.gov.uk/callback",
state: "jasldasl12312",
isOneLoginService: false,
},
user: {
consentRequired: true,
upliftRequired: false,
identityRequired: false,
authenticated: false,
},
},
status: HTTP_STATUS_CODES.OK,
} as AxiosResponse;

return createApiResponse<StartAuthResponse>(fakeAxiosResponse);
}

return { start };
});
app = await require("../../../app").createApp();
});

Expand Down
11 changes: 1 addition & 10 deletions src/components/landing/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiResponseResult, DefaultApiResponse } from "../../types";
import { DefaultApiResponse } from "../../types";

export interface StartAuthResponse extends DefaultApiResponse {
client: ClientInfo;
Expand Down Expand Up @@ -26,12 +26,3 @@ export interface UserSessionInfo {
docCheckingAppUser: boolean;
mfaMethodType?: string;
}

export interface LandingServiceInterface {
start: (
sessionId: string,
clientSessionId: string,
sourceIp: string,
persistentSessionId: string
) => Promise<ApiResponseResult<StartAuthResponse>>;
}

0 comments on commit 4f6a524

Please sign in to comment.