Aserto Authorizer gRPC client
This is an automatically generated client for interacting with Aserto's Authorizer service using the gRPC protocol.
Installation
Using Pip
pip install aserto-authorizer-grpc
Using Poetry
poetry add aserto-authorizer-grpc
Usage
from aserto_authorizer_grpc.aserto.api.v1 import (
IdentityContext,
IdentityType,
PolicyContext,
)
from aserto_authorizer_grpc.aserto.authorizer.authorizer.v1 import (
AuthorizerStub,
DecisionTreeOptions,
DecisionTreeResponse,
PathSeparator,
Proto,
)
from grpclib.client import Channel
async with Channel(host=host, port=port, ssl=True) as channel:
headers = {
"aserto-tenant-id": TENANT_ID,
"authorization": f"basic {ASERTO_API_KEY}"
}
client = AuthorizerStub(channel, metadata=headers)
response = await client.decision_tree(
policy_context=PolicyContext(
id=ASERTO_POLICY_ID,
path=ASERTO_POLICY_PATH_ROOT,
decisions=["visible", "enabled", "allowed"],
),
identity_context=IdentityContext(type=IdentityType.IDENTITY_TYPE_NONE),
resource_context=Proto.Struct(),
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-grpc 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aserto-authorizer-grpc-0.3.1.tar.gz | 15.6 kB | Without provenance | Details for aserto-authorizer-grpc-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aserto_authorizer_grpc-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for aserto_authorizer_grpc-0.3.1-py3-none-any.whl |
Total release size: 33.7 kB
Security for aserto-authorizer-grpc 0.3.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.