mirror of
https://github.com/datarhei/core.git
synced 2025-10-16 13:00:37 +08:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user