feat: an application can declare HTTP basic auth, and apply sets it #125

Merged
dan-claude-bot merged 3 commits from feat/app-basic-auth into main 2026-07-21 13:03:07 +00:00
Showing only changes of commit bf7fd11752 - Show all commits

View file

@ -586,13 +586,13 @@ describe("completeBasicAuth", () => {
// incomplete: a 422 mid-run, which is the exact failure this function exists // incomplete: a 422 mid-run, which is the exact failure this function exists
// to prevent. // to prevent.
it("completes the whole triple from a lone username — no toggle in the payload", () => { it("completes the whole triple from a lone username — no toggle in the payload", () => {
expect(completeBasicAuth({ http_basic_auth_username: "ops" }, spec)).toEqual( expect(
{ completeBasicAuth({ http_basic_auth_username: "ops" }, spec),
is_http_basic_auth_enabled: true, ).toEqual({
http_basic_auth_username: "ops", is_http_basic_auth_enabled: true,
http_basic_auth_password: "s3cret", http_basic_auth_username: "ops",
}, http_basic_auth_password: "s3cret",
); });
}); });
// Same shape, other credential: a stored-password rotation riding along. // Same shape, other credential: a stored-password rotation riding along.
@ -615,9 +615,11 @@ describe("completeBasicAuth", () => {
name: "admin", name: "admin",
fields: { is_http_basic_auth_enabled: false }, fields: { is_http_basic_auth_enabled: false },
}; };
expect(completeBasicAuth({ http_basic_auth_username: "ops" }, off)).toEqual({ expect(completeBasicAuth({ http_basic_auth_username: "ops" }, off)).toEqual(
http_basic_auth_username: "ops", {
}); http_basic_auth_username: "ops",
},
);
}); });
it("leaves a payload that is not enabling basic auth completely alone", () => { it("leaves a payload that is not enabling basic auth completely alone", () => {