mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Validate customData keys and values (#5920) (no-changelog)
* fix(core): Validate customData keys and values Throws errors in manual mode and ignores and logs values in production * fix: validate customData key characters * refactor: review changes * fix: logger not initialised for metadata tests * fix: allow numbers for values
This commit is contained in:
@@ -1653,10 +1653,24 @@ export function getAdditionalKeys(
|
||||
customData: runExecutionData
|
||||
? {
|
||||
set(key: string, value: string): void {
|
||||
setWorkflowExecutionMetadata(runExecutionData, key, value);
|
||||
try {
|
||||
setWorkflowExecutionMetadata(runExecutionData, key, value);
|
||||
} catch (e) {
|
||||
if (mode === 'manual') {
|
||||
throw e;
|
||||
}
|
||||
Logger.verbose(e.message);
|
||||
}
|
||||
},
|
||||
setAll(obj: Record<string, string>): void {
|
||||
setAllWorkflowExecutionMetadata(runExecutionData, obj);
|
||||
try {
|
||||
setAllWorkflowExecutionMetadata(runExecutionData, obj);
|
||||
} catch (e) {
|
||||
if (mode === 'manual') {
|
||||
throw e;
|
||||
}
|
||||
Logger.verbose(e.message);
|
||||
}
|
||||
},
|
||||
get(key: string): string {
|
||||
return getWorkflowExecutionMetadata(runExecutionData, key);
|
||||
|
||||
Reference in New Issue
Block a user