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.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

aserto-0.1.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file aserto-0.1.2.tar.gz.

File metadata

  • Download URL: aserto-0.1.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.7.11 Darwin/20.3.0

File hashes

Hashes for aserto-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bb813382d6f28964e40b4876e7b637be2906946e9f9dc561ebd9323a2ad974aa
MD5 395de5f5edda56fda2c87f97e9878e29
BLAKE2b-256 433f3cd92c57f8b4fbc76a86729feb1419aea35f3c32cf62ef1a9d31150fd45e

See more details on using hashes here.

File details

Details for the file aserto-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aserto-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.7.11 Darwin/20.3.0

File hashes

Hashes for aserto-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d4c07eac35b022c9768c06f656e9bd004a1db7ca8df0998b9d69792ccea1a1
MD5 e6b1b22e8dc42e735c06a3eac29f37ba
BLAKE2b-256 3b5e18e560750a3771f3e3effbba89e8c74e3e6a6f73778d345edf42240d0b78

See more details on using hashes here.

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