From ba8549220295d03fb7eb7d7d31c90af72b30b1a6 Mon Sep 17 00:00:00 2001 From: Melissa Zhang Date: Thu, 30 Jul 2020 10:38:57 -0700 Subject: remove unnecessary authentication/database stuff --- src/server/ApiManagers/HypothesisManager.ts | 40 ----------------------------- src/server/ApiManagers/UploadManager.ts | 1 - 2 files changed, 41 deletions(-) delete mode 100644 src/server/ApiManagers/HypothesisManager.ts (limited to 'src/server/ApiManagers') diff --git a/src/server/ApiManagers/HypothesisManager.ts b/src/server/ApiManagers/HypothesisManager.ts deleted file mode 100644 index 370d02a49..000000000 --- a/src/server/ApiManagers/HypothesisManager.ts +++ /dev/null @@ -1,40 +0,0 @@ -import ApiManager, { Registration } from "./ApiManager"; -import { Method, _permission_denied } from "../RouteManager"; -import { GoogleApiServerUtils } from "../apis/google/GoogleApiServerUtils"; -import { Database } from "../database"; -import { writeFile, readFile, readFileSync, existsSync } from "fs"; -import { serverPathToFile, Directory } from "./UploadManager"; - -export default class HypothesisManager extends ApiManager { - - protected initialize(register: Registration): void { - - register({ - method: Method.GET, - subscription: "/readHypothesisAccessToken", - secureHandler: async ({ user, res }) => { - const credentials = await Database.Auxiliary.HypothesisAccessToken.Fetch(user.id); - res.send(credentials ? { username: credentials.hypothesisUsername, apiKey: credentials.hypothesisApiKey } : ""); - } - }); - - register({ - method: Method.POST, - subscription: "/writeHypothesisAccessToken", - secureHandler: async ({ user, req, res }) => { - await Database.Auxiliary.HypothesisAccessToken.Write(user.id, req.body.authenticationCode, req.body.hypothesisUsername); - res.send(); - } - }); - - register({ - method: Method.GET, - subscription: "/revokeHypothesisAccessToken", - secureHandler: async ({ user, res }) => { - await Database.Auxiliary.HypothesisAccessToken.Revoke(user.id); - res.send(); - } - }); - - } -} \ No newline at end of file diff --git a/src/server/ApiManagers/UploadManager.ts b/src/server/ApiManagers/UploadManager.ts index 4455d11eb..bd242db5e 100644 --- a/src/server/ApiManagers/UploadManager.ts +++ b/src/server/ApiManagers/UploadManager.ts @@ -26,7 +26,6 @@ export enum Directory { text = "text", pdf_thumbnails = "pdf_thumbnails", audio = "audio", - hypothesis = "hypothesis" } export function serverPathToFile(directory: Directory, filename: string) { -- cgit v1.2.3-70-g09d2