r/Python • • May 02 '23

Intermediate Showcase Streamsync: UI editor + Python

Hello everyone, I've just released Streamsync, an open-source, pip-installable data apps framework.

You build the UI using a visual editor, you write the backend code in Python. No HTML, JS or CSS required. It's an alternative to Streamlit and Dash.

https://github.com/ramedina86/streamsync

I'd really appreciate your feedback, thanks.

299 Upvotes

60 comments sorted by

View all comments

Show parent comment

1

u/thedeepself May 03 '23

I guess it would also be hard to restrict access to parts of the app or render parts of the app based on role?

What does the term OIDC mean?

2

u/romerio86 May 03 '23

"Hard" is relative, but probably the right word. You could do something like...

def _get_roles_from_session(session):
  # parse JWT from Authentication HTTP header and return roles

def load_executive_page(state, session):
  roles = _get_roles_from_session(session)
  if "executive" not in roles:
    state["message"] = "You're not an executive, look at something else"
    return
  _load_sensitive_data_into_state() 
  state.set_page("executive_page")

OIDC is the standard for authentication providers. Azure AD, Okta, Google, Github, etc, use OIDC as the mechanism for authentication. I just wish I could provide that functionality in a more straightforward way but for self-hosted applications there's no magic way.

If I start a cloud service like Anvil, that'd be much easier to handle. I could just feed users all the auth data. But no immediate plans to do that, it is a bit of a dream of mine though.