FGA_2: listResources(), get/update/delete resource_by_external_id#569
Merged
swaroopAkkineniWorkos merged 5 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom Feb 24, 2026
Merged
Conversation
Author
|
@greptile review |
Contributor
Greptile SummaryThis PR adds Fine-Grained Authorization (FGA) resource management capabilities by external ID to the Python SDK. The implementation adds four new methods to the
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Authorization
participant HTTPClient
participant API
Note over Client,API: Resource Operations by External ID
Client->>Authorization: get_resource_by_external_id(org_id, type, ext_id)
Authorization->>HTTPClient: GET /authorization/organizations/{org_id}/resources/{type}/{ext_id}
HTTPClient->>API: HTTP Request
API-->>HTTPClient: Resource JSON
HTTPClient-->>Authorization: Response
Authorization-->>Client: Resource object
Client->>Authorization: update_resource_by_external_id(org_id, type, ext_id, name, desc)
Authorization->>HTTPClient: PATCH /authorization/organizations/{org_id}/resources/{type}/{ext_id}
HTTPClient->>API: HTTP Request with JSON body
API-->>HTTPClient: Updated Resource JSON
HTTPClient-->>Authorization: Response
Authorization-->>Client: Resource object
Client->>Authorization: delete_resource_by_external_id(org_id, type, ext_id, cascade_delete)
Authorization->>HTTPClient: DELETE /authorization/organizations/{org_id}/resources/{type}/{ext_id}
HTTPClient->>API: HTTP Request with params
API-->>HTTPClient: 202 Accepted
HTTPClient-->>Authorization: Response
Authorization-->>Client: None
Client->>Authorization: list_resources(org_id, filters, pagination)
Authorization->>HTTPClient: GET /authorization/organizations/{org_id}/resources
HTTPClient->>API: HTTP Request with query params
API-->>HTTPClient: Paginated List JSON
HTTPClient-->>Authorization: Response
Authorization-->>Client: WorkOSListResource
Last reviewed commit: 63f2f60 |
| cascade_delete: Optional[bool] = None, | ||
| ) -> SyncOrAsync[None]: ... | ||
|
|
||
| def list_resources( |
Comment on lines
+193
to
+200
| def delete_resource_by_external_id( | ||
| self, | ||
| organization_id: str, | ||
| resource_type: str, | ||
| external_id: str, | ||
| *, | ||
| cascade_delete: Optional[bool] = None, | ||
| ) -> SyncOrAsync[None]: ... |
There was a problem hiding this comment.
follow pattern in update #563
fe59018
into
ENT-5224-python-sdk-for-fga-worktree-fuck-around
11 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.