moved hashapipath to reusable single helper
This commit is contained in:
@@ -5,6 +5,7 @@ import { azureHeaders, azureHeadersPaged } from "../../../actions/core/headers";
|
||||
import { consoleLogger } from "../../../actions/core/logger";
|
||||
import { getToken } from "../../../actions/core/token";
|
||||
import { formatDates } from "../../../components/utils";
|
||||
import { hashAPIPath } from "../../../actions/core/hash";
|
||||
|
||||
var NotifyClient = require("notifications-node-client").NotifyClient;
|
||||
|
||||
@@ -15,14 +16,6 @@ const WEBAPI_URL =
|
||||
process.env.RELAY_ROOT ||
|
||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||
|
||||
const hashAPIPath = (queryPath) => {
|
||||
const hash = CryptoJS.HmacSHA256(
|
||||
queryPath,
|
||||
CryptoJS.enc.Hex.parse(WORDKEY)
|
||||
).toString(CryptoJS.enc.Hex);
|
||||
return queryPath.includes("?") ? `&hash=${hash}` : `?hash=${hash}`;
|
||||
};
|
||||
|
||||
const encryptDocReference = (documentRef) => {
|
||||
const hash = CryptoJS.HmacSHA256(
|
||||
`documents/download/${documentRef}`,
|
||||
|
||||
Reference in New Issue
Block a user