Skip to main content

gcl_iam

gcl_iam is a Python library for adding JWT authentication and policy-based authorization to RESTAlchemy services. It provides:

  • HS256 and RS256 token verification, including previous-key fallback during key rotation;
  • remote JWKS discovery and token introspection through an IAM service;
  • request-scoped identity, project and permission data;
  • wildcard permissions in the service.resource.action format;
  • project-aware, nested, projectless and OTP-aware RESTAlchemy controllers;
  • permission-driven field visibility; and
  • OAuth-style HTTP error responses.

The library requires Python 3.10 or newer and is licensed under Apache 2.0.

Documentation

The complete documentation is available in four languages. Every language has the same files, section order and code examples:

New users should start with installation and the getting-started guide.

Quick example

from gcl_iam import drivers
from gcl_iam import middlewares as iam_middlewares
from restalchemy.api import middlewares

iam_driver = drivers.HttpDriver(
    iam_endpoint="https://iam.example.com/v1/iam/clients/my-service",
    audience="my-service",
    hs256_jwks_decryption_key="<32-byte A256GCM key>",
)

application = middlewares.attach_middlewares(
    application,
    [
        middlewares.configure_middleware(
            iam_middlewares.GenesisCoreAuthMiddleware,
            iam_engine_driver=iam_driver,
        ),
        iam_middlewares.ErrorsHandlerMiddleware,
    ],
)

Use real secret management for IAM credentials and encryption keys. Never put them in source code.

Development

Create the standard development environment and run the unit tests:

tox -e develop
tox -e py310

Additional checks are available as tox -e ruff-check and tox -e mypy.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcl_iam-1.4.0.tar.gz (162.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcl_iam-1.4.0-py3-none-any.whl (93.3 kB view details)

Uploaded Python 3

File details

Details for the file gcl_iam-1.4.0.tar.gz.

File metadata

  • Download URL: gcl_iam-1.4.0.tar.gz
  • Upload date:
  • Size: 162.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gcl_iam-1.4.0.tar.gz
Algorithm Hash digest
SHA256 7888e63b295ae1e54f6a43b22f51dbeeb0b69f2c155895d556c68873af1eb2e7
MD5 1bd12bab2058406fb435a97b106bd991
BLAKE2b-256 937bbb547b0d5e8609985828a8e4a700e7e2608ddef8218f5fe5e4bf2e1975dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcl_iam-1.4.0.tar.gz:

Publisher: publish-to-pypi.yml on exordos/gcl_iam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gcl_iam-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: gcl_iam-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 93.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gcl_iam-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89b9b86ed00a4b13998205943315c777d15a07015337e070e3456490e3ddec58
MD5 aff72e09108439835e25c1eba8b177c9
BLAKE2b-256 e46ada9cd26debbe3ef5e7b777dee55646bee95143a4f14820e8a21d978681f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcl_iam-1.4.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on exordos/gcl_iam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

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