|
|
@ -7,9 +7,11 @@ import { getFenceSpec, timestamp, write } from '../../accessModule'; |
|
|
|
import { sanitize } from '../../sanitize'; |
|
|
|
import { sanitize } from '../../sanitize'; |
|
|
|
import { stderr, stdoutVar, uuid } from '../../shell'; |
|
|
|
import { stderr, stdoutVar, uuid } from '../../shell'; |
|
|
|
|
|
|
|
|
|
|
|
const handleNumberType = (v: unknown) => String(sanitize(v, 'number')); |
|
|
|
const handleNumberType = (v: unknown) => |
|
|
|
|
|
|
|
String(sanitize(v, 'number', { modifierType: 'sql' })); |
|
|
|
|
|
|
|
|
|
|
|
const handleStringType = (v: unknown) => sanitize(v, 'string'); |
|
|
|
const handleStringType = (v: unknown) => |
|
|
|
|
|
|
|
sanitize(v, 'string', { modifierType: 'sql' }); |
|
|
|
|
|
|
|
|
|
|
|
const MAP_TO_VAR_TYPE: Record< |
|
|
|
const MAP_TO_VAR_TYPE: Record< |
|
|
|
AnvilDataFenceParameterType, |
|
|
|
AnvilDataFenceParameterType, |
|
|
@ -46,9 +48,12 @@ export const createFence: RequestHandler< |
|
|
|
return response.status(500).send(); |
|
|
|
return response.status(500).send(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const agent = sanitize(rAgent, 'string'); |
|
|
|
const agent = sanitize(rAgent, 'string', { modifierType: 'sql' }); |
|
|
|
const name = sanitize(rName, 'string'); |
|
|
|
const name = sanitize(rName, 'string', { modifierType: 'sql' }); |
|
|
|
const fenceUuid = sanitize(rUuid, 'string', { fallback: uuid() }); |
|
|
|
const fenceUuid = sanitize(rUuid, 'string', { |
|
|
|
|
|
|
|
fallback: uuid(), |
|
|
|
|
|
|
|
modifierType: 'sql', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const { [agent]: agentSpec } = fenceSpec; |
|
|
|
const { [agent]: agentSpec } = fenceSpec; |
|
|
|
|
|
|
|
|
|
|
|