TASK22224: harden proxy file routes and expand contracts

This commit is contained in:
2026-03-23 18:14:22 +00:00
parent 91a0ab82ea
commit 3f2b945172
6 changed files with 258 additions and 70 deletions
@@ -17,8 +17,8 @@ const hasValue = (value) =>
typeof value === "string" && value.trim().length > 0;
ApiProxy.get(async (req, res) => {
var containerName = req.query.container;
var tempCaseRef = req.query.tempcaseref;
const containerName = req.query.container;
const tempCaseRef = req.query.tempcaseref;
if (!hasValue(containerName) || !hasValue(tempCaseRef)) {
return respondError(res, {
@@ -28,30 +28,28 @@ ApiProxy.get(async (req, res) => {
});
}
var token = await getToken();
const token = await getToken();
var queryUrl =
const queryUrl =
"/api/file/createappealcompletemessage_api?container=" +
containerName +
encodeURIComponent(containerName) +
"&tempcaseref=" +
tempCaseRef;
encodeURIComponent(tempCaseRef);
return axios
.get(
try {
const { data } = await axios.get(
BASE_URL + queryUrl + hashAPIPath(queryUrl),
azureHeaders(token.access_token)
)
.then(({ data }) => {
return respondSuccess(res, data);
})
.catch((error) => {
consoleLogger(error);
return respondError(res, {
status: 400,
code: "CREATE_APPEAL_COMPLETE_MESSAGE_PROXY_FAILED",
message: "Failed to create appeal complete message"
});
);
return respondSuccess(res, data);
} catch (error) {
consoleLogger(error);
return respondError(res, {
status: 400,
code: "CREATE_APPEAL_COMPLETE_MESSAGE_PROXY_FAILED",
message: "Failed to create appeal complete message"
});
}
});
export const config = {