Ensure validation regexps match entire string
This commit is contained in:
parent
9ba8567d59
commit
680182a177
|
@ -29,7 +29,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
logGroupNameRegexp = regexp.MustCompile(`[\.\-_/#A-Za-z0-9]+`)
|
||||
logGroupNameRegexp = regexp.MustCompile(`^[\.\-_/#A-Za-z0-9]+$`)
|
||||
)
|
||||
|
||||
// NewLogGroupProvider creates a provider that handles Cloudwatch LogGroup operations.
|
||||
|
|
|
@ -29,9 +29,9 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
actionRegexp = regexp.MustCompile(`(lambda:[*]|lambda:[a-zA-Z]+|[*])`)
|
||||
sourceAccountRegexp = regexp.MustCompile(`\d{12}`)
|
||||
sourceARNRegexp = regexp.MustCompile(`arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)`)
|
||||
actionRegexp = regexp.MustCompile(`^(lambda:[*]|lambda:[a-zA-Z]+|[*])$`)
|
||||
sourceAccountRegexp = regexp.MustCompile(`^\d{12}$`)
|
||||
sourceARNRegexp = regexp.MustCompile(`^arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)$`)
|
||||
)
|
||||
|
||||
type policy struct {
|
||||
|
|
Loading…
Reference in a new issue