mitodl / ol-infrastructure

Infrastructure automation code for use by MIT Open Learning
BSD 3-Clause "New" or "Revised" License
47 stars 4 forks source link

Superset API client to create custom roles #2682

Open shaidar opened 1 month ago

shaidar commented 1 month ago

Description/Context

Programmatically create custom Superset role definitions that we can use in conjunction with Moira groups to assign permissions to internal groups accessing the Superset UI.

Plan/Design

Using the following standard roles, create a few custom role definitions that some of our internal clients need for Superset UI access. Then, write a basic script to test out a forked Superset API client to create those new role definitions on our instance of Superset.

shaidar commented 1 month ago

Worked on the following:

shaidar commented 1 month ago

This describes the issue we're trying to solve: https://stackoverflow.com/questions/75415300/flask-appbuilder-accept-jwt-bearer-token-for-service-account

shaidar commented 1 month ago

Making a POST request to /api/v1/security/login and passing in username, password, and provider as data, results in a 401 error when trying db as provider. Trying anything else for provider apart from ldap or db throws an error that only those two providers are valid

shaidar commented 1 month ago

For now, we are going to test out defining roles in a json file and using the superset fab cli to load those as part of the superset-init container. This is similar to what is being done here. On another note, came across the following proposal which meant eventually lead to better role definitions and permission handling: https://github.com/apache/superset/issues/28377