Amazon DynamoDB · Types · Other public types
ArxInjectionCheck
Definition
- Namespace
ARX.SDK.Providers- Package
ARX.SDK
public static class ArxInjectionCheckThe rule every provider uses to tell a name that looks like an SQL injection attempt (ARX1017 SuspectedInjection) from a plain invalid name (ARX1003 InvalidIdentifier).
Properties
const int MAX_ECHO_LENGTHThe longest part of a suspicious name an error message repeats.
Methods
static string? Inspect(string? name)What makes
namelook like an injection attempt (for examplecontains ';'orcontains the SQL word 'UNION'), or null when it doesn't (a space alone, a leading digit or a long name is a plain invalid name).Parameter Type Description namestring?The name that failed the identifier rules, as the caller gave it. static string Echo(string? name)namemade safe to put in a message or a log line: control characters and line breaks escaped (so the name can't forge log lines), and cut toMAX_ECHO_LENGTHcharacters.Parameter Type Description namestring?The name to quote in a message. static ArxValidationException Refuse(string kind, string? name, string evidence, string? provider = null)The ARX1017 error for a
kindname ("Entity", "Attribute", "Type", …) thatInspectfound suspicious, withevidenceas returned by it. Providers raise this, so the message is the same everywhere.Parameter Type Description kindstringWhat the name is, for the message: "Entity", "Attribute", "Type" and so on. namestring?The suspicious name, quoted safely in the message. evidencestringWhat Inspectfound in it.providerstring?= nullThe provider's name for Provider, or null.
Notes
A provider calls Inspect only for a name that has already failed its identifier rules, so this check never refuses a name the provider accepts: it only decides which code the refusal carries.
Values are never inspected. They are always sent as parameters, so text such as Robert'); DROP TABLE x;-- is stored exactly as typed and can't change the SQL; refusing it would refuse real data (O'Brien, "a -- b").