Skip to main content

GGID Python SDK

PyPI version License: Apache 2.0

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_auth decorator 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

Metadata

Release files for ggid 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ggid 1.0.2
File Size Uploaded Provenance
ggid-1.0.2.tar.gz 13.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ggid 1.0.2
File Interpreter ABI Platform
ggid-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / ggid-1.0.2.tar.gz

Download URL ggid-1.0.2.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
876bcacd012f73d5f2f2106d26fd36eacb7aa2586ce2db17cc2d68f4fab8b7b6
BLAKE2b-256 checksum
How to use checksums
2659817b92d30ccb97c69bdedbb3cfa642fab2f86ed3694c27e88001310a2403
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 23, 2026.

Transparency log

Release files / ggid-1.0.2-py3-none-any.whl

Download URL ggid-1.0.2-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ec6fe0d1cd0f911f04464be5b01bf3c398fa3cdef15c10dc448a722e14b8910
BLAKE2b-256 checksum
How to use checksums
f8d416c82ff26ca649655449b32984b2ecfd823f68f437d91d0ab5265f44b36c
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 23, 2026.

Transparency log

Security for ggid 1.0.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ggid-1.0.2.tar.gz

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 23, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page