Skip to content

Latest commit

 

History

History
85 lines (72 loc) · 1.76 KB

cred-class-field-unobscured-sensitive-input.md

File metadata and controls

85 lines (72 loc) · 1.76 KB

cred-class-field-unobscured-sensitive-input

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.

Examples

❌ 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,
		},
	];
}

Links