A plugin module for authenticate in different scopes using Python Jupyter Notebook as base and a given IDP.
The project is structured as follows:
/jupyterAuth
- Contains all source code./tests
- Contains all unit tests (unittest).requirements.txt
- This file contains all the modules required for the application.pyproject.toml
- This file contains the instructions for build the module when will be imported frompip
README.md
- This file, contains internal developer documentation.
- Python >= 3.10
All parameters for create an Authorizer
object are:
- Instantiation argument: <oauth address endpoint> , <scope> , <disable https> , <service host>
- oauth address endpoint (required - string): The address of the IDP endopoint that provide the authentication
- scope (required - string): The service that you want to authenticate e.g.
"kafka"
,"opensearch"
- disable https (required - bool): If
True
authentication credentials will be transferred by HTTP - service host (optional - string): The address of the service that you want to authenticate (only for
"opensearch"
)
All parameters for use an Authorizer
with getJWToken
and getOauth2
are:
- Function argument: <username> , <password>
- username (required - string)
- password (required - string)
To create an Authorizer
object pre-setted within Kafka in local environment (using HTTP) without using Prometheus:
authorizer_object = Authorizer("http://localhost:1852/realms/local-development/protocol/openid-connect/token", "kafka", True)
To use the Authorizer
for get a JWToken given the credentials
token = authorizer_object.getJWToken("username", "password")
- Can work in local environment with HTTP and so the authentication credentials will be transferred in plaintext.