semql-auth
Credential→identity adapters for semql.
semql threads an AuthContext (identity + roles) through
Catalog.compile(viewer=...) to enforce required_roles cube/field
visibility and security_sql row-level scoping. This package turns a
transport credential into that AuthContext:
TokenVerifier— verify a bearer token and return its claims.HMACVerifier— symmetric HS256/384/512.JWKSVerifier— asymmetric RS/ES, fetching keys from a JWKS URL (needs thejwksextra:pip install semql-auth[jwks]).
TokenMapper— map a verified credential to anAuthContext.DictMapper— static, in-memorytoken → AuthContexttable.IntrospectMapper— OAuth2 token introspection (introspectextra).X509Mapper— derive identity from an mTLS client cert subject / SAN (the reference cryptography decoder needs thex509extra).
AuthContext itself lives in semql.model — the compiler depends on it,
so it stays in the pure core. This package holds only the adapters, which
carry optional third-party dependencies (PyJWT, httpx, cryptography) that
the core shouldn't.
Install
pip install semql-auth
pip install semql-auth[jwks] # JWKS verifier (httpx)
pip install semql-auth[introspect] # OAuth2 introspection
pip install semql-auth[x509] # mTLS client cert decoder
Quick start
from semql import Catalog
from semql_auth import HMACVerifier, DictMapper
verifier = HMACVerifier(secret="...")
mapper = DictMapper({"tok-abc": ...})
# In your transport: verify the token, map to AuthContext, then
# catalog.compile(query, viewer=auth_context)
See API reference for the full adapter surface.
License
BSD-3-Clause.
Release files for semql-auth 0.7.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 | |
|---|---|---|---|
| semql_auth-0.7.0.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| semql_auth-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.2 kB
Release files / semql_auth-0.7.0.tar.gz
| Download URL | semql_auth-0.7.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa436de500c70ea4261d6d717cba53ebff0cafb87d49ed6d264f05278b66225b
|
|
BLAKE2b-256 checksum How to use checksums |
3ae9217067131a9b889b0c77b542e8f8c8d70b391134f1102bff206df651348d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency logRelease files / semql_auth-0.7.0-py3-none-any.whl
| Download URL | semql_auth-0.7.0-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7370ebf60e5a83167e1f623a4d7a17b89a9236e7c8b601ee91b94750b2d9e11c
|
|
BLAKE2b-256 checksum How to use checksums |
1d1c0428df6b3a3549dfb6b09d511e30ef090b4da810a6cebb1dbe41d33403f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency log