GGID IAM Platform Python SDK — JWT verification, RBAC, user management
Project description
GGID Python SDK
Python SDK for GGID IAM Platform — JWT verification, user management, and RBAC permission checking.
Features
- JWT Verification: Verify RS256 JWTs from GGID Gateway with JWKS caching
- FastAPI Middleware: Drop-in authentication for FastAPI apps
- Django Middleware: Authentication decorator for Django views
- Flask Decorator:
@requires_authdecorator for Flask routes - Permission Checking: Check user roles and permissions via GGID Policy API
- User Management: CRUD operations via GGID Identity API
- Async Support: Full async/await support with httpx
Installation
pip install ggid
Quick Start
FastAPI
from fastapi import FastAPI, Depends
from ggid import GGIDMiddleware, get_current_user
app = FastAPI()
app.add_middleware(
GGIDMiddleware,
gateway_url="https://iam.example.com",
jwks_url="https://iam.example.com/.well-known/jwks.json",
tenant_id="00000000-0000-0000-0000-000000000001",
)
@app.get("/profile")
async def profile(user = Depends(get_current_user)):
return {"user": user}
Flask
from flask import Flask, jsonify
from ggid.flask import requires_auth
app = Flask(__name__)
app.config["GGID_GATEWAY_URL"] = "https://iam.example.com"
app.config["GGID_TENANT_ID"] = "00000000-0000-0000-0000-000000000001"
@app.route("/profile")
@requires_auth
def profile(user):
return jsonify({"user": user})
Django
# settings.py
GGID_GATEWAY_URL = "https://iam.example.com"
GGID_TENANT_ID = "00000000-0000-0000-0000-000000000001"
# views.py
from ggid.django import ggid_login_required
@ggid_login_required
def profile(request):
return JsonResponse({"user": request.ggid_user})
Permission Check
from ggid import GGIDClient
client = GGIDClient(
gateway_url="https://iam.example.com",
tenant_id="00000000-0000-0000-0000-000000000001",
)
# Check if user can perform action on resource
allowed = await client.check_permission(
user_id="abc-123",
resource="documents:sensitive",
action="read",
)
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
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 ggid-1.0.2.tar.gz.
File metadata
- Download URL: ggid-1.0.2.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
876bcacd012f73d5f2f2106d26fd36eacb7aa2586ce2db17cc2d68f4fab8b7b6
|
|
| MD5 |
0ace67e1045e4263f09b14be2aaf2483
|
|
| BLAKE2b-256 |
2659817b92d30ccb97c69bdedbb3cfa642fab2f86ed3694c27e88001310a2403
|
Provenance
The following attestation bundles were made for ggid-1.0.2.tar.gz:
Publisher:
publish.yml on topcheer/ggid-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ggid-1.0.2.tar.gz -
Subject digest:
876bcacd012f73d5f2f2106d26fd36eacb7aa2586ce2db17cc2d68f4fab8b7b6 - Sigstore transparency entry: 2226095429
- Sigstore integration time:
-
Permalink:
topcheer/ggid-sdk-python@318f37ad41657757653d4bd9ed8d3420ec318173 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/topcheer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@318f37ad41657757653d4bd9ed8d3420ec318173 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ggid-1.0.2-py3-none-any.whl.
File metadata
- Download URL: ggid-1.0.2-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ec6fe0d1cd0f911f04464be5b01bf3c398fa3cdef15c10dc448a722e14b8910
|
|
| MD5 |
787fe3f3bc06c2cfb42f7100326f74c5
|
|
| BLAKE2b-256 |
f8d416c82ff26ca649655449b32984b2ecfd823f68f437d91d0ab5265f44b36c
|
Provenance
The following attestation bundles were made for ggid-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on topcheer/ggid-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ggid-1.0.2-py3-none-any.whl -
Subject digest:
3ec6fe0d1cd0f911f04464be5b01bf3c398fa3cdef15c10dc448a722e14b8910 - Sigstore transparency entry: 2226095758
- Sigstore integration time:
-
Permalink:
topcheer/ggid-sdk-python@318f37ad41657757653d4bd9ed8d3420ec318173 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/topcheer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@318f37ad41657757653d4bd9ed8d3420ec318173 -
Trigger Event:
push
-
Statement type: