Skip to main content

Aserto API client

Project description

Aserto API client

High-level client interface to Aserto's APIs.

At the moment this only supports interacting with Aserto's Authorizer service.

Installation

Using Pip

pip install aserto

Using Poetry

poetry add aserto

Usage

from aserto import HostedAuthorizer, Identity
from aserto.api.authorizer import AuthorizerClient


client = AuthorizerClient(
    tenant_id=ASERTO_TENANT_ID,
    identity=Identity(type="NONE"),
    authorizer=HostedAuthorizer(api_key=ASERTO_API_KEY, service_type="gRPC"),
)

result = await client.decision_tree(
    decisions=["visible", "enabled", "allowed"],
    policy_id=ASERTO_POLICY_ID,
    policy_path_root=ASERTO_POLICY_PATH_ROOT,
    policy_path_separator="DOT",
)

assert result == {
    "GET.your.policy.path": {
        "visible": True,
        "enabled": True,
        "allowed": False,
    },
}

Project details


Download files

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

Source Distribution

aserto-0.1.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

aserto-0.1.1-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page