mirror of https://github.com/zulip/zulip.git
auth: Add GitHub to list of reported backends.
This commit is contained in:
parent
45b2b25026
commit
54b899860d
|
@ -1178,7 +1178,7 @@ class FetchAuthBackends(ZulipTestCase):
|
|||
self.assert_json_success(result)
|
||||
data = ujson.loads(result.content)
|
||||
self.assertEqual(set(data.keys()),
|
||||
{'msg', 'password', 'google', 'dev', 'result', 'zulip_version'})
|
||||
{'msg', 'password', 'github', 'google', 'dev', 'result', 'zulip_version'})
|
||||
for backend in set(data.keys()) - {'msg', 'result', 'zulip_version'}:
|
||||
self.assertTrue(isinstance(data[backend], bool))
|
||||
|
||||
|
@ -1192,6 +1192,7 @@ class FetchAuthBackends(ZulipTestCase):
|
|||
self.assertEqual(data, {
|
||||
'msg': '',
|
||||
'password': False,
|
||||
'github': False,
|
||||
'google': True,
|
||||
'dev': True,
|
||||
'result': 'success',
|
||||
|
@ -1207,6 +1208,7 @@ class FetchAuthBackends(ZulipTestCase):
|
|||
self.assertEqual(data, {
|
||||
'msg': '',
|
||||
'password': False,
|
||||
'github': False,
|
||||
'google': True,
|
||||
'dev': True,
|
||||
'result': 'success',
|
||||
|
@ -1229,6 +1231,7 @@ class FetchAuthBackends(ZulipTestCase):
|
|||
self.assertEqual(data, {
|
||||
'msg': '',
|
||||
'password': False,
|
||||
'github': False,
|
||||
'google': False,
|
||||
'dev': True,
|
||||
'result': 'success',
|
||||
|
@ -1249,6 +1252,7 @@ class FetchAuthBackends(ZulipTestCase):
|
|||
self.assertEqual(data, {
|
||||
'msg': '',
|
||||
'password': False,
|
||||
'github': False,
|
||||
'google': False,
|
||||
'dev': True,
|
||||
'result': 'success',
|
||||
|
|
|
@ -29,8 +29,8 @@ from zerver.lib.validator import validate_login_email
|
|||
from zerver.models import PreregistrationUser, UserProfile, remote_user_to_email, Realm
|
||||
from zerver.views.registration import create_preregistration_user, get_realm_from_request, \
|
||||
redirect_and_log_into_subdomain
|
||||
from zproject.backends import password_auth_enabled, dev_auth_enabled, google_auth_enabled, \
|
||||
ldap_auth_enabled
|
||||
from zproject.backends import password_auth_enabled, dev_auth_enabled, \
|
||||
github_auth_enabled, google_auth_enabled, ldap_auth_enabled
|
||||
from version import ZULIP_VERSION
|
||||
|
||||
import hashlib
|
||||
|
@ -510,6 +510,7 @@ def api_get_auth_backends(request):
|
|||
realm = None
|
||||
return json_success({"password": password_auth_enabled(realm),
|
||||
"dev": dev_auth_enabled(realm),
|
||||
"github": github_auth_enabled(realm),
|
||||
"google": google_auth_enabled(realm),
|
||||
"zulip_version": ZULIP_VERSION,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue