xyberos-auth
Auth plugin — RFC-0019, M9. OAuth 2.0, OpenID Connect, and JWT, with
Auth0 / Okta / Microsoft Entra presets. All stdlib (urllib + hmac); RS256
uses lazy cryptography.
Install
pip install -e ./auth
JWT
from xyberos_auth import JwtCodec
codec = JwtCodec("a-shared-secret")
token = codec.encode({"sub": "user-1"}, ttl=3600)
codec.decode(token, verify=True) # raises AuthError on tamper/expiry
Or through the plugin (HS256 via AUTH_JWT_SECRET):
from xyberos import create_app
from xyberos_auth import AuthPlugin
app = create_app()
app.load_plugin(AuthPlugin(secret="dev-secret"))
app.tools.execute("jwt_sign", None, payload={"sub": "user-1"}, ttl=600)
app.tools.execute("jwt_verify", None, token=token)
OAuth2 / OIDC
from xyberos_auth import OAuth2Client, build_oidc
oauth2 = OAuth2Client("cid", "csecret",
authorize_url="https://idp/authorize",
token_url="https://idp/token", scope="openid profile")
url = oauth2.authorization_url(state="abc")
tokens = oauth2.exchange_code("code")
oidc = build_oidc("auth0", client_id="cid", client_secret="csecret", tenant="myco")
user = oidc.userinfo(tokens["access_token"])
claims = oidc.verify_id_token(tokens.get("id_token", ""))
Presets: auth0 ({tenant}), okta ({org}), entra ({tenant}).
Tests
pip install pytest
pytest tests/
Transport-injectable (OAuth2/OIDC) + real HMAC/RSA JWT tests (skip RS256 when
cryptography is absent).
Ship location
Plugin (xyberos.plugins entry point) — enterprise auth (M9).
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 xyberos_auth-0.1.0.tar.gz.
File metadata
- Download URL: xyberos_auth-0.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe8a1c0086f288d6ed6c2f2eef25e76b0ada289d38007d52a8f09d0bfa4448a
|
|
| MD5 |
63d5d3d88f0163ca7fbd8b9b2d311333
|
|
| BLAKE2b-256 |
6b9218b57da26484b2a34d79e245d4efb6c4450055e1ddf2e395bde257fb88bc
|
File details
Details for the file xyberos_auth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xyberos_auth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af1f882e5d3f5a2189b30a5119ca5d689b1e1d4e28109ee39b93925ac83e07bd
|
|
| MD5 |
b277e2c181b768e63c79a90106be139c
|
|
| BLAKE2b-256 |
175f5ce599f7987f04ba94eea3725da1479be6469f26784572a4340ccb4ec05b
|