[#2534] added Instagram OAuth2 provider

Co-authored-by: Pedro Costa <550684+pnmcosta@users.noreply.github.com>
This commit is contained in:
Gani Georgiev
2023-05-23 22:37:44 +03:00
parent 728427cecf
commit a6bb1bf096
9 changed files with 107 additions and 4 deletions

View File

@@ -67,6 +67,8 @@ func TestSettingsValidate(t *testing.T) {
s.OIDC3Auth.ClientId = ""
s.AppleAuth.Enabled = true
s.AppleAuth.ClientId = ""
s.InstagramAuth.Enabled = true
s.InstagramAuth.ClientId = ""
// check if Validate() is triggering the members validate methods.
err := s.Validate()
@@ -105,6 +107,7 @@ func TestSettingsValidate(t *testing.T) {
`"oidc2Auth":{`,
`"oidc3Auth":{`,
`"appleAuth":{`,
`"instagramAuth":{`,
}
errBytes, _ := json.Marshal(err)
@@ -172,6 +175,8 @@ func TestSettingsMerge(t *testing.T) {
s2.OIDC3Auth.ClientId = "oidc3_test"
s2.AppleAuth.Enabled = true
s2.AppleAuth.ClientId = "apple_test"
s2.InstagramAuth.Enabled = true
s2.InstagramAuth.ClientId = "instagram_test"
if err := s1.Merge(s2); err != nil {
t.Fatal(err)
@@ -259,6 +264,7 @@ func TestSettingsRedactClone(t *testing.T) {
s1.OIDC2Auth.ClientSecret = testSecret
s1.OIDC3Auth.ClientSecret = testSecret
s1.AppleAuth.ClientSecret = testSecret
s1.InstagramAuth.ClientSecret = testSecret
s1Bytes, err := json.Marshal(s1)
if err != nil {
@@ -314,6 +320,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
s.OIDC2Auth.ClientId = "oidc2_test"
s.OIDC3Auth.ClientId = "oidc3_test"
s.AppleAuth.ClientId = "apple_test"
s.InstagramAuth.ClientId = "instagram_test"
result := s.NamedAuthProviderConfigs()
@@ -342,6 +349,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
`"oidc2":{"enabled":false,"clientId":"oidc2_test"`,
`"oidc3":{"enabled":false,"clientId":"oidc3_test"`,
`"apple":{"enabled":false,"clientId":"apple_test"`,
`"instagram":{"enabled":false,"clientId":"instagram_test"`,
}
for _, p := range expectedParts {
if !strings.Contains(encodedStr, p) {