{"id":25524781,"url":"https://github.com/psauvage0/ketodot","last_synced_at":"2026-01-01T03:30:17.297Z","repository":{"id":57636095,"uuid":"424911614","full_name":"psauvage0/ketodot","owner":"psauvage0","description":"This program takes files in Ory Keto relation-tuples syntax and converts it to dot notation","archived":false,"fork":false,"pushed_at":"2021-11-24T14:32:57.000Z","size":334,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T14:18:40.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psauvage0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-05T10:38:24.000Z","updated_at":"2024-01-17T10:56:52.000Z","dependencies_parsed_at":"2022-09-26T20:21:43.649Z","dependency_job_id":null,"html_url":"https://github.com/psauvage0/ketodot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psauvage0%2Fketodot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psauvage0%2Fketodot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psauvage0%2Fketodot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psauvage0%2Fketodot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psauvage0","download_url":"https://codeload.github.com/psauvage0/ketodot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727073,"owners_count":19687098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-19T20:05:35.080Z","updated_at":"2026-01-01T03:30:17.221Z","avatar_url":"https://github.com/psauvage0.png","language":"Go","funding_links":[],"categories":["Archived, Outdated, and WIP"],"sub_categories":["Ory Fosite"],"readme":"# KetoToDot\nThis program takes files in Ory Keto relation-tuples syntax and converts it to dot notation.\nThis allows to quickly see which subject has access to which object with which relation,\nwith a simple glance.\n\n## Compile\n\nTo compile :\n```\ngo build -o $GOBIN/\n```\n\n## How to use\n\n```\nketodot example.keto\n```\nThis will print on stdout the DOT grammar representing the graph.\nYou can redirect this output into a file and then use [graphviz](https://graphviz.org/)\nto render it, **or** you can simply copy and paste the output [here](https://dreampuf.github.io/GraphvizOnline/).\n\nYou can also directly render to png, jpg or svg :\n```\nketodot example.keto -f png -o example.png\n```\n\nYou can also watch for change in the source file and render again on save with the w flag :\n```\nketodot example.keto -f png -o example.png -w\n```\n\n## How it works\n\nThe way Keto works can be understood as a simple graph reachability problem.\nObjects and subjects are nodes of the graph, and the relations are the edges\nbetween them. Asking keto to check the access for a subject on an object is\nequivalent to checking if, from the object, you can reach the subject on the graph, using\nonly the relations given.\n\nWith this tool you can visualize this graph. You can also check that a subject has a right\non an object just by checking if the edges connecting the two are of the same color.\n\nCurrently the graph is drawn in 2 parts. The first step is to draw the nodes and\nedges, the second is to color the edges.\n\nDrawing the graph is simple, since the relation tuple gives us all the required parts\nof a graph : the starting node (the object), the edge (the relation), and the destination\nnode (the subject). Stopping here already enables us to draw a graph representing\nour data structure, but it does not provide the ability to determine at a glance if a subject\nhas a right on a given object.\n\nTo do that, we can use colors to represent the subgraph that is selected when\na subjectset is given. In the relation tuple `resource:1#viewer@group:1#member`,\nthe subjectset `group:1#member` can be expanded to a number of subjects. The coloring\nof the edges represents this expansion by coloring all the edges from the object and relation\ngiven, to all the end subjects with the same color. Here coloring is one representation\nof this, that is easy to implement as a proof of concept. Ideally the same idea\ncould be represented by highlighting all the subjects and relations when hovering\nover an edge. Basically, the coloring is the representation of the `keto expand`\ncommand.\n\nThe given example will render the following graph.\n![example](example.png)\n\n## Current limitations\n\nDue to how the the coloring works, the `parent#` subjectset (used for subjectset-rewrites\nwith parent-child inheritance, not implemented in Keto yet)\nis not correctly matched with the corresponding expanded relation tuples.\n\nAlso using relation-tuples that have the same object and subject\n(something like `folder:0#viewer@folder:0#editor`) will cause the\ndifferent colors for different roles to merge (as this is equivalent of doing relation\ninheritance using subjectset-rewrites). The coloring representation is not powerful enough to represent\ninheritance.\n\nThese problems can be solved by using the actual expand API of Keto, and using\na better representation of the expansion, using a dynamic display with highlights.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsauvage0%2Fketodot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsauvage0%2Fketodot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsauvage0%2Fketodot/lists"}