license enforcement

* add rebrand and auth_enterprise feature to license
* enforce auth_enterprise by not surfacing auth callback info at /auth
endpoint
This commit is contained in:
Chris Meyers
2015-10-08 17:18:15 -04:00
parent 3b961cf4f2
commit ad383ebccc
2 changed files with 20 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ from awx.api.utils.decorators import paginated
from awx.api.filters import MongoFilterBackend
from awx.api.generics import get_view_name
from awx.api.generics import * # noqa
from awx.api.license import feature_enabled, LicenseForbids
from awx.api.license import feature_enabled, feature_exists, LicenseForbids
from awx.main.models import * # noqa
from awx.main.utils import * # noqa
from awx.api.permissions import * # noqa
@@ -527,6 +527,11 @@ class AuthView(APIView):
data = SortedDict()
err_backend, err_message = request.session.get('social_auth_error', (None, None))
for name, backend in load_backends(settings.AUTHENTICATION_BACKENDS).items():
if (not feature_exists('enterprise_auth') and
not feature_enabled('ldap')) or \
(not feature_enabled('enterprise_auth') and
name in ['saml', 'radius']):
continue
login_url = reverse('social:begin', args=(name,))
complete_url = request.build_absolute_uri(reverse('social:complete', args=(name,)))
backend_data = {