mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-04 02:04:06 +00:00
Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com>
21 lines
755 B
TypeScript
21 lines
755 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { getRegistryCredentialFailureMessage } from "./credential-task";
|
|
|
|
describe("Registry credential rejection feedback", () => {
|
|
it("explains a wrong-environment key without reflecting server data", () => {
|
|
const message = getRegistryCredentialFailureMessage({
|
|
stored: false,
|
|
error: "Registry rejected the API key (HTTP 401). sensitive-input",
|
|
});
|
|
expect(message).toContain("Registry environment");
|
|
expect(message).toContain("HTTP 401");
|
|
expect(message).not.toContain("sensitive-input");
|
|
});
|
|
it("does not expose arbitrary backend errors", () => {
|
|
expect(
|
|
getRegistryCredentialFailureMessage({ error: "sensitive-input" }),
|
|
).toBeUndefined();
|
|
});
|
|
});
|