diff --git a/integrationConfigProvider.ts b/integrationConfigProvider.ts index a05cf38..5d65c17 100644 --- a/integrationConfigProvider.ts +++ b/integrationConfigProvider.ts @@ -7,7 +7,7 @@ import { EdgeKV } from './lib/edgekv.js'; export { IntegrationConfigProvider }; class IntegrationConfigProvider { - public static getIntegrationConfig = async function (configType: string, apiKey: string) { + public static getIntegrationConfig = async function (customerId: string, configType: string, apiKey: string) { switch (configType.toLowerCase()) { case 'inline': @@ -15,11 +15,11 @@ class IntegrationConfigProvider { case 'cache': return IntegrationConfigProvider.getIntegrationConfigFromCache(apiKey); case 'edgekv': - return IntegrationConfigProvider.getIntegrationConfigFromEdgeKV(); + return IntegrationConfigProvider.getIntegrationConfigFromEdgeKV(customerId); } return ''; - } + private static getIntegrationConfigFromCache = async function (apiKey: string) { const options: any = {} options.method = "GET"; @@ -27,11 +27,12 @@ class IntegrationConfigProvider { options.timeout = 1400; return (await httpRequest("/queueit/integrationconfig/", options)).text(); } - private static getIntegrationConfigFromEdgeKV = async function () { - let edgeKV = new EdgeKV("QueueIT", "integrations"); + + private static getIntegrationConfigFromEdgeKV = async function (customerId: string) { + let edgeKV = new EdgeKV("QueueIT", customerId); return await edgeKV.requestHandlerTemplate( - () => edgeKV.getRequest({ namespace: 'QueueIT', group: 'integrations', item: 'integrationConfig' }), + () => edgeKV.getRequest({ namespace: 'QueueIT', group: customerId, item: 'integrationConfig' }), (response) => response.text(), async (response) => await edgeKV.streamText(response.body), "GET JSON string", diff --git a/lib/edgekv_tokens.js b/lib/edgekv_tokens.js index 76a26dc..6369bea 100644 --- a/lib/edgekv_tokens.js +++ b/lib/edgekv_tokens.js @@ -1,11 +1,11 @@ var edgekv_access_tokens = { "namespace-QueueIT" : { "name": "queueit_ed--stae", -"value" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJld2lkcyI6ImFsbCIsInN1YiI6IjE2MzE3IiwibmFtZXNwYWNlLVF1ZXVlSVQiOlsiciIsImQiLCJ3Il0sImN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9ASo2yVwZvexlaIAju4aMjeauzHL59gPy3zQUCLlzJdK6FHHx21m8hniMo9-ftCQhtLD_jdbFFXW6lS4n6umVPmigqly6ysgw8DT4cC-3RwrLslSJd5wX5CO97bprP2dS6jvsDJ6RRDh1yMVQ43EGgPh1VnZwAXJY-CyFvn-4m12DzLWHnOVhQhG_kPHzHhba10RuNFfN56JmGvjvv3JSZ-fAyVljTHf-HBINpgf3RIgGUi-GZRuamPFsbZGE693yP5f69GZjvHROpkEu2BUOFw" + "value" : "-PLEASE UPDATE-" } } export { edgekv_access_tokens }; \ No newline at end of file diff --git a/main.ts b/main.ts index 8341765..c88525c 100644 --- a/main.ts +++ b/main.ts @@ -157,6 +157,7 @@ async function validateRequest(contextProvider: AkamaiContextProvider, settings: requestUrlWithoutToken = requestUrlWithoutToken.replace(new RegExp("[?]$"), ""); const integrationConfig = await IntegrationConfigProvider.getIntegrationConfig( + settings.CustomerId, settings.IntegrationConfigType, settings.ApiKey); diff --git a/package.json b/package.json index 2016b54..3bd8c7b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "repository": "https://github.com/queueit/KnownUser.V3.Akamai", "license": "MIT", "main": "./dist/index.js", - "version": "3.0.7", + "version": "3.0.8", "type": "module", "scripts": {}, "dependencies": { diff --git a/queueitHelpers.ts b/queueitHelpers.ts index 73e07b7..514bf60 100644 --- a/queueitHelpers.ts +++ b/queueitHelpers.ts @@ -1,5 +1,5 @@ -const AKAMAI_SDK_VERSION = "3.0.7"; +const AKAMAI_SDK_VERSION = "3.0.8"; export class QueueITHelper {