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
33 changes: 33 additions & 0 deletions docs/BulkCheckBody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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]

## Example

```python
from permify.models.bulk_check_body import BulkCheckBody

# TODO update the JSON string below
json = "{}"
# create an instance of BulkCheckBody from a JSON string
bulk_check_body_instance = BulkCheckBody.from_json(json)
# print the JSON string representation of the object
print BulkCheckBody.to_json()

# convert the object into a dict
bulk_check_body_dict = bulk_check_body_instance.to_dict()
# create an instance of BulkCheckBody from a dict
bulk_check_body_form_dict = bulk_check_body.from_dict(bulk_check_body_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


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

CEL component specifier. - COMPONENT_PARSER: Parser. Converts a CEL string to an AST. - COMPONENT_TYPE_CHECKER: Type checker. Checks that references in an AST are defined and types agree. - COMPONENT_RUNTIME: Runtime. Evaluates a parsed and optionally checked CEL AST against a context.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


5 changes: 3 additions & 2 deletions docs/Comprehension.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# 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
------------ | ------------- | ------------- | -------------
**iter_var** | **str** | The name of the iteration variable. | [optional]
**iter_var** | **str** | 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]
**iter_var2** | **str** | 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]
**iter_range** | [**Expr**](Expr.md) | | [optional]
**accu_var** | **str** | The name of the variable used for accumulation of the result. | [optional]
**accu_init** | [**Expr**](Expr.md) | | [optional]
Expand Down
32 changes: 32 additions & 0 deletions docs/Extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Extension

An extension that was requested for the source expression.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | | [optional]
**affected_components** | [**List[Component]**](Component.md) | 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]

## Example

```python
from permify.models.extension import Extension

# TODO update the JSON string below
json = "{}"
# create an instance of Extension from a JSON string
extension_instance = Extension.from_json(json)
# print the JSON string representation of the object
print Extension.to_json()

# convert the object into a dict
extension_dict = extension_instance.to_dict()
# create an instance of Extension from a dict
extension_form_dict = extension.from_dict(extension_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


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

Method | HTTP request | Description
------------- | ------------- | -------------
[**permissions_bulk_check**](PermissionApi.md#permissions_bulk_check) | **POST** /v1/tenants/{tenant_id}/permissions/bulk-check | bulk check api
[**permissions_check**](PermissionApi.md#permissions_check) | **POST** /v1/tenants/{tenant_id}/permissions/check | check api
[**permissions_expand**](PermissionApi.md#permissions_expand) | **POST** /v1/tenants/{tenant_id}/permissions/expand | expand api
[**permissions_lookup_entity**](PermissionApi.md#permissions_lookup_entity) | **POST** /v1/tenants/{tenant_id}/permissions/lookup-entity | lookup entity
Expand All @@ -12,6 +13,80 @@ Method | HTTP request | Description
[**permissions_subject_permission**](PermissionApi.md#permissions_subject_permission) | **POST** /v1/tenants/{tenant_id}/permissions/subject-permission | subject permission


# **permissions_bulk_check**
> PermissionBulkCheckResponse permissions_bulk_check(tenant_id, body)

bulk check api

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

### Example


```python
import time
import os
import permify
from permify.models.bulk_check_body import BulkCheckBody
from permify.models.permission_bulk_check_response import PermissionBulkCheckResponse
from permify.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = permify.Configuration(
host = "http://localhost"
)


# Enter a context with an instance of the API client
with permify.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = permify.PermissionApi(api_client)
tenant_id = 'tenant_id_example' # str | 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.
body = permify.BulkCheckBody() # BulkCheckBody |

try:
# bulk check api
api_response = api_instance.permissions_bulk_check(tenant_id, body)
print("The response of PermissionApi->permissions_bulk_check:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PermissionApi->permissions_bulk_check: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tenant_id** | **str**| 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. | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **permissions_check**
> PermissionCheckResponse permissions_check(tenant_id, body)

Expand Down
31 changes: 31 additions & 0 deletions docs/PermissionBulkCheckRequestItem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# PermissionBulkCheckRequestItem


## Properties

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

## Example

```python
from permify.models.permission_bulk_check_request_item import PermissionBulkCheckRequestItem

# TODO update the JSON string below
json = "{}"
# create an instance of PermissionBulkCheckRequestItem from a JSON string
permission_bulk_check_request_item_instance = PermissionBulkCheckRequestItem.from_json(json)
# print the JSON string representation of the object
print PermissionBulkCheckRequestItem.to_json()

# convert the object into a dict
permission_bulk_check_request_item_dict = permission_bulk_check_request_item_instance.to_dict()
# create an instance of PermissionBulkCheckRequestItem from a dict
permission_bulk_check_request_item_form_dict = permission_bulk_check_request_item.from_dict(permission_bulk_check_request_item_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


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

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

## Properties

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

## Example

```python
from permify.models.permission_bulk_check_response import PermissionBulkCheckResponse

# TODO update the JSON string below
json = "{}"
# create an instance of PermissionBulkCheckResponse from a JSON string
permission_bulk_check_response_instance = PermissionBulkCheckResponse.from_json(json)
# print the JSON string representation of the object
print PermissionBulkCheckResponse.to_json()

# convert the object into a dict
permission_bulk_check_response_dict = permission_bulk_check_response_instance.to_dict()
# create an instance of PermissionBulkCheckResponse from a dict
permission_bulk_check_response_form_dict = permission_bulk_check_response.from_dict(permission_bulk_check_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/SourceInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Name | Type | Description | Notes
**line_offsets** | **List[int]** | 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** | **Dict[str, int]** | A map from the parse node id (e.g. &#x60;Expr.id&#x60;) to the code point offset within the source. | [optional]
**macro_calls** | [**Dict[str, Expr]**](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[Extension]**](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]

## Example

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


## Properties

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

## Example

```python
from permify.models.version import Version

# TODO update the JSON string below
json = "{}"
# create an instance of Version from a JSON string
version_instance = Version.from_json(json)
# print the JSON string representation of the object
print Version.to_json()

# convert the object into a dict
version_dict = version_instance.to_dict()
# create an instance of Version from a dict
version_form_dict = version.from_dict(version_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading