Skip to main content

Aserto Authorizer gRPC client

This is an automatically generated client for interacting with Aserto's Authorizer service using the gRPC protocol.

The code was generated from https://buf.build/aserto-dev/authorizer.

Installation

Using Pip

pip install aserto-authorizer

Using Poetry

poetry add aserto-authorizer

Usage

import grpc
from aserto.authorizer.v2.api import (
    IdentityContext,
    IdentityType,
    PolicyContext,
    PolicyInstance,
)
from aserto.authorizer.v2 import (
    AuthorizerStub,
    DecisionTreeRequest,
    DecisionTreeOptions,
    DecisionTreeResponse,
    PathSeparator,
)
from grpclib.client import Channel


with grpc.secure_channel(
    target="authorizer.prod.aserto.com:8443",
    credentials=grpc.ssl_channel_credentials(),
) as channel:
    client = AuthorizerStub(channel)

    response = client.DecisionTree(
        DecisionTreeRequest(
            policy_context=PolicyContext(
                path=ASERTO_POLICY_PATH_ROOT,
                decisions=["visible", "enabled", "allowed"],
            ),
            policy_instance=PolicyInstance(
                name=ASERTO_POLICY_NAME,
                instance_label=ASERTO_POLICY_INSTANCE_LABEL,
            ),
            identity_context=IdentityContext(type=IdentityType.IDENTITY_TYPE_NONE),
            options=DecisionTreeOptions(
                path_separator=PathSeparator.PATH_SEPARATOR_DOT,
            ),
        )
    )

    assert response == DecisionTreeResponse(
        path_root=ASERTO_POLICY_PATH_ROOT,
        path=Proto.Struct(
            fields={
                "GET.your.policy.path": Proto.Value(
                    struct_value=Proto.Struct(
                        fields={
                            "visible": Proto.Value(bool_value=True),
                            "enabled": Proto.Value(bool_value=True),
                            "allowed": Proto.Value(bool_value=False),
                        },
                    ),
                ),
            },
        ),
    )

Metadata

Release files for aserto_authorizer 0.20.7

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

Source distribution (sdist)

Source distribution for aserto_authorizer 0.20.7
File Size Uploaded
aserto_authorizer-0.20.7.tar.gz 34.8 kB Details

Built distribution (wheel)

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

Total release size: 88.5 kB

Release files / aserto_authorizer-0.20.7.tar.gz

Download URL aserto_authorizer-0.20.7.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e54fba9f30f64e129212734162d9f7e007b6fb5ef1ba32666a456ba5dd4438a
BLAKE2b-256 checksum
How to use checksums
30611069f7f5b076364a668c757c656479e3736313e938b3105484a6ff61167f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

Release files / aserto_authorizer-0.20.7-py3-none-any.whl

Download URL aserto_authorizer-0.20.7-py3-none-any.whl
Size 53.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daba6d3e4d8c77686dd2b02b4646407941d1482b83d956f70fa13fee80d64ad5
BLAKE2b-256 checksum
How to use checksums
7d424b566eff9781665ba76664071a42b0726b7ae76e121b51d1fcf9341e578d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

Release history Release notifications | RSS feed

This release

0.20.7 This release

2 release files

0.20.5

2 release files

0.20.4

2 release files

0.20.2

2 release files

0.20.0

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release 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