HOTOSM Auth Library - Python
FastAPI/Django integration for Hanko authentication with OSM OAuth support.
Installation
pip install hotosm-auth
Usage
FastAPI
from fastapi import FastAPI, Depends
from hotosm_auth.integrations.fastapi import CurrentUser
app = FastAPI()
@app.get("/me")
async def get_me(user: CurrentUser):
return {"id": user.id, "email": user.email}
Django
from django.http import JsonResponse
from hotosm_auth.integrations.django import require_auth
@require_auth
def my_view(request):
return JsonResponse({"user_id": request.user.id})
Features
- JWT validation for Hanko tokens
- OSM OAuth 2.0 integration
- User mapping between Hanko and application users
- FastAPI and Django integrations
Configuration
Set these environment variables:
HANKO_API_URL=https://login.hotosm.org
OSM_CLIENT_ID=your_osm_client_id
OSM_CLIENT_SECRET=your_osm_secret
COOKIE_SECRET=your_secret_key
License
AGPL-3.0
Metadata
Release files for hotosm-auth-dev 0.2.5
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 |
|---|---|---|---|---|
| hotosm_auth_dev-0.2.5.tar.gz | 104.8 kB | Without provenance | Details for hotosm_auth_dev-0.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hotosm_auth_dev-0.2.5-py3-none-any.whl | Python 3 | none | any | Details for hotosm_auth_dev-0.2.5-py3-none-any.whl |
Total release size: 150.9 kB
Release files / hotosm_auth_dev-0.2.5.tar.gz
| Download URL | hotosm_auth_dev-0.2.5.tar.gz |
|---|---|
| Size | 104.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b41f3d726e0a0e6c17270d38cf264376165102f4708248dff7a6dea6790748ed
|
|
BLAKE2b-256 checksum How to use checksums |
bc74624e76774ee349858ba7ed6012369460a6b806988f12edcb2f125c560bc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.17
|
Release files / hotosm_auth_dev-0.2.5-py3-none-any.whl
| Download URL | hotosm_auth_dev-0.2.5-py3-none-any.whl |
|---|---|
| Size | 46.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ac9529fd1601480cc12a716bb9db0e61263ec99c28fa3e1799dda4520d1f9a8
|
|
BLAKE2b-256 checksum How to use checksums |
caad54e9ca1efb469603b8c123f036067e27d2f02c9e787183df4c37261e467e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.17
|
Security for hotosm-auth-dev 0.2.5
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.