Ensure that role ARNs don't collide (#13817)

This is to prepare for multiple providers enhancement.
This commit is contained in:
Aditya Manthramurthy
2021-12-03 13:15:56 -08:00
committed by GitHub
parent d29df6714a
commit 4f35054d29
3 changed files with 20 additions and 8 deletions

View File

@@ -59,9 +59,9 @@ type ARN struct {
}
var (
// Allows lower-case chars, numbers, '.', '-', '_' and '/'. Starts with
// a letter or digit. At least 1 character long.
validResourceIDRegex = regexp.MustCompile(`^[a-z0-9][a-z0-9_/\.-]*$`)
// Allows english letters, numbers, '.', '-', '_' and '/'. Starts with a
// letter or digit. At least 1 character long.
validResourceIDRegex = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_/\.-]*$`)
)
// NewIAMRoleARN - returns an ARN for a role in MinIO.