[#3948] added Bitbucket OAuth2 provider
Co-authored-by: aabajyan <arsen.abajyan@pm.me>
This commit is contained in:
@@ -78,6 +78,8 @@ func TestSettingsValidate(t *testing.T) {
|
||||
s.PatreonAuth.ClientId = ""
|
||||
s.MailcowAuth.Enabled = true
|
||||
s.MailcowAuth.ClientId = ""
|
||||
s.BitbucketAuth.Enabled = true
|
||||
s.BitbucketAuth.ClientId = ""
|
||||
|
||||
// check if Validate() is triggering the members validate methods.
|
||||
err := s.Validate()
|
||||
@@ -121,6 +123,7 @@ func TestSettingsValidate(t *testing.T) {
|
||||
`"yandexAuth":{`,
|
||||
`"patreonAuth":{`,
|
||||
`"mailcowAuth":{`,
|
||||
`"bitbucketAuth":{`,
|
||||
}
|
||||
|
||||
errBytes, _ := json.Marshal(err)
|
||||
@@ -198,6 +201,8 @@ func TestSettingsMerge(t *testing.T) {
|
||||
s2.PatreonAuth.ClientId = "patreon_test"
|
||||
s2.MailcowAuth.Enabled = true
|
||||
s2.MailcowAuth.ClientId = "mailcow_test"
|
||||
s2.BitbucketAuth.Enabled = true
|
||||
s2.BitbucketAuth.ClientId = "bitbucket_test"
|
||||
|
||||
if err := s1.Merge(s2); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -290,6 +295,7 @@ func TestSettingsRedactClone(t *testing.T) {
|
||||
s1.YandexAuth.ClientSecret = testSecret
|
||||
s1.PatreonAuth.ClientSecret = testSecret
|
||||
s1.MailcowAuth.ClientSecret = testSecret
|
||||
s1.BitbucketAuth.ClientSecret = testSecret
|
||||
|
||||
s1Bytes, err := json.Marshal(s1)
|
||||
if err != nil {
|
||||
@@ -350,6 +356,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
|
||||
s.YandexAuth.ClientId = "yandex_test"
|
||||
s.PatreonAuth.ClientId = "patreon_test"
|
||||
s.MailcowAuth.ClientId = "mailcow_test"
|
||||
s.BitbucketAuth.ClientId = "bitbucket_test"
|
||||
|
||||
result := s.NamedAuthProviderConfigs()
|
||||
|
||||
@@ -383,6 +390,7 @@ func TestNamedAuthProviderConfigs(t *testing.T) {
|
||||
`"yandex":{"enabled":false,"clientId":"yandex_test"`,
|
||||
`"patreon":{"enabled":false,"clientId":"patreon_test"`,
|
||||
`"mailcow":{"enabled":false,"clientId":"mailcow_test"`,
|
||||
`"bitbucket":{"enabled":false,"clientId":"bitbucket_test"`,
|
||||
}
|
||||
for _, p := range expectedParts {
|
||||
if !strings.Contains(encodedStr, p) {
|
||||
|
||||
Reference in New Issue
Block a user