Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug print statements to find TypeError bug. #407

Merged
merged 1 commit into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/app/models/theq/csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def find_by_username(cls, username):
if cache.get(key):
return cache.get(key)

print("==> In Python, csr.py, find_by_username: username=" + str(username) + "; idir_id=" + str(idir_id))
csr = CSR.query.filter(CSR.deleted.is_(None)).filter(CSR.username==idir_id).first()

cache.set(key, csr)
Expand Down
1 change: 1 addition & 0 deletions api/app/resources/theq/citizen/citizen_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def get(self):
if not csr:
raise Exception('no user found with username: `{}`'.format(g.oidc_token_info['username']))
active_state = CitizenState.query.filter_by(cs_state_name="Active").first()
print("==> In Python, citizen_list.py: active_state.cs_id: " + str(active_state.cs_id) + "; active_id: " + str(active_id))
citizens = Citizen.query.filter_by(office_id=csr.office_id, cs_id=active_state.cs_id) \
.order_by(Citizen.priority) \
.join(Citizen.service_reqs).all()
Expand Down
1 change: 1 addition & 0 deletions api/app/resources/theq/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def on_join(message):
claims = jwt.get_unverified_claims(cookie)

if claims["preferred_username"]:
print("==> In Python, @socketio.on('joinRoom'): claims['preferred_username'] is: " + str(claims["preferred_username"]))
csr = CSR.find_by_username(claims["preferred_username"])
if csr:
join_room(csr.office_id)
Expand Down
2 changes: 2 additions & 0 deletions api/app/utilities/auth_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def decorated(f):
@wraps(f)
def wrapper(*args, **kwargs):
token_roles = g.oidc_token_info['realm_access']['roles']
print("==> In Python, has_any_role, roles: " + str(roles))
print(" --> token_roles: " + str(token_roles))
if any(role in token_roles for role in roles):
return f(*args, **kwargs)
abort(403)
Expand Down