Skip to content

python(feat): add ABAC resource and principal attributes - #646

Merged
wei-sift merged 5 commits into
mainfrom
python/abac-resource-and-principal
Jun 22, 2026
Merged

wei-sift merged 5 commits into
mainfrom
python/abac-resource-and-principal

Conversation

@wei-sift

@wei-sift wei-sift commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the public API for ABAC resource and principal attributes to sift_client.

  • client.resource_attributes manages attribute keys on entities (assets, channels, runs).
  • client.principal_attributes manages keys on principals (users, user groups).

The attribute key is the entry point: create or fetch a key, define enum values, then assign values to entities or principals. SET_OF_ENUM assignments replace the full value set per target. Principal assignment accepts user IDs or emails, resolving emails to user IDs via REST since the gRPC User proto has no email field.

Also fixes gen_pyi.py to render enum parameter defaults as valid stub syntax.

Test plan

  • Unit tests for the types, low-level wrappers, and resource orchestration (get-or-create dedup, value/entity/email resolution, pagination)
  • Manual QA checklist covers the live-backend flows (key/enum-value/assignment CRUD, archive cascade, email resolution, sync/async parity).

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-646/

Deployed from e9dfaa5. The link may take up to a minute to become live as GitHub Pages propagates.

@wei-sift
wei-sift marked this pull request as ready for review June 22, 2026 00:09

@nathan-sift nathan-sift left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. There are some more user friendly additions we can consider in the future to make working with the API easier, but I don't think any of that is necessary or in scope for this PR.

@wei-sift
wei-sift merged commit fddcf41 into main Jun 22, 2026
26 checks passed
@wei-sift
wei-sift deleted the python/abac-resource-and-principal branch June 22, 2026 20:08
alexluck-sift pushed a commit that referenced this pull request Jul 11, 2026
Bump version to 0.19.0 and update the changelog for the PRs merged
since v0.18.0: ABAC attributes (#646), get_data cache improvements
(#650), pytest docstring cleaning (#658), ULog data imports (#663),
access control API grouping (#666), report templates (#672),
download_file extra headers (#677), and the get_data pagination fix
plus progress bars (#678).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5U49rrpvQm5bPbvEjR4xr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants