Skip to content

Commit

Permalink
Preparing release 3.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
queue-it committed Mar 3, 2022
1 parent 3f73215 commit d87d703
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
13 changes: 7 additions & 6 deletions integrationConfigProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@ 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':
return inlineIntegrationConfig;
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";
options.headers = { "api-key": apiKey };
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",
Expand Down
4 changes: 2 additions & 2 deletions lib/edgekv_tokens.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
var edgekv_access_tokens = {
"namespace-QueueIT" : {
"name": "queueit_ed--stae",
"value" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJld2lkcyI6ImFsbCIsInN1YiI6IjE2MzE3Ii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_kG2PehhQVObgOQi7p5cqmjHZu1uSxdohriTPXBlkF8r3uUSDAy4W9ASo2yVwZvexlaIAju4aMjeauzHL59gPy3zQUCLlzJdK6FHHx21m8hniMo9-ftCQhtLD_jdbFFXW6lS4n6umVPmigqly6ysgw8DT4cC-3RwrLslSJd5wX5CO97bprP2dS6jvsDJ6RRDh1yMVQ43EGgPh1VnZwAXJY-CyFvn-4m12DzLWHnOVhQhG_kPHzHhba10RuNFfN56JmGvjvv3JSZ-fAyVljTHf-HBINpgf3RIgGUi-GZRuamPFsbZGE693yP5f69GZjvHROpkEu2BUOFw"
"value" : "-PLEASE UPDATE-"
}
}
export { edgekv_access_tokens };
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion queueitHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const AKAMAI_SDK_VERSION = "3.0.7";
const AKAMAI_SDK_VERSION = "3.0.8";

export class QueueITHelper {

Expand Down

0 comments on commit d87d703

Please sign in to comment.