-
Notifications
You must be signed in to change notification settings - Fork 18
Add CAS Auth Type #927
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
Add CAS Auth Type #927
Conversation
Codecov Report
@@ Coverage Diff @@
## master #927 +/- ##
==========================================
- Coverage 90.2% 90.13% -0.07%
==========================================
Files 48 48
Lines 6419 6458 +39
==========================================
+ Hits 5790 5821 +31
- Misses 629 637 +8
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good; few small changes. I have not tested this myself 🙂
api/auth/authproviders.py
Outdated
} | ||
|
||
def validate_user(self, token): | ||
config.log.warning('the config is {}\n\n'.format(self.config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove when you're ready to merge, or add more text to specify
tree = ElementTree.fromstring(response) | ||
|
||
# check to see if xml response labeled request as success | ||
if tree[0].tag.endswith('authenticationSuccess'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to where this logic is sourced from - just a github link to cas library source is fine.
api/auth/authproviders.py
Outdated
raise APIAuthProviderException('Auth provider ticket verification unsuccessful.') | ||
|
||
if not username: | ||
raise APIAuthProviderException('Auth provider did not provide username') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will these two exceptions be client-visible? Maybe remove "auth provider" from verbiage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use that generically throughout AuthProviders but it is not shown to the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this line has been removed.
4fbc4df
to
f0d7db9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments addressed
@nagem Environmental var |
self.abort(401, 'Inactivity timeout') | ||
|
||
# set last_seen to now | ||
config.db.authtokens.update_one({'_id': cached_token['_id']}, {'$set': {'last_seen': timestamp}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have assumed that the user's last_seen
is always getting updated on every request. Are you sure it needs to be set here? If so, was it not being updated elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds CAS Auth type support
Breaking Changes
None
Review Checklist