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

Dev/sso login ux #608

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
89f3d5b
fix (typecheck): fix typecheck issue
vaimdev Oct 17, 2024
cdeaf63
Merge branch 'master' into dev/sso_login_ux
vaimdev Oct 28, 2024
dbad147
feat: Add databricks helper class and functions
vaimdev Oct 28, 2024
799e93b
fix (refresh token, lint): Fix refresh token and lint issue
vaimdev Oct 28, 2024
e1737d8
fix (lint): fix lint issue
vaimdev Oct 29, 2024
caa7809
fix (databricks helper): fix missing function definition
vaimdev Oct 29, 2024
71c5eb1
fix (databricks helpers): fix function call namespace
vaimdev Oct 30, 2024
c187ead
wip (sso logic): Add SSO flow token verification in plot function, wh…
vaimdev Nov 5, 2024
412e944
wip (sso): fix whether to throw exception when fail to get token
vaimdev Nov 6, 2024
9283e8a
wip (sso): fix message display logic
vaimdev Nov 6, 2024
be26dee
fix (sso): fix flow
vaimdev Nov 6, 2024
5ea4841
fix (sso): fix display message flow
vaimdev Nov 6, 2024
8a482b5
fix (sso): Graph is not shown in dashboard due to only the first HTML…
vaimdev Nov 7, 2024
ab2794c
wip (sso): fix syntax error
vaimdev Nov 7, 2024
5b35284
wip (sso): debugging code
vaimdev Nov 8, 2024
8355b0f
wip (debug): add debug print
vaimdev Nov 8, 2024
1a2ab33
wip (fix): syntax error
vaimdev Nov 8, 2024
a536648
wip (debug):debugging print
vaimdev Nov 8, 2024
dd29430
wip (debug): debugging print
vaimdev Nov 8, 2024
36fcfea
wip (sso): attempt to display error in iframe
vaimdev Nov 8, 2024
4820620
wip (databricks): return error msg html in the case of plot with inva…
vaimdev Nov 8, 2024
2d6ad0b
wip (sso): display html message before throw exception
vaimdev Nov 8, 2024
05d0dff
wip(sso): fix error
vaimdev Nov 8, 2024
fd46826
wip (sso): fix syntax error
vaimdev Nov 9, 2024
4816fd6
wip (sso): clean up code
vaimdev Nov 9, 2024
bff2459
Update docstr for new/updated methods
sabizmil Nov 11, 2024
4b0b129
fix (lint): fix lint issue
vaimdev Nov 13, 2024
c048ee2
fix (doc): Add documentations
vaimdev Nov 25, 2024
6a46ca2
Merge branch 'master' into dev/sso_login_ux
vaimdev Dec 3, 2024
274126d
doc (databricks): Add documentation the docString, add changelog
vaimdev Dec 3, 2024
6ac7cb6
fix (message): Adjust the message
vaimdev Dec 4, 2024
a5779b4
fix (message): adjust message
vaimdev Dec 4, 2024
4df33e2
fix (util): revert the make_iframe function
vaimdev Dec 25, 2024
e3b1e8c
fix (util): fix make_iframe
vaimdev Dec 25, 2024
b53051a
fix (util): Fix syntax error
vaimdev Dec 25, 2024
5a14983
Merge branch 'master' into dev/sso_login_ux
vaimdev Dec 25, 2024
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and all PyGraphistry-specific breaking changes are explictly noted here.

## [Development]
### Added
* Added new wrapper function for register to Databricks via SSO, to simplify code to display on dashboard

### Fixes
* Fix refresh function does not reset some variable in memory that cause weird behavior

## [0.35.3 - 2024-12-24]

Expand Down Expand Up @@ -59,6 +64,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

* `plot(render=)` now `Union[bool, RenderMode]`, not just `bool`

* Documentation changed for databricks related docs

## [0.34.17 - 2024-10-20]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
" protocol='https',\n",
" server='hub.graphistry.com')\n",
"\n",
"# Alternatively, use SSO: \n",
"# graphistry.register_databricks_sso(api=3, server='hub.graphistry.com', org_name='my-org')\n",
"# For more options, see https://github.com/graphistry/pygraphistry#configure\n",
"\n",
"# Alternatively, use username and password: \n",
"# graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com')\n",
"# For more options, see https://github.com/graphistry/pygraphistry#configure"
Expand Down
14 changes: 14 additions & 0 deletions docs/source/server/register.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@ Register with Custom Browser Routing
client_protocol_hostname="https://my_ui_server.com"
)

Register with SSO using helper function(only for databricks, organization with Specific IdP)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: python

import graphistry

graphistry.databricks_register_sso(
api=3,
org_name="my_org_name",
idp_name="my_idp_name",
sso_opt_into_type="browser"
)

---

Best Practices
Expand Down
15 changes: 14 additions & 1 deletion graphistry/PlotterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,20 @@ def plot(
info = PyGraphistry._etl1(dataset)
elif api_version == 3:
logger.debug("3. @PloatterBase plot: PyGraphistry.org_name(): {}".format(PyGraphistry.org_name()))
PyGraphistry.refresh()

if not PyGraphistry.api_token() and PyGraphistry.sso_state(): # if it is sso login
if in_ipython() or in_databricks() or PyGraphistry._config["sso_opt_into_type"] == 'display':
PyGraphistry.sso_wait_for_token_text_display()
if not PyGraphistry.sso_verify_token_display():
from IPython.core.display import HTML
msg_html = "<strong>Invalid token due to login timeout</strong>"
return HTML(msg_html)
else:
PyGraphistry.sso_repeat_get_token()


else: # if not sso mode, just refresh to make sure token is valid
PyGraphistry.refresh()
logger.debug("4. @PloatterBase plot: PyGraphistry.org_name(): {}".format(PyGraphistry.org_name()))

dataset = self._plot_dispatch_arrow(g, n, name, description, self._style, memoize)
Expand Down
4 changes: 3 additions & 1 deletion graphistry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
ArrowFileUploader,
PyGraphistry,
from_igraph,
from_cugraph
from_cugraph,
sso_wait_for_token_display,
register_databricks_sso,
)

from graphistry.compute import (
Expand Down
Loading
Loading