Skip to content

Commit 2883c0c

Browse files
committed
ref(ldap): remove LDAP temporarily
LDAP poses a problem with the upgrade path to Django 1.9 as the modules involved are not compatible. Removing until we have a better identity and federation story. And the django plugin works again Ref #207
1 parent c938c91 commit 2883c0c

4 files changed

Lines changed: 0 additions & 66 deletions

File tree

rootfs/build.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ apk add --update-cache \
1616
curl \
1717
libffi-dev \
1818
libpq \
19-
openldap \
20-
openldap-dev \
2119
postgresql-dev \
2220
python \
2321
python-dev
@@ -42,7 +40,6 @@ apk del --purge \
4240
build-base \
4341
curl \
4442
libffi-dev \
45-
openldap-dev \
4643
postgresql-dev \
4744
python-dev
4845
rm -rf /var/cache/apk/*

rootfs/deis/settings.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import string
99
import sys
1010
import tempfile
11-
import ldap
12-
13-
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
1411

1512

1613
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
@@ -131,7 +128,6 @@
131128
'django.contrib.sites',
132129
'django.contrib.staticfiles',
133130
# Third-party apps
134-
'django_auth_ldap',
135131
'guardian',
136132
'jsonfield',
137133
'gunicorn',
@@ -145,7 +141,6 @@
145141
)
146142

147143
AUTHENTICATION_BACKENDS = (
148-
"django_auth_ldap.backend.LDAPBackend",
149144
"django.contrib.auth.backends.ModelBackend",
150145
"guardian.backends.ObjectPermissionBackend",
151146
)
@@ -342,16 +337,6 @@
342337
# server - Hostname based on CoreOS server hostname
343338
UNIT_HOSTNAME = 'default'
344339

345-
# LDAP DEFAULT SETTINGS (Overrided by confd later)
346-
LDAP_ENDPOINT = ""
347-
BIND_DN = ""
348-
BIND_PASSWORD = ""
349-
USER_BASEDN = ""
350-
USER_FILTER = ""
351-
GROUP_BASEDN = ""
352-
GROUP_FILTER = ""
353-
GROUP_TYPE = ""
354-
355340
# Create a file named "local_settings.py" to contain sensitive settings data
356341
# such as database configuration, admin email, or passwords and keys. It
357342
# should also be used for any settings which differ between development
@@ -367,36 +352,3 @@
367352
if os.path.exists('/templates/confd_settings.py'):
368353
sys.path.append('/templates')
369354
from confd_settings import * # noqa
370-
371-
# LDAP Backend Configuration
372-
# Should be always after the confd_settings import.
373-
LDAP_USER_SEARCH = LDAPSearch(
374-
base_dn=USER_BASEDN,
375-
scope=ldap.SCOPE_SUBTREE,
376-
filterstr="(%s=%%(user)s)" % USER_FILTER
377-
)
378-
LDAP_GROUP_SEARCH = LDAPSearch(
379-
base_dn=GROUP_BASEDN,
380-
scope=ldap.SCOPE_SUBTREE,
381-
filterstr="(%s=%s)" % (GROUP_FILTER, GROUP_TYPE)
382-
)
383-
AUTH_LDAP_SERVER_URI = LDAP_ENDPOINT
384-
AUTH_LDAP_BIND_DN = BIND_DN
385-
AUTH_LDAP_BIND_PASSWORD = BIND_PASSWORD
386-
AUTH_LDAP_USER_SEARCH = LDAP_USER_SEARCH
387-
AUTH_LDAP_GROUP_SEARCH = LDAP_GROUP_SEARCH
388-
AUTH_LDAP_GROUP_TYPE = GroupOfNamesType()
389-
AUTH_LDAP_USER_ATTR_MAP = {
390-
"first_name": "givenName",
391-
"last_name": "sn",
392-
"email": "mail",
393-
"username": USER_FILTER,
394-
}
395-
AUTH_LDAP_GLOBAL_OPTIONS = {
396-
ldap.OPT_X_TLS_REQUIRE_CERT: False,
397-
ldap.OPT_REFERRALS: False
398-
}
399-
AUTH_LDAP_ALWAYS_UPDATE_USER = True
400-
AUTH_LDAP_MIRROR_GROUPS = True
401-
AUTH_LDAP_FIND_GROUP_PERMS = True
402-
AUTH_LDAP_CACHE_GROUPS = False

rootfs/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ django-cors-headers==1.0.0
66
django-fsm==2.2.0
77
django-guardian==1.2.5
88
jsonfield==1.0.3
9-
django-auth-ldap==1.2.5
109
djangorestframework==3.0.5
1110
docker-py==1.6.0
1211
gunicorn==19.3.0
1312
psycopg2==2.6.1
1413
python-etcd==0.3.2
15-
python-ldap==2.4.19
1614
PyYAML==3.11
1715
requests==2.8.1
1816
simpleflock==0.0.2

rootfs/templates/confd_settings.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,3 @@
2020
{{ if exists "/deis/controller/subdomain" }}
2121
DEIS_RESERVED_NAMES = ['{{ getv "/deis/controller/subdomain" }}']
2222
{{ end }}
23-
24-
# AUTH
25-
# LDAP
26-
{{ if exists "/deis/controller/auth/ldap/endpoint" }}
27-
LDAP_ENDPOINT = '{{ if exists "/deis/controller/auth/ldap/endpoint" }}{{ getv "/deis/controller/auth/ldap/endpoint"}}{{ else }} {{ end }}'
28-
BIND_DN = '{{ if exists "/deis/controller/auth/ldap/bind/dn" }}{{ getv "/deis/controller/auth/ldap/bind/dn"}}{{ else }} {{ end }}'
29-
BIND_PASSWORD = '{{ if exists "/deis/controller/auth/ldap/bind/password" }}{{ getv "/deis/controller/auth/ldap/bind/password"}}{{ else }} {{ end }}'
30-
USER_BASEDN = '{{ if exists "/deis/controller/auth/ldap/user/basedn" }}{{ getv "/deis/controller/auth/ldap/user/basedn"}}{{ else }} {{ end }}'
31-
USER_FILTER = '{{ if exists "/deis/controller/auth/ldap/user/filter" }}{{ getv "/deis/controller/auth/ldap/user/filter"}}{{ else }} {{ end }}'
32-
GROUP_BASEDN = '{{ if exists "/deis/controller/auth/ldap/group/basedn" }}{{ getv "/deis/controller/auth/ldap/group/basedn"}}{{ else }} {{ end }}'
33-
GROUP_FILTER = '{{ if exists "/deis/controller/auth/ldap/group/filter" }}{{ getv "/deis/controller/auth/ldap/group/filter"}}{{ else }} {{ end }}'
34-
GROUP_TYPE = '{{ if exists "/deis/controller/auth/ldap/group/type" }}{{ getv "/deis/controller/auth/ldap/group/type"}}{{ else }} {{ end }}'
35-
{{ end }}

0 commit comments

Comments
 (0)