Cover hash-over-credential validation precedence

Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
Cursor Agent
2026-02-15 04:54:34 +00:00
parent 8309d579ae
commit be5487fb4c
+22
View File
@@ -774,6 +774,17 @@ describe("TriggerChatTransport", function () {
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("prioritizes hash validation over credential validation", function () {
expect(function () {
new TriggerChatTransport({
task: "chat-task",
accessToken: "pk_trigger",
baseURL: "https://user:pass@example.com/base#fragment",
stream: "chat-stream",
});
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("throws when trimmed baseURL includes username or password credentials", function () {
expect(function () {
new TriggerChatTransport({
@@ -3145,6 +3156,17 @@ describe("TriggerChatTransport", function () {
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("prioritizes hash validation over credential validation in factory", function () {
expect(function () {
createTriggerChatTransport({
task: "chat-task",
accessToken: "pk_trigger",
baseURL: "https://user:pass@example.com/base#fragment",
stream: "chat-stream",
});
}).toThrowError("baseURL must not include query parameters or hash fragments");
});
it("throws from factory when trimmed baseURL includes username or password credentials", function () {
expect(function () {
createTriggerChatTransport({