feat: allowed paths label

This commit is contained in:
Stavros
2025-02-26 19:25:54 +02:00
parent 30aab17f06
commit e4379cf3ed
7 changed files with 175 additions and 65 deletions

View File

@@ -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
}
}
}

View File

@@ -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)