Sync shared snapshot from 5364588
Docker / Docker Build & Push (push) Failing after 2m3s

This commit is contained in:
Gabriel20xx committed 2026-09-13 18:43:52 +02:00
1 parent 899223270a
commit da15c3a7b7
4 files changed
+258 -242

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
package auth
import "testing"
func TestNormalizeProxyCredentials(t *testing.T) {
email, username, password, err := normalizeProxyCredentials(" User@Example.com ", "user", "correct horse battery staple")
if err != nil {
t.Fatal(err)
}
if email != "user@example.com" || username != "user" || password == "" {
t.Fatalf("normalized credentials = %q, %q, %q", email, username, password)
}
}
func TestNormalizeProxyCredentialsAllowsAdminEmailOnly(t *testing.T) {
if _, _, _, err := normalizeProxyCredentials("admin@example.com", "", "correct horse battery staple"); err != nil {
t.Fatalf("empty optional username rejected: %v", err)
}
}
func TestNormalizePlatformRole(t *testing.T) {
if normalizePlatformRole("MODERATOR") != "moderator" {
t.Fatal("moderator role was not normalized")
}
if normalizePlatformRole("unknown") != "user" {
t.Fatal("unknown role was not reduced to user")
}
}