From f3ef0dd8f247f06f016fe78012fa9f2753c96479 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 25 Jul 2021 12:06:10 +0200 Subject: Removed the verifyGitRequest function --- packages/server/src/api/util.ts | 17 ++--------------- packages/server/src/git/http.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 21 deletions(-) (limited to 'packages') diff --git a/packages/server/src/api/util.ts b/packages/server/src/api/util.ts index 0314db7..d467fed 100644 --- a/packages/server/src/api/util.ts +++ b/packages/server/src/api/util.ts @@ -1,7 +1,7 @@ import { Commit } from "../git/commit"; import { Repository } from "../git/repository"; -type VerificationResultType = "SUCCESS" | "NOT_FOUND" | "INVALID" | "ACCESS_DENIED"; +type VerificationResultType = "SUCCESS" | "NOT_FOUND" | "INVALID"; export class VerificationResult { constructor(result: VerificationResultType, subject?: string) { @@ -10,8 +10,7 @@ export class VerificationResult { if(result !== "SUCCESS") { const verification_error_types = { NOT_FOUND: { code: 404, message: `${String(subject?.substr(0, 1).toUpperCase()) + subject?.substr(1)} not found!` }, - INVALID: { code: 403, message: `Invalid ${subject}` }, - ACCESS_DENIED: { code: 403, message: "Access denied!" } + INVALID: { code: 403, message: `Invalid ${subject}` } }; this.message = verification_error_types[result].message; @@ -39,17 +38,5 @@ export async function verifySHA(repository: Repository, sha: string): Promise { console.log(err); @@ -69,6 +71,4 @@ export function connect(repository: Repository, req: Request, reply: FastifyRepl console.log(stderr.toString()); reply.raw.end(); }); - - git_service.stdout.pipe(reply.raw); } \ No newline at end of file -- cgit v1.2.3-18-g5258