Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: [AEA-0000] - fix sandbox deployments #3158

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/coordinator/src/utils/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum RequestHeaders {
}

export const DEFAULT_SANDBOX_ASID = "200000001285"
export const DEFAULT_SANDBOX_PARTY_KEY = "DEFAULT_SANDBOX_PARTY_KEY"
export const DEFAULT_PTL_ASID = process.env.DEFAULT_PTL_ASID
export const DEFAULT_PTL_PARTY_KEY = process.env.DEFAULT_PTL_PARTY_KEY
export const DEFAULT_UUID = "555254239107"
Expand Down Expand Up @@ -62,6 +63,9 @@ export function getAsid(headers: Hapi.Utils.Dictionary<string>): string {
}

export function getPartyKey(headers: Hapi.Utils.Dictionary<string>): string {
if (isSandbox()) {
return DEFAULT_SANDBOX_PARTY_KEY
}
if (headers[RequestHeaders.PARTY_KEY] !== undefined) {
return headers[RequestHeaders.PARTY_KEY]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/coordinator/tests/utils/headers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("header functions do the right thing", () => {
test("getPartyKey gets correct value when is sandbox", () => {
process.env.SANDBOX = "1"
const partyKey = getPartyKey(validTestHeaders)
expect(partyKey).toBe("T141D-822234")
expect(partyKey).toBe("DEFAULT_SANDBOX_PARTY_KEY")
})

test("getPartyKey gets correct value when not in sandbox but in PTL hosted container", () => {
Expand Down
Loading