Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

environmentHttpAuth.test.ts

22 lines714 Bytes

1import {
2 ORCHESTRATION_PROTOCOL_HEADER,
3 ORCHESTRATION_PROTOCOL_VERSION_TEXT,
4} from "@t3tools/contracts";
5import { describe, expect, it } from "vite-plus/test";
6​
7import { withOrchestrationProtocolHeader } from "./environmentHttpAuth.ts";
8​
9describe("orchestration HTTP compatibility header", () => {
10 it("announces the current protocol without replacing bearer or DPoP authentication", () => {
11 expect(
12 withOrchestrationProtocolHeader({
13 authorization: "DPoP access-token",
14 dpop: "signed-proof",
15 }),
16 ).toEqual({
17 authorization: "DPoP access-token",
18 dpop: "signed-proof",
19 [ORCHESTRATION_PROTOCOL_HEADER]: ORCHESTRATION_PROTOCOL_VERSION_TEXT,
20 });
21 });
22});