feat: update authorization module for fga#581
Conversation
…rce, list_memberships_for_resource_by_external_id (#571)
|
@greptile re-review plz |
Greptile SummaryThis PR adds 15 new FGA (Fine-Grained Authorization) API methods to the Key changes:
Confidence Score: 4/5
Last reviewed commit: 2c1e44a |
src/workos/fga.py
Outdated
| # Deprecated: Use the Authorization module instead. | ||
| # See: workos.authorization | ||
| class FGAModule(Protocol): |
There was a problem hiding this comment.
Deprecation notice is a plain comment, not visible to IDEs
The deprecation for FGAModule is expressed as a plain # comment at line 56:
# Deprecated: Use the Authorization module instead.
class FGAModule(Protocol):IDEs, linters, and static analysis tools will not surface this notice when callers use this class. Consider upgrading to a docstring-based deprecation or DeprecationWarning so downstream consumers receive clear visibility:
class FGAModule(Protocol):
"""
.. deprecated::
Use :class:`workos.authorization.AuthorizationModule` instead.
"""Or, for runtime warnings on instantiation, add a deprecation handler in a __init_subclass__ hook.
adding in new fga api's
getResource() - GET /authorization/resources/{resource_id}
createResource() - POST /authorization/resources
updateResource() - PATCH /authorization/resources/{resource_id}
deleteResource() - DELETE /authorization/resources/{resource_id}
listResources() - GET /authorization/resources?organization_id={org_id}
check() - POST /authorization/organization_memberships/{om_id}/check
getResourceByExternalId() - GET /authorization/organizations/{org_id}/resources/{type}/{external_id}
updateResourceByExternalId() - PATCH /authorization/organizations/{org_id}/resources/{type}/{external_id}
deleteResourceByExternalId() - DELETE /authorization/organizations/{org_id}/resources/{type}/{external_id}
listRoleAssignments() - GET /authorization/organization_memberships/{om_id}/role_assignments
assignRole() - POST /authorization/organization_memberships/{om_id}/role_assignments
removeRole() - DELETE /authorization/organization_memberships/{om_id}/role_assignments
removeRoleAssignment() - DELETE /authorization/organization_memberships/{om_id}/role_assignments/{ra_id}
listResourcesForMembership() - GET /authorization/organization_memberships/{om_id}/resources
listMembershipsForResource() - GET /authorization/resources/{resource_id}/organization_memberships
listMembershipsForResourceByExternalId() - GET /authorization/organizations/{org_id}/resources/{type}/{external_id}/organization_memberships
Corresponding stacked pr that were approved:
#556
#563
#569
#568
#570
#571