Skip to content

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

Merged
merged 2 commits into from
Oct 11, 2018
Merged

Kerberos Ticket Retrieval #64

merged 2 commits into from
Oct 11, 2018

Conversation

scjody
Copy link
Contributor

@scjody scjody commented Sep 25, 2018

Part of https://github.com/plotly/streambed/issues/9938

  • Tested end to end with a proof of concept Dash App

@scjody scjody force-pushed the kerberos-ticket-retrieval branch 4 times, most recently from 39d8e54 to a40c71f Compare September 27, 2018 19:34
@scjody scjody force-pushed the kerberos-ticket-retrieval branch from a40c71f to 8d4a2a1 Compare October 5, 2018 22:01
@scjody scjody changed the title Kerberos Ticket Retrieval - WIP Kerberos Ticket Retrieval Oct 5, 2018
@scjody scjody requested a review from T4rk1n October 5, 2018 22:02
@scjody
Copy link
Contributor Author

scjody commented Oct 5, 2018

@T4rk1n Please review.

@scjody
Copy link
Contributor Author

scjody commented Oct 5, 2018

@T4rk1n Also do you have any idea what's going wrong with the tests? If not could we look at this together on Tuesday? I've rebased on master so I have #65 already.

Copy link
Contributor

@T4rk1n T4rk1n left a 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.

headers={'Authorization': 'Bearer {}'.format(token)},
)

expiry_str = res.json()['kerberos_ticket_expiry']
Copy link
Contributor

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):
Copy link
Contributor

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.

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

Copy link
Contributor Author

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.

@T4rk1n
Copy link
Contributor

T4rk1n commented Oct 5, 2018

I don't understand the failure this time, there's something about selenium. Let's look at it Tuesday.

@scjody scjody force-pushed the kerberos-ticket-retrieval branch from 8d4a2a1 to 14a8d92 Compare October 9, 2018 19:42
This isn't required by the rest of this project, but allows the user to
work with the Kerberos data in an auth hook.
@scjody scjody force-pushed the kerberos-ticket-retrieval branch from 14a8d92 to dc81453 Compare October 11, 2018 17:03
@scjody scjody merged commit fe79307 into master Oct 11, 2018
@scjody scjody deleted the kerberos-ticket-retrieval branch October 11, 2018 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants