diff --git a/package.json b/package.json index cff40569..7b0ca5c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@al/core", - "version": "1.0.201", + "version": "1.0.202", "description": "Node Enterprise Packages for Alert Logic (NEPAL) Core Library", "main": "./dist/index.cjs.js", "types": "./dist/index.d.ts", diff --git a/src/common/navigation/al-location.dictionary.ts b/src/common/navigation/al-location.dictionary.ts index caee2b96..b28575f8 100644 --- a/src/common/navigation/al-location.dictionary.ts +++ b/src/common/navigation/al-location.dictionary.ts @@ -614,7 +614,7 @@ export const AlLocationDictionary: AlLocationDescriptor[] = insightLocationId: 'defender-uk-newport', uri: 'https://yard.alertlogic.co.uk', environment: 'production|production-staging', - residency: "UK" + residency: "EMEA" }, ]; diff --git a/test/client/al-api-client.spec.ts b/test/client/al-api-client.spec.ts index bf568359..3632cfb2 100644 --- a/test/client/al-api-client.spec.ts +++ b/test/client/al-api-client.spec.ts @@ -530,6 +530,7 @@ describe("AlDefaultClient", () => { } ); describe('for a YARD API Endpoint', () => { it('should properly resolve the full URL', async () => { + AlLocatorService.setContext( { environment:'production', residency: 'EMEA', insightLocationId: 'defender-uk-newport' } ); const config: APIRequestParams = { service_stack: AlLocation.YARDAPI, version: 1, @@ -541,6 +542,19 @@ describe("AlDefaultClient", () => { let fullURL = await AlDefaultClient.fromConfigToFullUrl(config); expect(fullURL).to.equal("https://yard.alertlogic.co.uk/v1/12345678/something/wicked?this-way=comes"); }); + it('should properly resolve the full URL in a different datacenter', async () => { + AlLocatorService.setContext( { environment:'production', residency: 'US', insightLocationId: 'defender-us-denver' } ); + const config: APIRequestParams = { + service_stack: AlLocation.YARDAPI, + version: 1, + account_id: "12345678", + path: '/something/wicked', + params: { 'this-way': 'comes' }, + method: 'GET', + }; + let fullURL = await AlDefaultClient.fromConfigToFullUrl(config); + expect(fullURL).to.equal("https://yard.alertlogic.com/v1/12345678/something/wicked?this-way=comes"); + }); }); }); describe('when flushCacheKeys is present',() => {