mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(lambda): quote the model's FunctionName pattern in the validation error (#5487)
The ValidationException for a bad function name quoted a region pattern without the (eusc-)? and -iso([a-z]?) branches the Lambda model's FunctionName pattern has. The text is only quoted, never enforced, so no name is accepted or refused differently. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
1 parent
03a0dfefdd
commit
32cb4b7b8b
2 files changed
+12
-1
No files matched your search
@@ -22,7 +22,9 @@ public final class LambdaArnUtils {
|
||||
private static final Pattern NAME_PATTERN = Pattern.compile("[a-zA-Z0-9-_]+");
|
||||
private static final int MAX_NAME_LENGTH = 64;
|
||||
private static final int MAX_TOTAL_LENGTH = 140;
|
||||
private static final String NAME_REGEX = "(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\\d{1}:)?"
|
||||
/** The model's {@code FunctionName} pattern, quoted in the ValidationException a bad name gets. */
|
||||
private static final String NAME_REGEX = "(arn:(aws[a-zA-Z-]*)?:lambda:)?"
|
||||
+ "((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:)?"
|
||||
+ "(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?";
|
||||
private static final Pattern ACCOUNT_PATTERN = Pattern.compile("\\d{12}");
|
||||
private static final Pattern QUALIFIER_PATTERN = Pattern.compile("\\$LATEST|[a-zA-Z0-9-_]+");
|
||||
|
||||
Reference in new issue
Block a user