Official Python SDK for Plystra.
Project description
plystra
Official Python SDK for Plystra Core v1.0.
PyPI package name: plystra
Install
pip install plystra
Synchronous Usage
from plystra import Plystra
with Plystra("http://localhost:8080") as plystra:
plystra.auth.login("alice@example.com", "plystra-demo")
decision = plystra.authz.check(
actor={
"user_id": "user_alice",
"space_id": "space_acme",
"member_id": "member_finance_reviewer",
"user_member_id": "um_alice_finance_reviewer",
},
resource_type="invoice",
resource_id="invoice_001",
action="approve",
)
print(decision["decision"])
Asynchronous Usage
import asyncio
from plystra import AsyncPlystra
async def main() -> None:
async with AsyncPlystra("http://localhost:8080") as plystra:
await plystra.auth.login("alice@example.com", "plystra-demo")
decision = await plystra.authz.check(
actor_user_id="user_alice",
actor_member_id="member_finance_reviewer",
actor_user_member_id="um_alice_finance_reviewer",
space_id="space_acme",
resource_type="invoice",
resource_id="invoice_001",
action="approve",
)
print(decision["decision"])
asyncio.run(main())
Modules
The SDK exposes v1.0 Core modules as attributes:
systemauthactoradminusersspacesgroupsmembersuser_membersrolesmember_rolespermissionsrole_permissionsresource_typesresourcesauthzauditdatapluginstemplates
Non-public endpoints require a Bearer session whose user has an active admin grant.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plystra-1.0.0.dev1.tar.gz
(12.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plystra-1.0.0.dev1.tar.gz.
File metadata
- Download URL: plystra-1.0.0.dev1.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14df4244f538230e5af2aa482dc5302d772a152c783108926d99604fc54f7c50
|
|
| MD5 |
db2b33876bf8c74124380182321c1207
|
|
| BLAKE2b-256 |
edde3ca97753967f4cab1648c92860d86ffdc92c61bd70e5f3a28a5d8abfc8e4
|
File details
Details for the file plystra-1.0.0.dev1-py3-none-any.whl.
File metadata
- Download URL: plystra-1.0.0.dev1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eeaffc55d6ece096ec5a35e25279fa1c1676f24c486cd4d2ecc2cf370bf5e6c
|
|
| MD5 |
5e34276cad1d9588fdc7190494efc630
|
|
| BLAKE2b-256 |
b5794e105de9cf4daf2003a9b5729e0beeab537e4afa09cfa4c73e504fd5505b
|