{"id":18812419,"url":"https://github.com/warrant-dev/warrant-java","last_synced_at":"2025-10-08T04:25:00.916Z","repository":{"id":40306597,"uuid":"406138271","full_name":"warrant-dev/warrant-java","owner":"warrant-dev","description":"Java SDK for Warrant","archived":false,"fork":false,"pushed_at":"2024-06-03T19:14:24.000Z","size":203,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T21:14:05.654Z","etag":null,"topics":["abac","access-control","acl","attribute-based-access-control","authorization","authz","java","permissions","rbac","role-based-access-control"],"latest_commit_sha":null,"homepage":"https://warrant.dev/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/warrant-dev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T21:44:47.000Z","updated_at":"2025-03-26T05:06:22.000Z","dependencies_parsed_at":"2023-02-04T23:46:50.341Z","dependency_job_id":"c4fe71d2-bfaa-4b7d-befa-cc8bb6a98379","html_url":"https://github.com/warrant-dev/warrant-java","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fwarrant-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fwarrant-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fwarrant-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrant-dev%2Fwarrant-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warrant-dev","download_url":"https://codeload.github.com/warrant-dev/warrant-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782260,"owners_count":21160717,"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":["abac","access-control","acl","attribute-based-access-control","authorization","authz","java","permissions","rbac","role-based-access-control"],"created_at":"2024-11-07T23:32:50.499Z","updated_at":"2025-10-08T04:24:55.864Z","avatar_url":"https://github.com/warrant-dev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Warrant Java Library\n\nUse [Warrant](https://warrant.dev/) in server-side Java projects.\n\n[![Maven Central](https://img.shields.io/maven-central/v/dev.warrant/warrant-java)](https://mvnrepository.com/artifact/dev.warrant/warrant-java)\n\n## Installation\n\n### Gradle\n\n```groovy\nimplementation group: 'dev.warrant', name: 'warrant-java', version: '4.2.0'\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003edev.warrant\u003c/groupId\u003e\n  \u003cartifactId\u003ewarrant-java\u003c/artifactId\u003e\n  \u003cversion\u003e4.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\n```java\npublic static void main(String[] args) throws WarrantException, IOException {\n    String apiKey = \"YOUR_KEY\";\n    WarrantClient client = new WarrantClient(WarrantConfig.withApiKey(apiKey));\n\n    // Create users, roles, permissions\n    User user = client.createUser();\n    Role adminRole = client.createRole(new Role(\"admin\", \"Admin\", \"Admin role\"));\n    Permission createPermission = client.createPermission(new Permission(\"create-report\", \"Create Report\" \"Permission to create reports\"));\n\n    // RBAC example\n    client.assignPermissionToRole(createPermission, adminRole);\n    client.assignRoleToUser(adminRole, user);\n    client.checkUserHasPermission(user, \"create-report\"); // returns true\n}\n```\n\n## Configuring API Endpoints\n\nBy default, the SDK makes requests to `api.warrant.dev`. You can override this endpoint, as well as a `check` endpoint (if using Warrant Edge) via a `WarrantConfig` object passed to the client:\n\n```java\npublic static void main(String[] args) throws WarrantException, IOException {\n    String apiKey = \"YOUR_KEY\";\n    // Initialize api endpoint to https://api.warrant.dev and check endpoint to \"http://localhost:3000\" (local Edge instance)\n    WarrantClient client = new WarrantClient(new WarrantConfig(apiKey, \"https://api.warrant.dev\", \"http://localhost:3000\"));\n}\n```\n\nWe’ve used a random API key in these code examples. Replace it with your [actual API keys](https://app.warrant.dev) to test this code through your own Warrant account.\n\nFor more information on how to use the Warrant API, please refer to the [Warrant API reference](https://docs.warrant.dev).\n\nNote that we may release new [minor and patch](https://semver.org/) versions of this library with small but backwards-incompatible fixes to the type declarations. These changes will not affect Warrant itself.\n\n## Warrant Documentation\n\n- [Warrant Docs](https://docs.warrant.dev/)\n\n## Development\n\nBuild and run all checks \u0026 tests:\n\n```shell\n./gradlew build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrant-dev%2Fwarrant-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarrant-dev%2Fwarrant-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrant-dev%2Fwarrant-java/lists"}