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

Display Permit's ReBAC Graph #16

Open
gemanor opened this issue Oct 28, 2024 · 8 comments
Open

Display Permit's ReBAC Graph #16

gemanor opened this issue Oct 28, 2024 · 8 comments

Comments

@gemanor
Copy link
Collaborator

gemanor commented Oct 28, 2024

We want the CLI to be able to read the whole resource instance, relationships, and role assignment from the Permit APIs and display them as a graph with the relationship. Before attempting this issue, please propose your way to implement it (could be native CLI, could be opened in the browser, etc.)

Acceptance criteria:

  • The command permit fga graph is showing the graph of the Permit permissions in ReBAC
@gemanor
Copy link
Collaborator Author

gemanor commented Oct 28, 2024

/bounty 200

Copy link

algora-pbc bot commented Oct 28, 2024

💎 $200 bounty • Permit.io

Steps to solve:

  1. Start working: Comment /attempt #16 with your implementation plan
  2. Submit work: Create a pull request including /claim #16 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

Thank you for contributing to permitio/permit-cli!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @harshtech123 Oct 29, 2024, 6:20:58 AM WIP
🟢 @vishwamartur #41

@harshtech123
Copy link

harshtech123 commented Oct 29, 2024

/attempt #16
Implementation Plan: Display Permit's ReBAC Graph

Purpose: The permit_fga_graph command would retrieve and display a visual graph representing the relationships and permissions across resource instances, role assignments, and other relevant entities using Permit’s API.

implementation Outline:

i like to proceed with CLI-based Option:
1 Data Retrieval
we will extend api.ts to include methods for fetching resource instances, roles, and relationships from the Permit API.

2 Graph Data Structuring
willing to Create the permit_fga_graph command to fetch data from the API, process it, and display it in a graph format.

3 Integrate with CLI Output
Purpose: Register the permit fga graph command to be accessible from the main CLI.

@gemanor
Copy link
Collaborator Author

gemanor commented Nov 3, 2024

Hey @harshtech123, please read the issue description next time; we asked to propose a way of building it before submitting a PR.

In your PR:

  1. You're not using the Pastel way to add commands. Read the Pastel docs and implement it correctly.
  2. You should use the token from the keystone (look at the permit login command
  3. We want to display visualize graph and not just print JSON. The graphs can be generated as HTML and opened in the browser, or alternatively, get interactively displayed in the CLI

@harshtech123
Copy link

@gemanor
on it

@harshtech123
Copy link

@gemanor please let me know how we can future improve it , (i am thinking about adding a option for token) so user can either parse it with loadauthtoken or manually pass as an option.

vishwamartur added a commit to vishwamartur/permit-cli that referenced this issue Nov 26, 2024
Related to permitio#16

Add `permit fga graph` command to display Permit permissions graph in ReBAC.

* **CLI Integration**
  - Add import for `fgaGraph` command in `source/cli.tsx`.
  - Register `fgaGraph` command with Pastel in `source/cli.tsx`.

* **API Methods**
  - Add methods in `source/lib/api.ts` to fetch resource instances, roles, and relationships from Permit API.

* **Graph Command Implementation**
  - Create `source/commands/fgaGraph.tsx` to define `fgaGraph` command.
  - Use Ink components to render graph data interactively in CLI.

* **Documentation**
  - Update `README.md` to include usage instructions for `permit fga graph` command.
@vishwamartur
Copy link

/attempt #16

Copy link

algora-pbc bot commented Nov 26, 2024

@vishwamartur: We appreciate your enthusiasm but since you already have 3 active bounty attempts, we're going to keep this open for other contributors to attempt. 🫡

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

Successfully merging a pull request may close this issue.

3 participants