GitHub - Permify/permify-java: Permify Java Client
Repository navigation
permify-javaPublic
About
Permify Java Client
Resources
Readme Apache-2.0 licenseSecurity policy
Security policy Activity Custom propertiesStars
5 starsWatchers
0 watchingForks
2 forks Report repositoryBranches
Tags
Go to Branches page Go to Tags page
Latest commit
History
58 Commits
View commit history for this file.
Folders and files
Repository files navigation
Permify Java
Permify API
- Latest API version: 1.4.2
Permify is an open source authorization service for creating fine-grained and scalable authorization systems.
For more information, please visit https://github.com/Permify/permify/issues
Requirements
Building the API client library requires:
- Java 11+
- Maven/Gradle
Maven users
Add this dependency to your project's POM:
<!-- https://mvnrepository.com/artifact/co.permify/permify-java -->
<dependency>
<groupId>co.permify</groupId>
<artifactId>permify-java</artifactId>
<version>${permify-java-version}</version>
</dependency>
Gradle users
Add this dependency to your project's build file:
// https://mvnrepository.com/artifact/co.permify/permify-java
implementation 'co.permify:permify-java:${permify-java-version}'
Getting Started
Please follow the installation instruction and execute the following Java code:
import co.permify.sdk.client.*;
import co.permify.sdk.model.*;
import co.permify.sdk.api.BundleApi;
public class BundleApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure clients using the `defaultClient` object, such as
// overriding the host and port, timeout, etc.
BundleApi apiInstance = new BundleApi(defaultClient);
String tenantId = "tenantId_example"; // String | Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \\"[a-zA-Z0-9-,]+\\", max 64 bytes.
BundleDeleteBody body = new BundleDeleteBody(); // BundleDeleteBody |
try {
BundleDeleteResponse result = apiInstance.bundleDelete(tenantId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BundleApi#bundleDelete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| BundleApi | bundleDelete | POST /v1/tenants/{tenant_id}/bundle/delete | delete bundle |
| BundleApi | bundleDeleteWithHttpInfo | POST /v1/tenants/{tenant_id}/bundle/delete | delete bundle |
| BundleApi | bundleRead | POST /v1/tenants/{tenant_id}/bundle/read | read bundle |
| BundleApi | bundleReadWithHttpInfo | POST /v1/tenants/{tenant_id}/bundle/read | read bundle |
| BundleApi | bundleWrite | POST /v1/tenants/{tenant_id}/bundle/write | write bundle |
| BundleApi | bundleWriteWithHttpInfo | POST /v1/tenants/{tenant_id}/bundle/write | write bundle |
| DataApi | bundleRun | POST /v1/tenants/{tenant_id}/data/run-bundle | run bundle |
| DataApi | bundleRunWithHttpInfo | POST /v1/tenants/{tenant_id}/data/run-bundle | run bundle |
| DataApi | dataAttributesRead | POST /v1/tenants/{tenant_id}/data/attributes/read | read attributes |
| DataApi | dataAttributesReadWithHttpInfo | POST /v1/tenants/{tenant_id}/data/attributes/read | read attributes |
| DataApi | dataDelete | POST /v1/tenants/{tenant_id}/data/delete | delete data |
| DataApi | dataDeleteWithHttpInfo | POST /v1/tenants/{tenant_id}/data/delete | delete data |
| DataApi | dataRelationshipsRead | POST /v1/tenants/{tenant_id}/data/relationships/read | read relationships |
| DataApi | dataRelationshipsReadWithHttpInfo | POST /v1/tenants/{tenant_id}/data/relationships/read | read relationships |
| DataApi | dataWrite | POST /v1/tenants/{tenant_id}/data/write | write data |
| DataApi | dataWriteWithHttpInfo | POST /v1/tenants/{tenant_id}/data/write | write data |
| DataApi | relationshipsDelete | POST /v1/tenants/{tenant_id}/relationships/delete | delete relationships |
| DataApi | relationshipsDeleteWithHttpInfo | POST /v1/tenants/{tenant_id}/relationships/delete | delete relationships |
| DataApi | relationshipsWrite | POST /v1/tenants/{tenant_id}/relationships/write | write relationships |
| DataApi | relationshipsWriteWithHttpInfo | POST /v1/tenants/{tenant_id}/relationships/write | write relationships |
| PermissionApi | permissionsCheck | POST /v1/tenants/{tenant_id}/permissions/check | check api |
| PermissionApi | permissionsCheckWithHttpInfo | POST /v1/tenants/{tenant_id}/permissions/check | check api |
| PermissionApi | permissionsExpand | POST /v1/tenants/{tenant_id}/permissions/expand | expand api |
| PermissionApi | permissionsExpandWithHttpInfo | POST /v1/tenants/{tenant_id}/permissions/expand | expand api |
| PermissionApi | permissionsLookupEntity | POST /v1/tenants/{tenant_id}/permissions/lookup-entity | lookup entity |
| PermissionApi | permissionsLookupEntityWithHttpInfo | POST /v1/tenants/{tenant_id}/permissions/lookup-entity | lookup entity |
| PermissionApi | permissionsLookupEntityStream | POST /v1/tenants/{tenant_id}/permissions/lookup-entity-stream | lookup entity stream |
| PermissionApi | permissionsLookupEntityStreamWithHttpInfo | POST /v1/tenants/{tenant_id}/permissions/lookup-entity-stream | lookup entity stream |
| PermissionApi | permissionsLookupSubject | POST /v1/tenants/{tenant_id}/permissions/lookup-subject | lookup-subject |
| PermissionApi | permissionsLookupSubjectWithHttpInfo | POST /v1/tenants/{tenant_id}/permissions/lookup-subject | lookup-subject |
| PermissionApi | permissionsSubjectPermission | POST /v1/tenants/{tenant_id}/permissions/subject-permission | subject permission |
| PermissionApi | permissionsSubjectPermissionWithHttpInfo | POST /v1/tenants/{tenant_id}/permissions/subject-permission | subject permission |
| SchemaApi | schemasList | POST /v1/tenants/{tenant_id}/schemas/list | list schema |
| SchemaApi | schemasListWithHttpInfo | POST /v1/tenants/{tenant_id}/schemas/list | list schema |
| SchemaApi | schemasPartialWrite | PATCH /v1/tenants/{tenant_id}/schemas/partial-write | partially update your authorization model |
| SchemaApi | schemasPartialWriteWithHttpInfo | PATCH /v1/tenants/{tenant_id}/schemas/partial-write | partially update your authorization model |
| SchemaApi | schemasRead | POST /v1/tenants/{tenant_id}/schemas/read | read schema |
| SchemaApi | schemasReadWithHttpInfo | POST /v1/tenants/{tenant_id}/schemas/read | read schema |
| SchemaApi | schemasWrite | POST /v1/tenants/{tenant_id}/schemas/write | write schema |
| SchemaApi | schemasWriteWithHttpInfo | POST /v1/tenants/{tenant_id}/schemas/write | write schema |
| TenancyApi | tenantsCreate | POST /v1/tenants/create | create tenant |
| TenancyApi | tenantsCreateWithHttpInfo | POST /v1/tenants/create | create tenant |
| TenancyApi | tenantsDelete | DELETE /v1/tenants/{id} | delete tenant |
| TenancyApi | tenantsDeleteWithHttpInfo | DELETE /v1/tenants/{id} | delete tenant |
| TenancyApi | tenantsList | POST /v1/tenants/list | list tenants |
| TenancyApi | tenantsListWithHttpInfo | POST /v1/tenants/list | list tenants |
| WatchApi | watchWatch | POST /v1/tenants/{tenant_id}/watch | watch changes |
| WatchApi | watchWatchWithHttpInfo | POST /v1/tenants/{tenant_id}/watch | watch changes |
Documentation for Models
- AbstractType
- Any
- Argument
- Attribute
- AttributeDefinition
- AttributeFilter
- AttributeReadRequestMetadata
- AttributeReadResponse
- AttributeType
- BundleDeleteBody
- BundleDeleteResponse
- BundleReadBody
- BundleReadResponse
- BundleRunResponse
- BundleWriteBody
- BundleWriteResponse
- CheckBody
- CheckResult
- CheckedExpr
- Child
- Comprehension
- ComputedAttribute
- ComputedUserSet
- Constant
- Context
- CreateList
- CreateStruct
- DataBundle
- DataChange
- DataChangeOperation
- DataChanges
- DataDeleteBody
- DataDeleteResponse
- DataWriteBody
- DataWriteRequestMetadata
- DataWriteResponse
- DeleteRelationshipsBody
- Entity
- EntityDefinition
- EntityDefinitionReference
- EntityFilter
- Entry
- ExpandLeaf
- ExpandTreeNode
- ExpandTreeNodeOperation
- Expr
- ExprCall
- FunctionType
- Ident
- Leaf
- ListType
- LookupEntityBody
- LookupEntityStreamBody
- LookupSubjectBody
- MapType
- PartialWriteBody
- Partials
- PermissionCheckRequestMetadata
- PermissionCheckResponse
- PermissionCheckResponseMetadata
- PermissionDefinition
- PermissionExpandBody
- PermissionExpandRequestMetadata
- PermissionExpandResponse
- PermissionLookupEntityRequestMetadata
- PermissionLookupEntityResponse
- PermissionLookupEntityStreamResponse
- PermissionLookupSubjectRequestMetadata
- PermissionLookupSubjectResponse
- PermissionSubjectPermissionRequestMetadata
- PermissionSubjectPermissionResponse
- PrimitiveType
- ReadAttributesBody
- ReadRelationshipsBody
- RelationDefinition
- RelationReference
- RelationshipDeleteResponse
- RelationshipReadRequestMetadata
- RelationshipReadResponse
- RelationshipWriteRequestMetadata
- RelationshipWriteResponse
- Rewrite
- RewriteOperation
- RuleDefinition
- RunBundleBody
- SchemaDefinition
- SchemaDefinitionReference
- SchemaList
- SchemaListBody
- SchemaListResponse
- SchemaPartialWriteRequestMetadata
- SchemaPartialWriteResponse
- SchemaReadBody
- SchemaReadRequestMetadata
- SchemaReadResponse
- SchemaWriteBody
- SchemaWriteResponse
- Select
- SourceInfo
- Status
- StreamResultOfPermissionLookupEntityStreamResponse
- StreamResultOfWatchResponse
- StringArrayValue
- Subject
- SubjectFilter
- SubjectPermissionBody
- Subjects
- Tenant
- TenantCreateRequest
- TenantCreateResponse
- TenantDeleteResponse
- TenantListRequest
- TenantListResponse
- Tuple
- TupleFilter
- TupleSet
- TupleToUserSet
- V1Call
- V1Expand
- V1Operation
- V1alpha1Reference
- V1alpha1Type
- Values
- WatchBody
- WatchResponse
- WellKnownType
- WriteRelationshipsBody
Documentation for Authorization
Authentication schemes defined for the API:
ApiKeyAuth
- Type : API key
- API key parameter name : Authorization
- Location : HTTP header
Recommendation
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.
However, the instances of the api clients created from the ApiClient are thread-safe and can be re-used.
Author
About
Permify Java Client