keto icon indicating copy to clipboard operation
keto copied to clipboard

Batch check request

Open zepatrik opened this issue 3 years ago • 7 comments

Preflight checklist

Describe your problem

In some cases it makes sense to do multiple checks at the same time. This can be used e.g. to create a list of all permissions for the UI, or similar things.

Describe your ideal solution

We can provide a batch check API. It would make sense especially for cases where subjects and/or objects are the same, so that we can reuse already done queries internally.

Workarounds or alternatives

Doing multiple check requests. This has the overhead of the transport, as well as reduced performance optimization possibilities.

Version

all

Additional Context

No response

zepatrik avatar Jan 10 '22 12:01 zepatrik

This would help me and my team with the product we are building. We have paginated endpoints that return lists of resources that are sorted and filtered via Mongo queries. Afterwards, we would like to check the user permissions of all items in the page, but at the moment we are forced to do a separate check per item. Implementing this would allow us to only call the API once and speed things up.

Fylipp avatar Jan 10 '22 18:01 Fylipp

That feature would help my team. We have a feature-store and complex data system, we are in the process of making this a platform beyond the company internal usage for data science, but a product (external usage). At some point we have to list a catalog of datasets that the user have access. We have a 1000+ datasets.

I thought initially that we could do something similar with keto using GET /relation-tuples/expand or GET /relation-tuples by querying with a fixed namespace and subject_id, but for my surprise it didn't what I expected.

ryukinix avatar Aug 31 '22 19:08 ryukinix

Or the ability to expand without setting relation would help too. The case that UI depends on the current permit and in our case it causes 8 checks. i.e. does the user have xxx permit, does the token have xxx permit, where xxx = list[vew, edit, build, own]

istarkov avatar Feb 03 '23 13:02 istarkov

We are encountering a similar issue where we need to send multiple check requests to keto. It would be more efficient to have a batch request in order to reduce the transport overhead.

shashimalcse avatar Jun 08 '23 04:06 shashimalcse

Yes, I wish this feature be implemented eventually very much.

Cordialmente, Manoel Vilela.

Em qui., 8 de jun. de 2023 01:42, Thilina Shashimal Senarath < @.***> escreveu:

We are encountering a similar issue where we need to send multiple check requests to keto. It would be more efficient to have a batch request in order to reduce the transport overhead.

— Reply to this email directly, view it on GitHub https://github.com/ory/keto/issues/812#issuecomment-1581882283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2J57RRAG2I2R44NPHCWPDXKFJ47ANCNFSM5LTR6L3Q . You are receiving this because you commented.Message ID: @.***>

ryukinix avatar Jun 08 '23 21:06 ryukinix

Can we introduce a batch operation endpoint (both gRPC and REST) that allows us to send multiple tuples for the check with a single request?

shashimalcse avatar Jun 09 '23 05:06 shashimalcse

I'm running into the same requirement of having a dynamic UI based on the permissions, at the moment I'm forced to check permissions one by one.

AkScriptHS avatar Feb 28 '24 14:02 AkScriptHS