Authentication module for lab-orchestrator-lib.
Project description
Lab Orchestrator Lib Auth
This package contains the lab orchestrator library authentication module.
Installation
pip3 install lab-orchestrator-lib-auth
Documentation
Check out the developer documentation at laborchestratorlib-auth.readthedocs.io.
Usage
The library contains one module called auth that contains 3 methods and one dataclass.
The first method generate_auth_token is used to generate a JWT token. The token contains the user id, and some information about the lab instance for which this token is created. That also contains a list of vmi_names the user should be allowed to connect to. HS256 is used as algorithm which is a symmetric algorithm, so you need to use the same secret for both: encryption and decryption of the key.
The next method decode_auth_token decodes the previously encoded JWT token. It returns the information that is contained in the token.
The third method verify_auth_token contains the parameter vmi_name and checks if this vmi_name is allowed. If it's not allowed the method will return none.
See more at: laborchestratorlib-auth.readthedocs.io.
Examples
There is one example that shows how to create a token with the library. For other examples you need to look into the LabOrchestratorLib or WebsocketProxy.
Contributing
Issues
Feel free to open issues.
Project Structure
The src folder contains the source code of the library. The tests folder contains the test cases. examples contains some example scripts of how to use the library. There is a makefile that contains some shortcuts for example to run the test cases and to make a release. Run make help to see all targets. The docs folder contains rst docs that are used in read the docs.
Developer Dependencies
- Python 3.8
- Make
pip install -r requirements.txtpip install -r requirements-dev.txt
Releases
Your part:
- Create branch for your feature (
issue/ISSUE_ID-SHORT_DESCRIPTION) - Code
- Make sure test cases are running and add new ones for your feature
- Create MR into master
- Increase version number in
src/lab_orchestrator_lib_auth/__init__.py(semantic versioning)
Admin part:
- Check and accept MR
- Merge MR
- Run
make release
Docs
To generate the docs run: cd docs && make html.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lab-orchestrator-lib-auth-1.0.0.tar.gz.
File metadata
- Download URL: lab-orchestrator-lib-auth-1.0.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc84bf2e41e842de844e05faba01108bc045815e6ae522312b31a351ea2c03dd
|
|
| MD5 |
8b5a5b518e85f83596521d559eca205d
|
|
| BLAKE2b-256 |
3b0a76fd8d3720a796df1820c19ad203d590dc1039c2d742eae1fe5b44c5bc59
|
File details
Details for the file lab_orchestrator_lib_auth-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lab_orchestrator_lib_auth-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61896f4dfa8d1ef61ce891cf029e53bdf8dffdf6ee064bbca9f04a75058581fb
|
|
| MD5 |
0e67ff45ac38cdc93e94063bc542e28e
|
|
| BLAKE2b-256 |
f188902f499aa2443e1aaf8827da9895361456d5567c961ccc818966842c998c
|