Skip to content

Python gRPC bindings for the Aserto directory service.

License

Notifications You must be signed in to change notification settings

aserto-dev/python-directory

Repository files navigation

Aserto Directory gRPC client

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

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

Installation

Using Pip

pip install aserto-directory

Using Poetry

poetry add aserto-directory

Usage

import grpc
from aserto.directory.reader.v3 import ReaderStub, GetObjectRequest

with grpc.secure_channel(
    target="directory.prod.aserto.com:8443",
    credentials=grpc.ssl_channel_credentials(),
) as channel:
    reader = ReaderStub(channel)

    # Read an object from the directory.
    response = reader.GetObject(
        GetObjectRequest(object_type="user", object_id="rick@the-citadel.com"),
        metadata=(
            ("authorization", f"basic {ASERTO_DIRECTORY_API_KEY}"),
            ("aserto-tenant-id", ASERTO_TENANT_ID),
        ),
    )

    print("Object:", object_type.result)

About

Python gRPC bindings for the Aserto directory service.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published