TASK22028: phase 16 file-proxy guard consistency slice

This commit is contained in:
2026-03-13 16:23:34 +00:00
parent 1a95cf1098
commit c196edb457
4 changed files with 159 additions and 53 deletions
@@ -1,30 +1,18 @@
import {
downloadAllProgressFiles,
getAllProgressBlobs
} from "../../../actions/azurestorage";
import _ from "lodash";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
import { getToken } from "../../../actions/core/token";
import { azureHeaders } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { hashAPIPath } from "../../../actions/core/hash";
import axios from "axios";
import CryptoJS from "crypto-js";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
const BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
const hasValue = (value) =>
typeof value === "string" && value.trim().length > 0;
export default async function ApiProxy(req, res) {
var containerName = req.query.container;
var checkHash = req.query.hash;
if (typeof containerName === "undefined" || containerName.length === 0) {
if (!hasValue(containerName)) {
return res.status(400).json();
}
+4 -21
View File
@@ -1,36 +1,19 @@
import {
downloadAllProgressFiles,
getAllProgressBlobs
} from "../../../actions/azurestorage";
import _ from "lodash";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
import { getToken } from "../../../actions/core/token";
import { azureHeaders } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { hashAPIPath } from "../../../actions/core/hash";
import axios from "axios";
import CryptoJS from "crypto-js";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
const BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
const hasValue = (value) =>
typeof value === "string" && value.trim().length > 0;
export default async function ApiProxy(req, res) {
var containerName = req.query.container;
var casefolderID = req.query.casefolderID;
var checkHash = req.query.hash;
if (
typeof containerName === "undefined" ||
containerName.length === 0 ||
typeof casefolderID === "undefined" ||
casefolderID.length === 0
) {
if (!hasValue(containerName) || !hasValue(casefolderID)) {
return res.status(400).json();
}
+4 -16
View File
@@ -1,30 +1,18 @@
import {
downloadAllProgressFiles,
getAllProgressBlobs
} from "../../../actions/azurestorage";
import _ from "lodash";
import nextConnect from "next-connect";
import middleware from "../middleware/middleware";
import { getToken } from "../../../actions/core/token";
import { azureHeaders } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { hashAPIPath } from "../../../actions/core/hash";
import axios from "axios";
import CryptoJS from "crypto-js";
const WORDKEY = process.env.HASHKEY;
const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
const BASE_URL = process.env.API_ROOT || `http://localhost:${port}`;
const hasValue = (value) =>
typeof value === "string" && value.trim().length > 0;
export default async function ApiProxy(req, res) {
var containerName = req.query.container;
var checkHash = req.query.hash;
if (typeof containerName === "undefined" || containerName.length === 0) {
if (!hasValue(containerName)) {
return res.status(400).json();
}