{"id":49369657,"url":"https://github.com/keymate-io/keymate-authz-toolkit","last_synced_at":"2026-04-27T22:00:46.308Z","repository":{"id":352414997,"uuid":"1213569333","full_name":"Keymate-io/keymate-authz-toolkit","owner":"Keymate-io","description":"Fine-grained authorization toolkit: Access Rules DSL, Access Rule Engine, and the kmctl authz CLI for validate, simulate, and explain workflows","archived":false,"fork":false,"pushed_at":"2026-04-19T12:39:03.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-19T14:39:51.401Z","etag":null,"topics":["authorization","authz","cli","fine-grained-authorization","java","policy-as-code","policy-engine"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Keymate-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-17T14:18:30.000Z","updated_at":"2026-04-19T12:39:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Keymate-io/keymate-authz-toolkit","commit_stats":null,"previous_names":["keymate-io/keymate-authz-toolkit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Keymate-io/keymate-authz-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keymate-io%2Fkeymate-authz-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keymate-io%2Fkeymate-authz-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keymate-io%2Fkeymate-authz-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keymate-io%2Fkeymate-authz-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keymate-io","download_url":"https://codeload.github.com/Keymate-io/keymate-authz-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keymate-io%2Fkeymate-authz-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["authorization","authz","cli","fine-grained-authorization","java","policy-as-code","policy-engine"],"created_at":"2026-04-27T22:00:33.247Z","updated_at":"2026-04-27T22:00:46.277Z","avatar_url":"https://github.com/Keymate-io.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keymate AuthZ Toolkit\n\nThe open-source toolkit for fine-grained authorization. The repository ships three surfaces: the **Access Rules** declarative policy DSL, the **Access Rule Engine** (embeddable evaluation core), and **kmctl** (the command-line binary for authoring, validating, simulating, and explaining policies).\n\n**Access Rules** are declarative policies that decide *who* can do *what*, under *which conditions*, on behalf of *which actor*.\n\nIt is built for a world where a single \"authenticated request\" is no longer enough context to make an authorization decision. Agent identity, human actor, tenant, trust level, channel, and runtime risk must all be weighed together — and the decision must be explainable.\n\n---\n\n## ✨ Key Features\n\n- **Declarative policies**\n  Policies are YAML documents (`AccessRuleSet`) with a routing-level matcher and an optional fine-grained `condition`.\n\n- **Two-stage evaluation**\n  A matcher selects the applicable rule by source client, target service, HTTP method, and URI pattern. A CEL expression then evaluates fine-grained business rules on top of the match.\n\n- **Explainability as a first-class feature**\n  `kmctl authz explain` produces a per-condition trace for both GRANT and DENY outcomes, so a reviewer can see exactly which clause passed or failed.\n\n- **Scenario-driven testing**\n  Policies ship with JSON scenarios that assert the expected decision. `kmctl authz simulate` runs them as a test suite against a policy.\n\n- **Portable fat JAR**\n  Single self-contained CLI binary with no external runtime dependencies beyond a JVM.\n\n---\n\n## 🧠 Design Principles\n\n| Anti-pattern | This project |\n|--------------|-------------|\n| ❌ Binary allow/deny at gateway | ✅ Condition-level fine-grained checks |\n| ❌ Opaque DENY decisions | ✅ Per-clause trace on every evaluation |\n| ❌ Policy drift between design and runtime | ✅ Same matcher + CEL logic in both |\n| ❌ Hardcoded authorization in services | ✅ Declarative `AccessRuleSet` artifacts |\n\nThe guiding philosophy:\n\n\u003e **An authorization decision you cannot explain is one you cannot audit.**\n\n---\n\n## 📦 Technology Stack\n\n- Java 17+\n- [CEL-Java](https://github.com/google/cel-java) — Common Expression Language runtime\n- Jackson (YAML + JSON)\n- picocli\n- SLF4J\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Java 17+\n- Maven 3.8+\n\n### Build\n\n```bash\nmvn clean package\n```\n\nThis runs the full test suite and produces the CLI fat JAR under:\n\n```\nauthz-toolkit-cli/target/keymate-authz-toolkit-cli-\u003cversion\u003e.jar\n```\n\n### Create an Alias\n\n```bash\nalias kmctl=\"java -jar $(ls authz-toolkit-cli/target/keymate-authz-toolkit-cli-*.jar | head -n 1)\"\n```\n\nVerify:\n\n```bash\nkmctl --help\n```\n\n---\n\n## ▶️ Commands\n\n### `kmctl authz validate`\n\nValidates the structure of a policy YAML and compiles its CEL expressions.\n\n```bash\nkmctl authz validate my-policy.yaml\n```\n\n### `kmctl authz simulate`\n\nRuns all scenarios in a JSON file against a policy and reports pass/fail per scenario.\n\n```bash\nkmctl authz simulate my-policy.yaml -s my-scenarios.json\n```\n\n### `kmctl authz explain`\n\nFor each scenario, traces which CEL sub-conditions passed or failed.\n\n```bash\nkmctl authz explain my-policy.yaml -s my-scenarios.json\n```\n\nSee [docs/getting-started.md](docs/getting-started.md) for a full walkthrough.\n\n---\n\n## 🧩 Modules\n\nThis is a multi-module Maven project.\n\n| Module | Purpose |\n|--------|---------|\n| [`authz-toolkit-core`](authz-toolkit-core/README.md) | Embeddable engine library — policy loading, rule matching, CEL evaluation, validation, simulation. |\n| [`authz-toolkit-cli`](authz-toolkit-cli/README.md) | `kmctl` command-line binary — `authz validate / simulate / explain` commands built on top of the core. |\n\n---\n\n## 📚 Documentation\n\n- [Getting Started](docs/getting-started.md) — build, alias, first policy end-to-end.\n- [Policy Format](docs/policy-format.md) — `AccessRuleSet` specification.\n- [Scenario Format](docs/scenario-format.md) — writing test scenarios.\n- [CLI Reference](docs/cli-reference.md) — all commands, options, exit codes.\n- [Rule Matching](docs/matching.md) — how the matcher resolves a request to a rule.\n- [Condition Evaluation](docs/condition-evaluation.md) — CEL expressions, context variables, trace behavior.\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.\n\n---\n\n## 🔒 Security\n\nTo report a vulnerability, please follow [SECURITY.md](SECURITY.md). Do **not** open public issues for security disclosures.\n\n---\n\n## 📄 License\n\nThis project is licensed under the **Apache License 2.0**. See [LICENSE](LICENSE) and [NOTICE](NOTICE) for details.\n\n---\n\n## ⚠️ Disclaimer\n\nThis tool is provided as-is. Always simulate and review your policies in a non-production environment before applying them to real traffic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeymate-io%2Fkeymate-authz-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeymate-io%2Fkeymate-authz-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeymate-io%2Fkeymate-authz-toolkit/lists"}