typeOptions.password
must be set to true
in a sensitive node parameter, to obscure the input.
📋 This rule is part of the plugin:n8n-nodes-base/credentials
config.
🔧 Run ESLint with --fix
option to autofix the issue flagged by this rule.
❌ Example of incorrect code:
export class TestApi implements ICredentialType {
name = "testApi";
displayName = "Test API";
documentationUrl = "test";
properties: INodeProperties[] = [
{
displayName: "Password",
name: "password",
type: "string",
default: "",
required: true,
},
];
}
export class TestApi implements ICredentialType {
name = "testApi";
displayName = "Test API";
documentationUrl = "test";
properties: INodeProperties[] = [
{
displayName: "API Key",
name: "apiKey",
type: "string",
default: "",
required: true,
},
];
}
export class TestApi implements ICredentialType {
name = "testApi";
displayName = "Test API";
documentationUrl = "test";
properties: INodeProperties[] = [
{
displayName: "Access Token",
name: "accessToken",
type: "string",
default: "",
required: true,
},
];
}
✅ Example of correct code:
export class TestApi implements ICredentialType {
name = "testApi";
displayName = "Test API";
documentationUrl = "zammad";
properties: INodeProperties[] = [
{
displayName: "API Key",
name: "apiKey",
type: "string",
typeOptions: { password: true },
default: "",
required: true,
},
];
}