Permify / permify

An open-source authorization as a service inspired by Google Zanzibar, designed to build and manage fine-grained and scalable authorization systems for any application.
https://docs.permify.co/
Apache License 2.0
4.5k stars 200 forks source link

Enhancing the 'Coverage' Command for Detailed Action/Permission Conditions #837

Open tolgaOzen opened 10 months ago

tolgaOzen commented 10 months ago

Description

We need to improve the accuracy and detail of the 'Coverage' command used in evaluating action/permission conditions within our system. A key concern is ensuring that every aspect of a permission condition is thoroughly covered and assessed for accuracy. The current implementation may lead to incomplete assessments, as exemplified by the sample condition provided.

Sample Condition for Reference

permission view = system.view or ((is_public or (is_partner and partner) or (viewer or company.maintain or organization.maintain or team.view)) not denied)

In this example, asserting only a part of the condition (like system.view) is considered sufficient for coverage, even if other parts are not asserted. This approach can lead to suboptimal results and inaccuracies in coverage evaluation.

Suggested Improvements

Goals

Action Items

Request for Comments

We seek feedback and suggestions, particularly regarding:

tolgaOzen commented 10 months ago

/bounty $250

algora-pbc[bot] commented 10 months ago

💎 $250 bounty • Permify.co

Steps to solve:

  1. Start working: Comment /attempt #837 with your implementation plan
  2. Submit work: Create a pull request including /claim #837 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Don't wait to be assigned. A reward will be given for the best PR.

Thank you for contributing to Permify/permify!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @vijayraghav-io Nov 15, 2023, 3:06:31 PM #844
ayewo commented 10 months ago

@tolgaOzen

  1. Can you point me to the “Coverage” command in the codebase?
  2. In your example, I imagine that short-circuiting is happening because system.view is the highest access available but then you go on to say:

    This approach can lead to suboptimal results and inaccuracies in permission evaluation.

Can you please clarify the inaccuracy?

vijayraghav-io commented 10 months ago

/attempt #837

Options
algora-pbc[bot] commented 10 months ago

💡 @vijayraghav-io submitted a pull request that claims the bounty. You can visit your bounty board to reward.