[#2533] added VK OAuth2 provider

Co-authored-by: Valentine <xb2w1z@gmail.com>
This commit is contained in:
Gani Georgiev
2023-05-24 15:34:25 +03:00
parent e40cf46b33
commit af71b63f23
41 changed files with 173 additions and 39 deletions

View File

@@ -69,6 +69,8 @@ func TestSettingsValidate(t *testing.T) {
s.AppleAuth.ClientId = ""
s.InstagramAuth.Enabled = true
s.InstagramAuth.ClientId = ""
s.VKAuth.Enabled = true
s.VKAuth.ClientId = ""
// check if Validate() is triggering the members validate methods.
err := s.Validate()
@@ -108,6 +110,7 @@ func TestSettingsValidate(t *testing.T) {
`"oidc3Auth":{`,
`"appleAuth":{`,
`"instagramAuth":{`,
`"vkAuth":{`,
}
errBytes, _ := json.Marshal(err)
@@ -177,6 +180,8 @@ func TestSettingsMerge(t *testing.T) {
s2.AppleAuth.ClientId = "apple_test"
s2.InstagramAuth.Enabled = true
s2.InstagramAuth.ClientId = "instagram_test"
s2.VKAuth.Enabled = true
s2.VKAuth.ClientId = "vk_test"
if err := s1.Merge(s2); err != nil {
t.Fatal(err)
@@ -265,6 +270,7 @@ func TestSettingsRedactClone(t *testing.T) {
s1.OIDC3Auth.ClientSecret = testSecret
s1.AppleAuth.ClientSecret = testSecret
s1.InstagramAuth.ClientSecret = testSecret
s1.VKAuth.ClientSecret = testSecret
s1Bytes, err := json.Marshal(s1)
if err != nil {
@@ -321,6 +327,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
s.OIDC3Auth.ClientId = "oidc3_test"
s.AppleAuth.ClientId = "apple_test"
s.InstagramAuth.ClientId = "instagram_test"
s.VKAuth.ClientId = "vk_test"
result := s.NamedAuthProviderConfigs()
@@ -350,6 +357,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
`"oidc3":{"enabled":false,"clientId":"oidc3_test"`,
`"apple":{"enabled":false,"clientId":"apple_test"`,
`"instagram":{"enabled":false,"clientId":"instagram_test"`,
`"vk":{"enabled":false,"clientId":"vk_test"`,
}
for _, p := range expectedParts {
if !strings.Contains(encodedStr, p) {