mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 04:35:40 +00:00
feat: allowed paths label
This commit is contained in:
@@ -195,6 +195,8 @@ func GetTinyauthLabels(labels map[string]string) types.TinyauthLabels {
|
||||
tinyauthLabels.OAuthWhitelist = strings.Split(value, ",")
|
||||
case "tinyauth.users":
|
||||
tinyauthLabels.Users = strings.Split(value, ",")
|
||||
case "tinyauth.allowed":
|
||||
tinyauthLabels.Allowed = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,12 +298,14 @@ func TestGetTinyauthLabels(t *testing.T) {
|
||||
labels := map[string]string{
|
||||
"tinyauth.users": "user1,user2",
|
||||
"tinyauth.oauth.whitelist": "user1,user2",
|
||||
"tinyauth.allowed": "random",
|
||||
"random": "random",
|
||||
}
|
||||
|
||||
expected := types.TinyauthLabels{
|
||||
Users: []string{"user1", "user2"},
|
||||
OAuthWhitelist: []string{"user1", "user2"},
|
||||
Allowed: "random",
|
||||
}
|
||||
|
||||
result := utils.GetTinyauthLabels(labels)
|
||||
|
||||
Reference in New Issue
Block a user