Loosen restrictions for IAM user names

The only restriction for an IAM username is that it cannot start with
a '$'. An username that contains a ':' must escape it with another ':'
for use in a token for RTMP or SRT.
This commit is contained in:
Ingo Oppermann
2023-06-26 13:49:53 +02:00
parent 6f47f96f6e
commit abfe4918b4
8 changed files with 124 additions and 36 deletions

View File

@@ -19,15 +19,19 @@ func createAdapter() (Adapter, error) {
func TestUserName(t *testing.T) {
user := User{}
err := user.validate()
err := user.Validate()
require.Error(t, err)
user.Name = "foobar_5"
err = user.validate()
err = user.Validate()
require.NoError(t, err)
user.Name = "foobar:5"
err = user.Validate()
require.NoError(t, err)
user.Name = "$foob:ar"
err = user.validate()
err = user.Validate()
require.Error(t, err)
}