Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asafc
Copy link
Contributor

@asafc asafc commented Aug 12, 2024

No description provided.

@asafc asafc requested a review from omer9564 August 12, 2024 16:36
Copy link
Contributor

@omer9564 omer9564 left a 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(
Copy link
Contributor

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(
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants