Skip to content

Comments

FGA_1: create/delete/get/update resource#563

Open
swaroopAkkineniWorkos wants to merge 6 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
fga-pr1
Open

FGA_1: create/delete/get/update resource#563
swaroopAkkineniWorkos wants to merge 6 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
fga-pr1

Conversation

@swaroopAkkineniWorkos
Copy link

Description

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title FGA implementation pr1 fga 1 Feb 20, 2026
@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title fga 1 fga 1: create/delete/get/update resource Feb 20, 2026
@swaroopAkkineniWorkos swaroopAkkineniWorkos changed the title fga 1: create/delete/get/update resource FGA_1: create/delete/get/update resource Feb 20, 2026
@swaroopAkkineniWorkos
Copy link
Author

@greptile review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 21, 2026

Greptile Summary

This PR implements CRUD operations (create, read, update, delete) for authorization resources in the WorkOS Python SDK. The implementation follows established patterns in the codebase:

  • Added ParentResource type definition to support parent resources referenced by ID or external ID + type slug
  • Implemented four resource methods in both Authorization and AsyncAuthorization classes: get_resource, create_resource, update_resource, and delete_resource
  • Used the existing delete_with_body method for cascade delete functionality when the cascade_delete parameter is provided
  • Added comprehensive test coverage with the @pytest.mark.sync_and_async decorator to test both sync and async implementations
  • Tests validate all optional parameters, parent resource options (by ID and by external ID), and proper HTTP method/endpoint usage

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The code follows established patterns in the codebase precisely, includes comprehensive test coverage for all methods and parameter combinations, properly handles both sync and async implementations, and maintains type safety throughout
  • No files require special attention

Important Files Changed

Filename Overview
src/workos/authorization.py Added CRUD operations for authorization resources with both sync and async implementations following existing patterns
tests/test_authorization_resource_crud.py Comprehensive test coverage for resource CRUD operations using the sync_and_async marker pattern

Last reviewed commit: ee6d268

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@swaroopAkkineniWorkos swaroopAkkineniWorkos marked this pull request as ready for review February 23, 2026 17:52
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested a review from a team as a code owner February 23, 2026 17:52
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested review from atainter and ericroberts and removed request for a team February 23, 2026 17:52
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant