tCell Hooks is to be used in conjuction with the tcell_agent to allow for custom event notifications of login failures and login successes.
Getting started
You can add it to your requirements.txt file with:
tcell_hooks
Then run pip install -r requirements.txt
There are two options for calling the hooks from your application code:
By providing a Django/Flask request object and having the tCell Agent extract the relevant details from it:
from tcell_hooks.v1 import send_django_login_event, LOGIN_SUCCESS
send_django_login_event(
status=LOGIN_SUCCESS,
django_request=request,
user_id="tcell@tcell.io",
session_id="124KDJFL3234"
)
from tcell_hooks.v1 import send_flask_login_event, LOGIN_SUCCESS
send_flask_login_event(
status=LOGIN_SUCCESS,
flask_request=request,
user_id="tcell@tcell.io",
session_id="124KDJFL3234"
)
Or by providing each individual piece of information required for the tCell event:
from tcell_hooks.v1 import send_login_event, LOGIN_SUCCESS
send_login_event(
status=LOGIN_SUCCESS,
session_id="124KDJFL3234",
user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) ...",
referrer="http://192.168.99.100:3000/",
remote_address="192.168.99.1",
header_keys=["HOST", "USER_AGENT", "ACCEPT", "REFERER", "ACCEPT_ENCODING", "ACCEPT_LANGUAGE", "COOKIE"],
user_id="tcell@tcell.io",
document_uri="/users/auth/doorkeeper/callbackuri"
)
The available statuses are:
LOGIN_SUCCESS
LOGIN_FAILURE
Important Note
If the tcell_agent is not installed or if it's disabled, this code will do nothing and should have no performance effect on your app.
Metadata
Release files for tcell-hooks 1.1.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 |
|---|---|---|---|---|
| tcell_hooks-1.1.0.tar.gz | 2.5 kB | Without provenance | Details for tcell_hooks-1.1.0.tar.gz |
Release files / tcell_hooks-1.1.0.tar.gz
| Download URL | tcell_hooks-1.1.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77bc9fb93211c2a310289afc291aad4661c9680dd162c4e4720a8dfe70ee5370
|
|
BLAKE2b-256 checksum How to use checksums |
d8d1c4dc96d33ab95c5998c9c900351379831ad5430716b53c773595b8d7b8e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.10
|
Security for tcell-hooks 1.1.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.