Skip to content

Commit c38a6fd

Browse files
authored
Merge pull request #1474 from Permify/docs
docs: created data filtering page
2 parents fbb624a + 6074a7d commit c38a6fd

File tree

12 files changed

+2720
-2346
lines changed

12 files changed

+2720
-2346
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ vendor/dist/
2222
/dist
2323
/config
2424
/tmp
25+
node_modules
2526

2627
# macOS
2728
*.DS_Store

docs/api-reference/apidocs.swagger.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@
736736
{
737737
"label": "go",
738738
"lang": "go",
739-
"source": "cr, err := client.Permission.Check(context.Background(), \u0026v1.PermissionCheckRequest {\n TenantId: \"t1\",\n Metadata: \u0026v1.PermissionCheckRequestMetadata {\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n Entity: \u0026v1.Entity {\n Type: \"repository\",\n Id: \"1\",\n },\n Permission: \"edit\",\n Subject: \u0026v1.Subject {\n Type: \"user\",\n Id: \"1\",\n },\n\n if (cr.can === PermissionCheckResponse_Result.RESULT_ALLOWED) {\n // RESULT_ALLOWED\n } else {\n // RESULT_DENIED\n }\n})"
739+
"source": "cr, err := client.Permission.Check(context.Background(), \u0026v1.PermissionCheckRequest {\n TenantId: \"t1\",\n Metadata: \u0026v1.PermissionCheckRequestMetadata {\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n Entity: \u0026v1.Entity {\n Type: \"repository\",\n Id: \"1\",\n },\n Permission: \"edit\",\n Subject: \u0026v1.Subject {\n Type: \"user\",\n Id: \"1\",\n },\n})\nif cr.Can == v1.PermissionCheckResponse_Result_RESULT_ALLOWED {\n // RESULT_ALLOWED\n} else {\n // RESULT_DENIED\n}"
740740
},
741741
{
742742
"label": "node",
@@ -746,7 +746,7 @@
746746
{
747747
"label": "cURL",
748748
"lang": "curl",
749-
"source": "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/check' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\":{\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"permission\": \"edit\",\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\",\n \"relation\": \"\"\n },\n}'"
749+
"source": "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/check' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\": {\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"permission\": \"edit\",\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\",\n \"relation\": \"\"\n }\n}'"
750750
}
751751
]
752752
}

docs/api-reference/introduction.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ We structured Permify API in 4 core parts:
1111
- [DataService]: Authorization data operations such as creating, deleting and reading relational tuples.
1212
- [SchemaService]: Modeling and Permify Schema related functionalities including configuration and auditing.
1313
- [TenancyService]: Consists tenant operations such as creating, deleting and listing.
14+
- [BundleService]: Manages bundled creation and deletion of relations and attributes to keep authorization data aligned with the business model.
1415

