-
Notifications
You must be signed in to change notification settings - Fork 25
FGA_BASE: adding base types and module registraiton #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
swaroopAkkineniWorkos
wants to merge
10
commits into
main
Choose a base branch
from
ENT-5224-python-sdk-for-fga-worktree-fuck-around
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,611
−9
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ab35617
adding base types and module registraiton
swaroopAkkineniWorkos 5f6892d
moar
swaroopAkkineniWorkos 0bc40fb
lol
swaroopAkkineniWorkos 526eb7d
lol
swaroopAkkineniWorkos 13dad51
nits for re-dupe OrganizationMembershipStatus
swaroopAkkineniWorkos ff239c7
Format
swaroopAkkineniWorkos a5823c6
adding AUTHORIZATION_RESOURCES_PATH to base
swaroopAkkineniWorkos 8dd434f
FGA_1: create/delete/get/update resource (#563)
swaroopAkkineniWorkos fe59018
FGA_2: listResources(), get/update/delete resource_by_external_id (#569)
swaroopAkkineniWorkos a50f5d5
FGA_3: check() (#568)
swaroopAkkineniWorkos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,29 @@ | ||
| from workos.types.authorization.access_evaluation import AccessEvaluation | ||
| from workos.types.authorization.environment_role import ( | ||
| EnvironmentRole, | ||
| EnvironmentRoleList, | ||
| ) | ||
| from workos.types.authorization.organization_membership import ( | ||
| AuthorizationOrganizationMembership, | ||
| ) | ||
| from workos.types.authorization.organization_role import ( | ||
| OrganizationRole, | ||
| OrganizationRoleEvent, | ||
| OrganizationRoleList, | ||
| ) | ||
| from workos.types.authorization.permission import Permission | ||
| from workos.types.authorization.resource import Resource | ||
| from workos.types.authorization.resource_identifier import ( | ||
| ResourceIdentifier, | ||
| ResourceIdentifierByExternalId, | ||
| ResourceIdentifierById, | ||
| ) | ||
| from workos.types.authorization.role import ( | ||
| Role, | ||
| RoleList, | ||
| ) | ||
| from workos.types.authorization.role_assignment import ( | ||
| RoleAssignment, | ||
| RoleAssignmentResource, | ||
| RoleAssignmentRole, | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from workos.types.workos_model import WorkOSModel | ||
|
|
||
|
|
||
| class AccessEvaluation(WorkOSModel): | ||
| """Representation of a WorkOS Authorization access check result.""" | ||
|
|
||
| authorized: bool |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from typing import Any, Literal, Mapping, Optional | ||
|
|
||
| from workos.types.user_management.organization_membership_status import ( | ||
| OrganizationMembershipStatus, | ||
| ) | ||
| from workos.types.workos_model import WorkOSModel | ||
| from workos.typing.literals import LiteralOrUntyped | ||
|
|
||
|
|
||
| class AuthorizationOrganizationMembership(WorkOSModel): | ||
| """Representation of an Organization Membership returned by Authorization endpoints. | ||
| This is a separate type from the user_management OrganizationMembership because | ||
| authorization endpoints return memberships without the ``role`` field and include | ||
| ``organization_name``. Additionally, ``custom_attributes`` is optional here as | ||
| authorization endpoints may omit it. | ||
| """ | ||
|
|
||
| object: Literal["organization_membership"] | ||
| id: str | ||
| user_id: str | ||
| organization_id: str | ||
| organization_name: str | ||
| status: LiteralOrUntyped[OrganizationMembershipStatus] | ||
| custom_attributes: Optional[Mapping[str, Any]] = None | ||
| created_at: str | ||
| updated_at: str |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from workos.types.workos_model import WorkOSModel | ||
|
|
||
|
|
||
| class Resource(WorkOSModel): | ||
| """Representation of an Authorization Resource.""" | ||
|
|
||
| object: Literal["authorization_resource"] | ||
| id: str | ||
| external_id: str | ||
| name: str | ||
| description: Optional[str] = None | ||
| resource_type_slug: str | ||
| organization_id: str | ||
| parent_resource_id: Optional[str] = None | ||
| created_at: str | ||
| updated_at: str |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from typing import Union | ||
|
|
||
| from typing_extensions import TypedDict | ||
|
|
||
|
|
||
| class ResourceIdentifierById(TypedDict): | ||
| resource_id: str | ||
|
|
||
|
|
||
| class ResourceIdentifierByExternalId(TypedDict): | ||
| resource_external_id: str | ||
| resource_type_slug: str | ||
|
|
||
|
|
||
| ResourceIdentifier = Union[ResourceIdentifierById, ResourceIdentifierByExternalId] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| from typing import Literal | ||
|
|
||
| from workos.types.workos_model import WorkOSModel | ||
|
|
||
|
|
||
| class RoleAssignmentRole(WorkOSModel): | ||
| slug: str | ||
|
|
||
|
|
||
| class RoleAssignmentResource(WorkOSModel): | ||
| id: str | ||
| external_id: str | ||
| resource_type_slug: str | ||
|
|
||
|
|
||
| class RoleAssignment(WorkOSModel): | ||
| object: Literal["role_assignment"] | ||
| id: str | ||
| role: RoleAssignmentRole | ||
| resource: RoleAssignmentResource | ||
| created_at: str | ||
| updated_at: str |
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
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
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
3 changes: 3 additions & 0 deletions
3
src/workos/types/user_management/organization_membership_status.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from typing import Literal | ||
|
|
||
| OrganizationMembershipStatus = Literal["active", "inactive", "pending"] |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add docstring for this argument?