Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = 'co.permify'
version = '1.4.4'
version = '1.5.4'

repositories {
mavenCentral()
Expand Down
17 changes: 17 additions & 0 deletions docs/BulkCheckBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


# BulkCheckBody

PermissionBulkCheckRequest is the request message for the BulkCheck method in the Permission service.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**metadata** | [**PermissionCheckRequestMetadata**](PermissionCheckRequestMetadata.md) | | [optional] |
|**items** | [**List<PermissionBulkCheckRequestItem>**](PermissionBulkCheckRequestItem.md) | List of permission check requests, maximum 100 items. | [optional] |
|**context** | [**Context**](Context.md) | | [optional] |
|**arguments** | [**List<Argument>**](Argument.md) | Additional arguments associated with this request. | [optional] |



15 changes: 15 additions & 0 deletions docs/Component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# Component

## Enum


* `PARSER` (value: `"COMPONENT_PARSER"`)

* `TYPE_CHECKER` (value: `"COMPONENT_TYPE_CHECKER"`)

* `RUNTIME` (value: `"COMPONENT_RUNTIME"`)



5 changes: 3 additions & 2 deletions docs/Comprehension.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

# Comprehension

A comprehension expression applied to a list or map. Comprehensions are not part of the core syntax, but enabled with macros. A macro matches a specific call signature within a parsed AST and replaces the call with an alternate AST block. Macro expansion happens at parse time. The following macros are supported within CEL: Aggregate type macros may be applied to all elements in a list or all keys in a map: * `all`, `exists`, `exists_one` - test a predicate expression against the inputs and return `true` if the predicate is satisfied for all, any, or only one value `list.all(x, x < 10)`. * `filter` - test a predicate expression against the inputs and return the subset of elements which satisfy the predicate: `payments.filter(p, p > 1000)`. * `map` - apply an expression to all elements in the input and return the output aggregate type: `[1, 2, 3].map(i, i * i)`. The `has(m.x)` macro tests whether the property `x` is present in struct `m`. The semantics of this macro depend on the type of `m`. For proto2 messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the macro tests whether the property is set to its default. For map and struct types, the macro tests whether the property `x` is defined on `m`.
A comprehension expression applied to a list or map. Comprehensions are not part of the core syntax, but enabled with macros. A macro matches a specific call signature within a parsed AST and replaces the call with an alternate AST block. Macro expansion happens at parse time. The following macros are supported within CEL: Aggregate type macros may be applied to all elements in a list or all keys in a map: * `all`, `exists`, `exists_one` - test a predicate expression against the inputs and return `true` if the predicate is satisfied for all, any, or only one value `list.all(x, x < 10)`. * `filter` - test a predicate expression against the inputs and return the subset of elements which satisfy the predicate: `payments.filter(p, p > 1000)`. * `map` - apply an expression to all elements in the input and return the output aggregate type: `[1, 2, 3].map(i, i * i)`. The `has(m.x)` macro tests whether the property `x` is present in struct `m`. The semantics of this macro depend on the type of `m`. For proto2 messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the macro tests whether the property is set to its default. For map and struct types, the macro tests whether the property `x` is defined on `m`. Comprehensions for the standard environment macros evaluation can be best visualized as the following pseudocode: ``` let `accu_var` = `accu_init` for (let `iter_var` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ``` Comprehensions for the optional V2 macros which support map-to-map translation differ slightly from the standard environment macros in that they expose both the key or index in addition to the value for each list or map entry: ``` let `accu_var` = `accu_init` for (let `iter_var`, `iter_var2` in `iter_range`) { if (!`loop_condition`) { break } `accu_var` = `loop_step` } return `result` ```

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**iterVar** | **String** | The name of the iteration variable. | [optional] |
|**iterVar** | **String** | The name of the first iteration variable. When the iter_range is a list, this variable is the list element. When the iter_range is a map, this variable is the map entry key. | [optional] |
|**iterVar2** | **String** | The name of the second iteration variable, empty if not set. When the iter_range is a list, this variable is the integer index. When the iter_range is a map, this variable is the map entry value. This field is only set for comprehension v2 macros. | [optional] |
|**iterRange** | [**Expr**](Expr.md) | | [optional] |
|**accuVar** | **String** | The name of the variable used for accumulation of the result. | [optional] |
|**accuInit** | [**Expr**](Expr.md) | | [optional] |
Expand Down
16 changes: 16 additions & 0 deletions docs/Extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


# Extension

An extension that was requested for the source expression.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**id** | **String** | | [optional] |
|**affectedComponents** | **List&lt;Component&gt;** | If set, the listed components must understand the extension for the expression to evaluate correctly. This field has set semantics, repeated values should be deduplicated. | [optional] |
|**version** | [**Version**](Version.md) | | [optional] |



142 changes: 142 additions & 0 deletions docs/PermissionApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**permissionsBulkCheck**](PermissionApi.md#permissionsBulkCheck) | **POST** /v1/tenants/{tenant_id}/permissions/bulk-check | bulk check api |
| [**permissionsBulkCheckWithHttpInfo**](PermissionApi.md#permissionsBulkCheckWithHttpInfo) | **POST** /v1/tenants/{tenant_id}/permissions/bulk-check | bulk check api |
| [**permissionsCheck**](PermissionApi.md#permissionsCheck) | **POST** /v1/tenants/{tenant_id}/permissions/check | check api |
| [**permissionsCheckWithHttpInfo**](PermissionApi.md#permissionsCheckWithHttpInfo) | **POST** /v1/tenants/{tenant_id}/permissions/check | check api |
| [**permissionsExpand**](PermissionApi.md#permissionsExpand) | **POST** /v1/tenants/{tenant_id}/permissions/expand | expand api |
Expand All @@ -19,6 +21,146 @@ All URIs are relative to *http://localhost*



## permissionsBulkCheck

> PermissionBulkCheckResponse permissionsBulkCheck(tenantId, body)

bulk check api

Check multiple permissions in a single request. Maximum 100 requests allowed.

### Example

```java
// Import classes:
import co.permify.sdk.client.ApiClient;
import co.permify.sdk.client.ApiException;
import co.permify.sdk.client.Configuration;
import co.permify.sdk.client.models.*;
import co.permify.sdk.api.PermissionApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");

PermissionApi apiInstance = new PermissionApi(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.
BulkCheckBody body = new BulkCheckBody(); // BulkCheckBody |
try {
PermissionBulkCheckResponse result = apiInstance.permissionsBulkCheck(tenantId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PermissionApi#permissionsBulkCheck");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **tenantId** | **String**| Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant &lt;code&gt;t1&lt;/code&gt; for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. | |
| **body** | [**BulkCheckBody**](BulkCheckBody.md)| | |

### Return type

[**PermissionBulkCheckResponse**](PermissionBulkCheckResponse.md)


### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | A successful response. | - |
| **0** | An unexpected error response. | - |

## permissionsBulkCheckWithHttpInfo

> ApiResponse<PermissionBulkCheckResponse> permissionsBulkCheck permissionsBulkCheckWithHttpInfo(tenantId, body)

bulk check api

Check multiple permissions in a single request. Maximum 100 requests allowed.

### Example

```java
// Import classes:
import co.permify.sdk.client.ApiClient;
import co.permify.sdk.client.ApiException;
import co.permify.sdk.client.ApiResponse;
import co.permify.sdk.client.Configuration;
import co.permify.sdk.client.models.*;
import co.permify.sdk.api.PermissionApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");

PermissionApi apiInstance = new PermissionApi(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.
BulkCheckBody body = new BulkCheckBody(); // BulkCheckBody |
try {
ApiResponse<PermissionBulkCheckResponse> response = apiInstance.permissionsBulkCheckWithHttpInfo(tenantId, body);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling PermissionApi#permissionsBulkCheck");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
```

### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **tenantId** | **String**| Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant &lt;code&gt;t1&lt;/code&gt; for this field. Required, and must match the pattern \\“[a-zA-Z0-9-,]+\\“, max 64 bytes. | |
| **body** | [**BulkCheckBody**](BulkCheckBody.md)| | |

### Return type

ApiResponse<[**PermissionBulkCheckResponse**](PermissionBulkCheckResponse.md)>


### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | A successful response. | - |
| **0** | An unexpected error response. | - |


## permissionsCheck

> PermissionCheckResponse permissionsCheck(tenantId, body)
Expand Down
15 changes: 15 additions & 0 deletions docs/PermissionBulkCheckRequestItem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


# PermissionBulkCheckRequestItem


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**entity** | [**Entity**](Entity.md) | | [optional] |
|**permission** | **String** | The action the user wants to perform on the resource | [optional] |
|**subject** | [**Subject**](Subject.md) | | [optional] |



14 changes: 14 additions & 0 deletions docs/PermissionBulkCheckResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# PermissionBulkCheckResponse

PermissionBulkCheckResponse is the response message for the BulkCheck method in the Permission service.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**results** | [**List&lt;PermissionCheckResponse&gt;**](PermissionCheckResponse.md) | List of permission check responses corresponding to each request. | [optional] |



1 change: 1 addition & 0 deletions docs/SourceInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Source information collected at parse time.
|**lineOffsets** | **List&lt;Integer&gt;** | Monotonically increasing list of code point offsets where newlines &#x60;\\n&#x60; appear. The line number of a given position is the index &#x60;i&#x60; where for a given &#x60;id&#x60; the &#x60;line_offsets[i] &lt; id_positions[id] &lt; line_offsets[i+1]&#x60;. The column may be derivd from &#x60;id_positions[id] - line_offsets[i]&#x60;. | [optional] |
|**positions** | **Map&lt;String, Integer&gt;** | A map from the parse node id (e.g. &#x60;Expr.id&#x60;) to the code point offset within the source. | [optional] |
|**macroCalls** | [**Map&lt;String, Expr&gt;**](Expr.md) | A map from the parse node id where a macro replacement was made to the call &#x60;Expr&#x60; that resulted in a macro expansion. For example, &#x60;has(value.field)&#x60; is a function call that is replaced by a &#x60;test_only&#x60; field selection in the AST. Likewise, the call &#x60;list.exists(e, e &gt; 10)&#x60; translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call &#x60;Expr&#x60; that was replaced. | [optional] |
|**extensions** | [**List&lt;Extension&gt;**](Extension.md) | A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported. | [optional] |



14 changes: 14 additions & 0 deletions docs/Version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


# Version


## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**major** | **String** | Major version changes indicate different required support level from the required components. | [optional] |
|**minor** | **String** | Minor version changes must not change the observed behavior from existing implementations, but may be provided informationally. | [optional] |



Loading