replaced authentik with generic oidc provider

This commit is contained in:
Gani Georgiev
2023-02-23 21:07:00 +02:00
parent e529fe7e2a
commit aa4e405f92
55 changed files with 495 additions and 330 deletions
+27 -9
View File
@@ -136,15 +136,6 @@ func TestNewProviderByName(t *testing.T) {
t.Error("Expected to be instance of *auth.Livechat")
}
// authentik
p, err = auth.NewProviderByName(auth.NameAuthentik)
if err != nil {
t.Errorf("Expected nil, got error %v", err)
}
if _, ok := p.(*auth.Authentik); !ok {
t.Error("Expected to be instance of *auth.Authentik")
}
// gitea
p, err = auth.NewProviderByName(auth.NameGitea)
if err != nil {
@@ -153,4 +144,31 @@ func TestNewProviderByName(t *testing.T) {
if _, ok := p.(*auth.Gitea); !ok {
t.Error("Expected to be instance of *auth.Gitea")
}
// oidc
p, err = auth.NewProviderByName(auth.NameOIDC)
if err != nil {
t.Errorf("Expected nil, got error %v", err)
}
if _, ok := p.(*auth.OIDC); !ok {
t.Error("Expected to be instance of *auth.OIDC")
}
// oidc2
p, err = auth.NewProviderByName(auth.NameOIDC + "2")
if err != nil {
t.Errorf("Expected nil, got error %v", err)
}
if _, ok := p.(*auth.OIDC); !ok {
t.Error("Expected to be instance of *auth.OIDC")
}
// oidc3
p, err = auth.NewProviderByName(auth.NameOIDC + "3")
if err != nil {
t.Errorf("Expected nil, got error %v", err)
}
if _, ok := p.(*auth.OIDC); !ok {
t.Error("Expected to be instance of *auth.OIDC")
}
}