-
Notifications
You must be signed in to change notification settings - Fork 2
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
add initial data filtering support to python sdk #101
base: main
Are you sure you want to change the base?
Conversation
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.
Few comments that require fixing
@@ -397,6 +398,143 @@ async def check( | |||
Read more about setting up the PDP at https://docs.permit.io/sdk/python/quickstart-python/#2-setup-your-pdp-policy-decision-point-container" | |||
) | |||
|
|||
async def filter_resources( |
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.
This should be in a separate file and should only be imported if the relevant optional dependency was chosen, otherwise you will force installing irrelevant packages
@@ -224,3 +225,96 @@ async def check( | |||
await permit.check(user, 'close', {'type': 'issue', 'tenant': 't1'}) | |||
""" | |||
return await self._enforcer.check(user, action, resource, context) | |||
|
|||
async def filter_resources( |
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.
Same here
@@ -3,3 +3,4 @@ httpx>=0.24.1,<1 | |||
loguru>=0.7.0,<1 | |||
pydantic[email]>=1.10.7 | |||
typing-extensions>=4.5.0,<5 | |||
permit-datafilter>=0.0.3,<1 |
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.
This should be optional dependency
No description provided.