Skip to content

Commit 1cfc1b7

Browse files
committed
Remove ldap dependency
1 parent a182bd0 commit 1cfc1b7

10 files changed

Lines changed: 22 additions & 322 deletions

File tree

.github/workflows/lint.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
python-version: [3.8]
1616

1717
steps:
18-
- name: Install ldap dependencies
19-
run: sudo apt-get update && sudo apt-get install libldap2-dev libsasl2-dev
2018
- uses: actions/checkout@v2
2119
- name: Set up Python ${{ matrix.python-version }}
2220
uses: actions/setup-python@v2

requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ cffi==1.14.0
88
chardet==3.0.4
99
click==7.1.2
1010
cryptography==2.9.2
11-
csh-ldap==2.2.0
1211
dnspython==1.16.0
1312
Flask==1.1.2
1413
Flask-Migrate==2.1.1
@@ -39,13 +38,11 @@ pyOpenSSL==19.1.0
3938
python-dateutil==2.8.1
4039
python-docx==0.8.6
4140
python-editor==1.0.4
42-
python-ldap==3.0.0
4341
python-resize-image==1.1.11
4442
requests==2.23.0
4543
sentry-sdk==0.14.3
4644
six==1.14.0
4745
SQLAlchemy==1.3.17
48-
srvlookup==2.0.0
4946
toml==0.10.1
5047
urllib3==1.25.9
5148
Werkzeug==1.0.1

selections/__init__.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
from collections import defaultdict
44

5-
import csh_ldap
65
from flask import Flask
76
from flask_migrate import Migrate
87
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
@@ -23,10 +22,6 @@
2322
auth = OIDCAuthentication(app, issuer=app.config['OIDC_ISSUER'],
2423
client_registration_info=app.config['OIDC_CLIENT_CONFIG'])
2524

26-
# Create a connection to CSH LDAP
27-
_ldap = csh_ldap.CSHLDAP(
28-
app.config['LDAP_BIND_DN'], app.config['LDAP_BIND_PASS'])
29-
3025
# Sentry
3126
sentry_sdk.init(
3227
dsn=app.config['SENTRY_DSN'],
@@ -44,15 +39,15 @@
4439
from selections.blueprints.application import *
4540
from selections.blueprints.teams import *
4641

47-
from selections.utils import before_request, get_member_info
42+
from selections.utils import before_request
4843

4944

5045
@app.route('/')
5146
@auth.oidc_auth
5247
@before_request
5348
def main(info=None):
54-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
55-
is_rtp = 'rtp' in info['member_info']['group_list']
49+
is_evals = 'eboard-evaluations' in info['group_list']
50+
is_rtp = 'rtp' in info['group_list']
5651
member = Members.query.filter_by(username=info['uid']).first()
5752

5853
all_applications = Applicant.query.all()

selections/blueprints/application.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
def get_application(app_id, info=None):
1616
applicant_info = Applicant.query.filter_by(id=app_id).first()
1717
member = Members.query.filter_by(username=info['uid']).first()
18-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
19-
is_rtp = 'rtp' in info['member_info']['group_list']
18+
is_evals = 'eboard-evaluations' in info['group_list']
19+
is_rtp = 'rtp' in info['group_list']
2020
if not member and not (is_rtp or is_evals):
2121
return redirect(url_for('main'))
2222

@@ -115,8 +115,8 @@ def import_application():
115115
@auth.oidc_auth
116116
@before_request
117117
def delete_application(app_id, info=None):
118-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
119-
is_rtp = 'rtp' in info['member_info']['group_list']
118+
is_evals = 'eboard-evaluations' in info['group_list']
119+
is_rtp = 'rtp' in info['group_list']
120120
if is_evals or is_rtp:
121121
scores = Submission.query.filter_by(application=app_id).all()
122122
applicant_info = Applicant.query.filter_by(id=app_id).first()
@@ -136,8 +136,8 @@ def delete_application(app_id, info=None):
136136
@auth.oidc_auth
137137
@before_request
138138
def get_application_creation(info=None):
139-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
140-
is_rtp = 'rtp' in info['member_info']['group_list']
139+
is_evals = 'eboard-evaluations' in info['group_list']
140+
is_rtp = 'rtp' in info['group_list']
141141
if is_evals or is_rtp:
142142
return render_template('create.html', info=info)
143143
else:

selections/blueprints/teams.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
@auth.oidc_auth
1010
@before_request
1111
def get_teams(info=None):
12-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
13-
is_rtp = 'rtp' in info['member_info']['group_list']
12+
is_evals = 'eboard-evaluations' in info['group_list']
13+
is_rtp = 'rtp' in info['group_list']
1414

1515
if not is_evals and not is_rtp:
1616
flash('Not Evals or an RTP')
@@ -37,8 +37,8 @@ def get_teams(info=None):
3737
@auth.oidc_auth
3838
@before_request
3939
def create_team(info=None):
40-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
41-
is_rtp = 'rtp' in info['member_info']['group_list']
40+
is_evals = 'eboard-evaluations' in info['group_list']
41+
is_rtp = 'rtp' in info['group_list']
4242

4343
if not is_evals and not is_rtp:
4444
flash('Not Evals or an RTP')
@@ -72,8 +72,8 @@ def create_team(info=None):
7272
@auth.oidc_auth
7373
@before_request
7474
def add_to_team(team_id, info=None):
75-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
76-
is_rtp = 'rtp' in info['member_info']['group_list']
75+
is_evals = 'eboard-evaluations' in info['group_list']
76+
is_rtp = 'rtp' in info['group_list']
7777

7878
if not is_evals and not is_rtp:
7979
flash('Not Evals or an RTP')
@@ -105,8 +105,8 @@ def add_to_team(team_id, info=None):
105105
@auth.oidc_auth
106106
@before_request
107107
def remove_from_team(username, info=None):
108-
is_evals = 'eboard-evaluations' in info['member_info']['group_list']
109-
is_rtp = 'rtp' in info['member_info']['group_list']
108+
is_evals = 'eboard-evaluations' in info['group_list']
109+
is_rtp = 'rtp' in info['group_list']
110110

111111
if not is_evals and not is_rtp:
112112
return 'Not Evals or an RTP'

0 commit comments

Comments
 (0)