TecoRoute Proxy
TecoRoute Proxy is a reverse proxy server that allows easy authentication to the TecoRoute service using a simple POST request. It also saves the credentials and automatically logs the user in when the TecoRoute session expires.
How it works
The server has one control endpoint (/TR_PROXY by default) that is used
to log in and log out of the user from the proxy. All other requests are proxied
to TecoRoute. The proxy session is stored only in the user's session cookies, so
the server is completely stateless and no database is required.
The control endpoint accepts POST requests with
application/x-www-form-urlencoded content type (HTML form).
Log the user in
The user logs in with the following data:
| Name | Value |
|---|---|
action |
login |
username |
TecoRoute username |
password |
TecoRoute password |
plc |
TecoRoute PLC |
Example of a HTML form that logs the user in:
<form method="post" action="https://tecoroute-proxy.cze.tech/TR_PROXY">
<button name="action" value="login">Open PLC</button>
<input type="hidden" name="username" value="BroukPytlik" />
<input type="hidden" name="password" value="ferda1" />
<input type="hidden" name="plc" value="AB_1234" />
</form>
Log the user out
The user logs out with the following data:
| Name | Value |
|---|---|
action |
logout |
Example of a HTML form that logs the user out:
<form method="post" action="https://tecoroute-proxy.cze.tech/TR_PROXY">
<button name="action" value="logout">Logout from TecoRoute</button>
</form>
Logging out will try to log the user out from TecoRoute and delete the login data from the user's cookies.
Usage options
TecoRoute Proxy can be used as a service, standalone application or as a Python library.
Use as a service
Server is deployed at https://tecoroute-proxy.cze.tech. The control URL is:
https://tecoroute-proxy.cze.tech/TR_PROXY
Feel free to use the service for testing or simple production purposes.
Install from PyPI
Requirements:
Installation using pip is done with:
pip install tecoroute-proxy
Start the server with:
tecoroute-proxy
On an unprivileged port (e.g. 8080), start the server with:
tecoroute-proxy -p 8080
For all options, run tecoroute-proxy --help.
It is possible to use the package as a Python library and run the server synchronously or asynchronously in the event loop. Example of use:
from logging import INFO, basicConfig
from tecoroute_proxy import ProxyServer
basicConfig(level=INFO)
server = ProxyServer(port=8080)
server.run()
See full documentation at https://tecoroute-proxy.readthedocs.io.
Run from Docker Hub
Run the image from Docker Hub:
docker run -p 80:80 czetech/tecoroute-proxy
Install to Kubernetes using Helm
Setup Helm repository:
helm repo add czetech https://charts.cze.tech/
Install Helm chart:
helm install tecoroute-proxy czetech/tecoroute-proxy \
--set ingress.enabled=true \
--set ingress.hosts[0]=<ingress-host>
see the chart for more options.
Source code
The source code is available at https://github.com/czetech/tecoroute-proxy.
Metadata
Release files for tecoroute-proxy 0.3.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 | |
|---|---|---|---|---|
| tecoroute-proxy-0.3.0.tar.gz | 11.3 kB | Without provenance | Details |
Release files / tecoroute-proxy-0.3.0.tar.gz
| Download URL | tecoroute-proxy-0.3.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7bf1bbeecf9448214942e7ed220729ed98f1c4b21a0c053221c7e82d75ee3b1
|
|
BLAKE2b-256 checksum How to use checksums |
63cf10febe3b546c096642ba7e4c1aebb4571b1fbee7ed9d88384503c3a30f87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1
|
Security for tecoroute-proxy 0.3.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.