1516
Permify exposes its APIs via both [gRPC](https://buf.build/permifyco/permify/docs/main:base.v1) and [REST](https://restfulapi.net/).
1617

1718
[PermissionService]: ./permission/check-api
1819
[DataService]: ./data/write-data
1920
[SchemaService]: ./schema/write-schema
2021
[TenancyService]: ./tenancy/create-tenant
22+
[BundleService]: ./bundle/write-bundle
2123

2224
**SDKs:**
2325

docs/api-reference/openapi.json

Lines changed: 187 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
"name": "Apache-2.0 license",
1313
"url": "https://github.com/Permify/permify/blob/master/LICENSE"
1414
},
15-
"version": "v0.10.1"
15+
"version": "v1.0.2"
1616
},
1717
"servers": [
1818
{
1919
"url": "/"
2020
}
2121
],
2222
"tags": [
23+
{
24+
"name": "Health"
25+
},
2326
{
2427
"name": "Permission"
2528
},
@@ -40,6 +43,54 @@
4043
}
4144
],
4245
"paths": {
46+
"/healthz": {
47+
"get": {
48+
"tags": [
49+
"Health"
50+
],
51+
"summary": "health api",
52+
"operationId": "health.check",
53+
"responses": {
54+
"200": {
55+
"description": "A successful response.",
56+
"content": {
57+
"application/json": {
58+
"schema": {
59+
"$ref": "#/components/schemas/HealthResponse"
60+
}
61+
}
62+
}
63+
},
64+
"default": {
65+
"description": "An unexpected error response.",
66+
"content": {
67+
"application/json": {
68+
"schema": {
69+
"$ref": "#/components/schemas/Status"
70+
}
71+
}
72+
}
73+
}
74+
},
75+
"x-codeSamples": [
76+
{
77+
"label": "",
78+
"lang": "",
79+
"source": ""
80+
},
81+
{
82+
"label": "",
83+
"lang": "",
84+
"source": ""
85+
},
86+
{
87+
"label": "",
88+
"lang": "",
89+
"source": ""
90+
}
91+
]
92+
}
93+
},
4394
"/v1/tenants/create": {
4495
"post": {
4596
"tags": [
@@ -801,7 +852,7 @@
801852
"content": {
802853
"application/json": {
803854
"schema": {
804-
"$ref": "#/components/schemas/CheckBody"
855+
"$ref": "#/components/schemas/Permission.CheckBody"
805856
}
806857
}
807858
},
@@ -833,7 +884,7 @@
833884
{
834885
"label": "go",
835886
"lang": "go",
836-
"source": "cr, err := client.Permission.Check(context.Background(), &v1.PermissionCheckRequest {\n TenantId: \"t1\",\n Metadata: &v1.PermissionCheckRequestMetadata {\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n Entity: &v1.Entity {\n Type: \"repository\",\n Id: \"1\",\n },\n Permission: \"edit\",\n Subject: &v1.Subject {\n Type: \"user\",\n Id: \"1\",\n },\n\n if (cr.can === PermissionCheckResponse_Result.RESULT_ALLOWED) {\n // RESULT_ALLOWED\n } else {\n // RESULT_DENIED\n }\n})"
887+
"source": "cr, err := client.Permission.Check(context.Background(), &v1.PermissionCheckRequest {\n TenantId: \"t1\",\n Metadata: &v1.PermissionCheckRequestMetadata {\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n Entity: &v1.Entity {\n Type: \"repository\",\n Id: \"1\",\n },\n Permission: \"edit\",\n Subject: &v1.Subject {\n Type: \"user\",\n Id: \"1\",\n },\n})\nif cr.Can == v1.PermissionCheckResponse_Result_RESULT_ALLOWED {\n // RESULT_ALLOWED\n} else {\n // RESULT_DENIED\n}"
837888
},
838889
{
839890
"label": "node",
@@ -843,7 +894,7 @@
843894
{
844895
"label": "cURL",
845896
"lang": "curl",
846-
"source": "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/check' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\":{\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"permission\": \"edit\",\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\",\n \"relation\": \"\"\n },\n}'"
897+
"source": "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/check' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\": {\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"permission\": \"edit\",\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\",\n \"relation\": \"\"\n }\n}'"
847898
}
848899
],
849900
"x-codegen-request-body-name": "body"
@@ -1849,35 +1900,6 @@
18491900
},
18501901
"description": "BundleWriteResponse is the response for a BundleWriteRequest.\nIt includes a name which could be used as an identifier or acknowledgment."
18511902
},
1852-
"CheckBody": {
1853-
"type": "object",
1854-
"properties": {
1855-
"metadata": {
1856-
"$ref": "#/components/schemas/PermissionCheckRequestMetadata"
1857-
},
1858-
"entity": {
1859-
"$ref": "#/components/schemas/Entity"
1860-
},
1861-
"permission": {
1862-
"type": "string",
1863-
"description": "The action the user wants to perform on the resource"
1864-
},
1865-
"subject": {
1866-
"$ref": "#/components/schemas/Subject"
1867-
},
1868-
"context": {
1869-
"$ref": "#/components/schemas/Context"
1870-
},
1871-
"arguments": {
1872-
"type": "array",
1873-
"description": "Additional arguments associated with this request.",
1874-
"items": {
1875-
"$ref": "#/components/schemas/Argument"
1876-
}
1877-
}
1878-
},
1879-
"description": "PermissionCheckRequest is the request message for the Check method in the Permission service."
1880-
},
18811903
"CheckResult": {
18821904
"type": "string",
18831905
"description": "Enumerates results of a check operation.\n\n - CHECK_RESULT_UNSPECIFIED: Not specified check result. This is the default value.\n - CHECK_RESULT_ALLOWED: Represents a successful check (the check allowed the operation).\n - CHECK_RESULT_DENIED: Represents a failed check (the check denied the operation).",
@@ -1920,7 +1942,14 @@
19201942
},
19211943
"Child": {
19221944
"type": "object",
1923-
"properties": {},
1945+
"properties": {
1946+
"leaf": {
1947+
"$ref": "#/components/schemas/Leaf"
1948+
},
1949+
"rewrite": {
1950+
"$ref": "#/components/schemas/Rewrite"
1951+
}
1952+
},
19241953
"description": "Child represents a node in the permission tree."
19251954
},
19261955
"Comprehension": {
@@ -2380,7 +2409,6 @@
23802409
},
23812410
"Expr": {
23822411
"type": "object",
2383-
"properties": {},
23842412
"description": "An abstract representation of a common expression.\n\nExpressions are abstractly represented as a collection of identifiers,\nselect statements, function calls, literals, and comprehensions. All\noperators with the exception of the '.' operator are modelled as function\ncalls. This makes it easy to represent new operators into the existing AST.\n\nAll references within expressions must resolve to a [Decl][google.api.expr.v1alpha1.Decl] provided at\ntype-check for an expression to be valid. A reference may either be a bare\nidentifier `name` or a qualified identifier `google.api.name`. References\nmay either refer to a value or a function declaration.\n\nFor example, the expression `google.api.name.startsWith('expr')` references\nthe declaration `google.api.name` within a [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and\nthe function declaration `startsWith`."
23852413
},
23862414
"Expr.Call": {
@@ -2419,6 +2447,14 @@
24192447
},
24202448
"description": "Function type with result and arg types."
24212449
},
2450+
"HealthResponse": {
2451+
"type": "object",
2452+
"properties": {
2453+
"status": {
2454+
"type": "string"
2455+
}
2456+
}
2457+
},
24222458
"Ident": {
24232459
"type": "object",
24242460
"properties": {
@@ -2475,6 +2511,15 @@
24752511
},
24762512
"context": {
24772513
"$ref": "#/components/schemas/Context"
2514+
},
2515+
"page_size": {
2516+
"type": "integer",
2517+
"description": "page_size is the number of tenants to be returned in the response.\nThe value should be between 1 and 100.",
2518+
"format": "int64"
2519+
},
2520+
"continuous_token": {
2521+
"type": "string",
2522+
"description": "continuous_token is an optional parameter used for pagination.\nIt should be the value received in the previous response."
24782523
}
24792524
},
24802525
"description": "PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service."
@@ -2498,6 +2543,15 @@
24982543
},
24992544
"context": {
25002545
"$ref": "#/components/schemas/Context"
2546+
},
2547+
"page_size": {
2548+
"type": "integer",
2549+
"description": "page_size is the number of tenants to be returned in the response.\nThe value should be between 1 and 100.",
2550+
"format": "int64"
2551+
},
2552+
"continuous_token": {
2553+
"type": "string",
2554+
"description": "continuous_token is an optional parameter used for pagination.\nIt should be the value received in the previous response."
25012555
}
25022556
},
25032557
"description": "PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service."
@@ -2520,6 +2574,15 @@
25202574
},
25212575
"context": {
25222576
"$ref": "#/components/schemas/Context"
2577+
},
2578+
"page_size": {
2579+
"type": "integer",
2580+
"description": "page_size is the number of tenants to be returned in the response.\nThe value should be between 1 and 100.",
2581+
"format": "int64"
2582+
},
2583+
"continuous_token": {
2584+
"type": "string",
2585+
"description": "continuous_token is an optional parameter used for pagination.\nIt should be the value received in the previous response."
25232586
}
25242587
},
25252588
"description": "PermissionLookupSubjectRequest is the request message for the LookupSubject method in the Permission service."
@@ -2584,6 +2647,35 @@
25842647
}
25852648
}
25862649
},
2650+
"Permission.CheckBody": {
2651+
"type": "object",
2652+
"properties": {
2653+
"metadata": {
2654+
"$ref": "#/components/schemas/PermissionCheckRequestMetadata"
2655+
},
2656+
"entity": {
2657+
"$ref": "#/components/schemas/Entity"
2658+
},
2659+
"permission": {
2660+
"type": "string",
2661+
"description": "The action the user wants to perform on the resource"
2662+
},
2663+
"subject": {
2664+
"$ref": "#/components/schemas/Subject"
2665+
},
2666+
"context": {
2667+
"$ref": "#/components/schemas/Context"
2668+
},
2669+
"arguments": {
2670+
"type": "array",
2671+
"description": "Additional arguments associated with this request.",
2672+
"items": {
2673+
"$ref": "#/components/schemas/Argument"
2674+
}
2675+
}
2676+
},
2677+
"description": "PermissionCheckRequest is the request message for the Check method in the Permission service."
2678+
},
25872679
"Permission.ExpandBody": {
25882680
"type": "object",
25892681
"properties": {
@@ -2716,6 +2808,10 @@
27162808
"items": {
27172809
"type": "string"
27182810
}
2811+
},
2812+
"continuous_token": {
2813+
"type": "string",
2814+
"description": "continuous_token is a string that can be used to paginate and retrieve the next set of results."
27192815
}
27202816
},
27212817
"description": "PermissionLookupEntityResponse is the response message for the LookupEntity method in the Permission service."
@@ -2726,6 +2822,10 @@
27262822
"entity_id": {
27272823
"type": "string",
27282824
"description": "Identifier for an entity that matches the lookup."
2825+
},
2826+
"continuous_token": {
2827+
"type": "string",
2828+
"description": "continuous_token is a string that can be used to paginate and retrieve the next set of results."
27292829
}
27302830
},
27312831
"description": "PermissionLookupEntityStreamResponse is the response message for the LookupEntityStream method in the Permission service."
@@ -2758,6 +2858,10 @@
27582858
"items": {
27592859
"type": "string"
27602860
}
2861+
},
2862+
"continuous_token": {
2863+
"type": "string",
2864+
"description": "continuous_token is a string that can be used to paginate and retrieve the next set of results."
27612865
}
27622866
},
27632867
"description": "PermissionLookupSubjectResponse is the response message for the LookupSubject method in the Permission service."
@@ -3506,7 +3610,6 @@
35063610
},
35073611
"v1.Expand": {
35083612
"type": "object",
3509-
"properties": {},
35103613
"description": "Expand is used to define a hierarchical structure for permissions.\nIt has an entity, permission, and arguments. The node can be either another hierarchical structure or a set of subjects."
35113614
},
35123615
"v1.Operation": {
@@ -3565,7 +3668,54 @@
35653668
},
35663669
"v1alpha1.Type": {
35673670
"type": "object",
3568-
"properties": {},
3671+
"properties": {
3672+
"dyn": {
3673+
"type": "object",
3674+
"properties": {},
3675+
"description": "Dynamic type."
3676+
},
3677+
"null": {
3678+
"type": "string",
3679+
"description": "Null value."
3680+
},
3681+
"primitive": {
3682+
"$ref": "#/components/schemas/PrimitiveType"
3683+
},
3684+
"wrapper": {
3685+
"$ref": "#/components/schemas/PrimitiveType"
3686+
},
3687+
"wellKnown": {
3688+
"$ref": "#/components/schemas/WellKnownType"
3689+
},
3690+
"listType": {
3691+
"$ref": "#/components/schemas/ListType"
3692+
},
3693+
"mapType": {
3694+
"$ref": "#/components/schemas/MapType"
3695+
},
3696+
"function": {
3697+
"$ref": "#/components/schemas/FunctionType"
3698+
},
3699+
"messageType": {
3700+
"type": "string",
3701+
"description": "Protocol buffer message type.\n\nThe `message_type` string specifies the qualified message type name. For\nexample, `google.plus.Profile`."
3702+
},
3703+
"typeParam": {
3704+
"type": "string",
3705+
"description": "Type param type.\n\nThe `type_param` string specifies the type parameter name, e.g. `list<E>`\nwould be a `list_type` whose element type was a `type_param` type\nnamed `E`."
3706+
},
3707+
"type": {
3708+
"$ref": "#/components/schemas/v1alpha1.Type"
3709+
},
3710+
"error": {
3711+
"type": "object",
3712+
"properties": {},
3713+
"description": "Error type.\n\nDuring type-checking if an expression is an error, its type is propagated\nas the `ERROR` type. This permits the type-checker to discover other\nerrors present in the expression."
3714+
},
3715+
"abstractType": {
3716+
"$ref": "#/components/schemas/AbstractType"
3717+
}
3718+
},
35693719
"description": "Represents a CEL type."
35703720
}
35713721
},

0 commit comments

Comments
 (0)