Websocket Proxy
Program that contains a Proxy for KubeVirts VNC Websockets. It uses JWT Tokens for Authentication and to transfer data.
Installation
pip3 install lab-orchestrator-ws-proxy
or
docker pull biolachs2/lab_orchestrator_ws_proxy:latest
Documentation
Check out the developer documentation at websocketproxylib.readthedocs.io.
Usage
Kubernetes
Take a look at the LabOrchestrator Kubernetes Files
Manual
To start this program you need to set some environment variables first:
SECRET_KEY: Secret key that should be used for JWT token decode.LOCAL_DEV_MODE: If False, it's assumed that this is run inside Kubernetes. If True secure connections are disabled. Default: FalseHOST: The host this proxy runs on. Default: 0.0.0.0PORT: The port this proxy runs on. Default: 5001HOST_PATH_PREFIX: Prefix that is removed from the host path.KUBERNETES_SERVICE_HOST: Host where to proxy the websockets. Inside of Kubernetes this has a preset default value.KUBERNETES_SERVICE_PORT: Port where to proxy the websockets. Inside of Kubernetes this has a preset default value.LOGLEVEL: Python Loglevel to use. Default: INFO
After that run: PYTHONPATH=src python -m lab_orchestrator_ws_proxy.
The proxy works as follows:
It creates a websocket at the given host and port. Then when you want to access a VM you need to call the websocket with a path that contains the token and the VM-name divided by a slash. Example: localhost:5001/ABCTOKENDEF/ubuntu. The example contains the token ABCTOKENDEF and tries to access the VM with the name ubuntu. The token contains a list of allowed VM-names and if the given VM-name is part of the token you will be able to access the VM.
See more at: websocketproxylib.readthedocs.io.
Examples
For an example on how to use this program you can take a look at the LabOrchestrator Kubernetes Files which integrates this program into Kubernetes.
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. 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 documentation should be in the README.md and inside of the WebsocketProxyLib.
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_ws_proxy/__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.
Metadata
Release files for lab-orchestrator-ws-proxy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lab-orchestrator-ws-proxy-1.0.0.tar.gz | 9.8 kB | Without provenance | Details for lab-orchestrator-ws-proxy-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lab_orchestrator_ws_proxy-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for lab_orchestrator_ws_proxy-1.0.0-py3-none-any.whl |
Total release size: 20.0 kB
Release files / lab-orchestrator-ws-proxy-1.0.0.tar.gz
| Download URL | lab-orchestrator-ws-proxy-1.0.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee7dae2459d7387847b1568280f2f6a8149fd1ea59fd5d87a2ba53b85198dee5
|
|
BLAKE2b-256 checksum How to use checksums |
c61c1cdf20068da69fdf4551f749a31b5a96374f3387f476628ee3f798dda2d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / lab_orchestrator_ws_proxy-1.0.0-py3-none-any.whl
| Download URL | lab_orchestrator_ws_proxy-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c71ee08423b8577e771b99b554ce58b2fa634f7f33fc59dd7732691c1d193a0
|
|
BLAKE2b-256 checksum How to use checksums |
86365a874f7214356be60a6c6b11396056de74be245331022c5389b2bd4b2f39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for lab-orchestrator-ws-proxy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.