Skip to content

Commit 0f5a9ac

Browse files
committed
fix(configure): mask gateway secret prompts
1 parent 46d5ca3 commit 0f5a9ac

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/commands/configure.gateway.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ describe("promptGatewayConfig", () => {
118118
authConfigFactory: ({ mode, token, password }) => ({ mode, token, password }),
119119
});
120120
expect(result.token).toBe("generated-token");
121+
expect(mocks.password).toHaveBeenCalledWith(
122+
expect.objectContaining({ message: "Gateway token (blank to generate)" }),
123+
);
121124
});
122125

123126
it("does not set password to literal 'undefined' when prompt returns undefined", async () => {
@@ -129,6 +132,12 @@ describe("promptGatewayConfig", () => {
129132
});
130133
expect(call.password).not.toBe("undefined");
131134
expect(call.password).toBe("");
135+
expect(mocks.password).toHaveBeenCalledWith(
136+
expect.objectContaining({
137+
message: "Gateway password",
138+
validate: expect.any(Function),
139+
}),
140+
);
132141
});
133142

134143
it("prompts for trusted-proxy configuration when trusted-proxy mode selected", async () => {

src/commands/configure.gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export async function promptGatewayConfig(
245245

246246
if (authMode === "password") {
247247
const passwordInput = guardCancel(
248-
await text({
248+
await password({
249249
message: "Gateway password",
250250
validate: validateGatewayPasswordInput,
251251
}),

0 commit comments

Comments
 (0)