Actions3
Exact Match
AI-generatedOverview
The Security Validator node validates API keys, tokens, or other sensitive data by comparing an input key against an expected key using exact match validation. It supports multiple input modes for the key to validate: direct input, environment variable, or JavaScript code expression. The node stops the workflow if the validation fails and passes all data through if the validation succeeds. This node is useful for securing workflows by ensuring that only requests with valid API keys or tokens proceed.
Use Case Examples
- Validating an API key provided directly in the node against a stored secret key.
- Validating an API key retrieved securely from an environment variable.
- Using a JavaScript expression to extract and validate an API key from incoming JSON data.
Properties
| Name | Meaning |
|---|---|
| Input Mode | How to provide the input API key (direct input, environment variable, or code expression). |
| Input Key (API Key/Token) | The API key to validate, used when Input Mode is Direct Input. |
| Environment Variable Name | Name of the environment variable containing the API key, used when Input Mode is Environment Variable. |
| JavaScript Code | JavaScript code that returns the API key to validate, used when Input Mode is Code Expression. |
| Expected Key (API Key/Token) | The secret API key to validate against, required for direct input mode. |
| Case Sensitive | Whether the validation should be case sensitive. |
| Error Message | Custom error message to show when validation fails. |
Output
JSON
_validationstatus- Validation status, e.g., 'VALID' if the API key validation passed.message- Message describing the validation result.timestamp- Timestamp when the validation was performed.validationType- Type of validation performed, here 'equals' for exact match.inputMode- Input mode used to provide the API key.
Dependencies
- Requires access to environment variables if using environment variable input mode.
Troubleshooting
- If using environment variable mode, ensure the environment variable is set and not empty; otherwise, the node throws an error.
- If the input mode is 'code', JavaScript errors in the code expression will cause the node to throw an error with the message 'Code execution error'.
- If the input value or expected key is missing when required, the node throws an error indicating the missing input.
- If the validation fails, the node throws an error with the custom or default error message.