-
Notifications
You must be signed in to change notification settings - Fork 65
Kerberos Ticket Retrieval #64
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
Conversation
39d8e54
to
a40c71f
Compare
a40c71f
to
8d4a2a1
Compare
@T4rk1n Please review. |
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.
Please add the decorator to the method, the default exception message is not that good. 💃 when added.
dash_auth/plotly_auth.py
Outdated
headers={'Authorization': 'Bearer {}'.format(token)}, | ||
) | ||
|
||
expiry_str = res.json()['kerberos_ticket_expiry'] |
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.
There's two call to res.json()
, I would save it in a variable.
@@ -150,6 +152,21 @@ def wrap(*args, **kwargs): | |||
def check_view_access(self, oauth_token): | |||
return check_view_access(oauth_token, self._dash_app['fid']) | |||
|
|||
def get_kerberos_ticket_cache(self): |
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.
This method needs the request context since it uses flask.request
, there's a decorator I made to assert that.
Lines 14 to 22 in 70fba0d
def need_request_context(func): | |
@functools.wraps(func) | |
def _wrap(*args, **kwargs): | |
if not flask.has_request_context(): | |
raise RuntimeError('`{0}` method needs a flask/dash request' | |
' context to run. Make sure to run ' | |
'`{0}` from a callback.'.format(func.__name__)) | |
return func(*args, **kwargs) | |
return _wrap |
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.
Good idea, thanks for pointing that out.
I don't understand the failure this time, there's something about selenium. Let's look at it Tuesday. |
8d4a2a1
to
14a8d92
Compare
This isn't required by the rest of this project, but allows the user to work with the Kerberos data in an auth hook.
14a8d92
to
dc81453
Compare
Part of https://github.com/plotly/streambed/issues/9938