feat: an application can declare HTTP basic auth, and apply sets it #125
1 changed files with 12 additions and 10 deletions
|
|
@ -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),
|
||||||
|
).toEqual({
|
||||||
is_http_basic_auth_enabled: true,
|
is_http_basic_auth_enabled: true,
|
||||||
http_basic_auth_username: "ops",
|
http_basic_auth_username: "ops",
|
||||||
http_basic_auth_password: "s3cret",
|
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", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue