|
12 | 12 | "name": "Apache-2.0 license",
|
13 | 13 | "url": "https://github.com/Permify/permify/blob/master/LICENSE"
|
14 | 14 | },
|
15 |
| - "version": "v0.10.1" |
| 15 | + "version": "v1.0.2" |
16 | 16 | },
|
17 | 17 | "servers": [
|
18 | 18 | {
|
19 | 19 | "url": "/"
|
20 | 20 | }
|
21 | 21 | ],
|
22 | 22 | "tags": [
|
| 23 | + { |
| 24 | + "name": "Health" |
| 25 | + }, |
23 | 26 | {
|
24 | 27 | "name": "Permission"
|
25 | 28 | },
|
|
40 | 43 | }
|
41 | 44 | ],
|
42 | 45 | "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 | + }, |
43 | 94 | "/v1/tenants/create": {
|
44 | 95 | "post": {
|
45 | 96 | "tags": [
|
|
801 | 852 | "content": {
|
802 | 853 | "application/json": {
|
803 | 854 | "schema": {
|
804 |
| - "$ref": "#/components/schemas/CheckBody" |
| 855 | + "$ref": "#/components/schemas/Permission.CheckBody" |
805 | 856 | }
|
806 | 857 | }
|
807 | 858 | },
|
|
833 | 884 | {
|
834 | 885 | "label": "go",
|
835 | 886 | "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}" |
837 | 888 | },
|
838 | 889 | {
|
839 | 890 | "label": "node",
|
|
843 | 894 | {
|
844 | 895 | "label": "cURL",
|
845 | 896 | "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}'" |
847 | 898 | }
|
848 | 899 | ],
|
849 | 900 | "x-codegen-request-body-name": "body"
|
|
1849 | 1900 | },
|
1850 | 1901 | "description": "BundleWriteResponse is the response for a BundleWriteRequest.\nIt includes a name which could be used as an identifier or acknowledgment."
|
1851 | 1902 | },
|
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 |
| - }, |
1881 | 1903 | "CheckResult": {
|
1882 | 1904 | "type": "string",
|
1883 | 1905 | "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 | 1942 | },
|
1921 | 1943 | "Child": {
|
1922 | 1944 | "type": "object",
|
1923 |
| - "properties": {}, |
| 1945 | + "properties": { |
| 1946 | + "leaf": { |
| 1947 | + "$ref": "#/components/schemas/Leaf" |
| 1948 | + }, |
| 1949 | + "rewrite": { |
| 1950 | + "$ref": "#/components/schemas/Rewrite" |
| 1951 | + } |
| 1952 | + }, |
1924 | 1953 | "description": "Child represents a node in the permission tree."
|
1925 | 1954 | },
|
1926 | 1955 | "Comprehension": {
|
|
2380 | 2409 | },
|
2381 | 2410 | "Expr": {
|
2382 | 2411 | "type": "object",
|
2383 |
| - "properties": {}, |
2384 | 2412 | "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`."
|
2385 | 2413 | },
|
2386 | 2414 | "Expr.Call": {
|
|
2419 | 2447 | },
|
2420 | 2448 | "description": "Function type with result and arg types."
|
2421 | 2449 | },
|
| 2450 | + "HealthResponse": { |
| 2451 | + "type": "object", |
| 2452 | + "properties": { |
| 2453 | + "status": { |
| 2454 | + "type": "string" |
| 2455 | + } |
| 2456 | + } |
| 2457 | + }, |
2422 | 2458 | "Ident": {
|
2423 | 2459 | "type": "object",
|
2424 | 2460 | "properties": {
|
|
2475 | 2511 | },
|
2476 | 2512 | "context": {
|
2477 | 2513 | "$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." |
2478 | 2523 | }
|
2479 | 2524 | },
|
2480 | 2525 | "description": "PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service."
|
|
2498 | 2543 | },
|
2499 | 2544 | "context": {
|
2500 | 2545 | "$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." |
2501 | 2555 | }
|
2502 | 2556 | },
|
2503 | 2557 | "description": "PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service."
|
|
2520 | 2574 | },
|
2521 | 2575 | "context": {
|
2522 | 2576 | "$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." |
2523 | 2586 | }
|
2524 | 2587 | },
|
2525 | 2588 | "description": "PermissionLookupSubjectRequest is the request message for the LookupSubject method in the Permission service."
|
|
2584 | 2647 | }
|
2585 | 2648 | }
|
2586 | 2649 | },
|
| 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 | + }, |
2587 | 2679 | "Permission.ExpandBody": {
|
2588 | 2680 | "type": "object",
|
2589 | 2681 | "properties": {
|
|
2716 | 2808 | "items": {
|
2717 | 2809 | "type": "string"
|
2718 | 2810 | }
|
| 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." |
2719 | 2815 | }
|
2720 | 2816 | },
|
2721 | 2817 | "description": "PermissionLookupEntityResponse is the response message for the LookupEntity method in the Permission service."
|
|
2726 | 2822 | "entity_id": {
|
2727 | 2823 | "type": "string",
|
2728 | 2824 | "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." |
2729 | 2829 | }
|
2730 | 2830 | },
|
2731 | 2831 | "description": "PermissionLookupEntityStreamResponse is the response message for the LookupEntityStream method in the Permission service."
|
|
2758 | 2858 | "items": {
|
2759 | 2859 | "type": "string"
|
2760 | 2860 | }
|
| 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." |
2761 | 2865 | }
|
2762 | 2866 | },
|
2763 | 2867 | "description": "PermissionLookupSubjectResponse is the response message for the LookupSubject method in the Permission service."
|
|
3506 | 3610 | },
|
3507 | 3611 | "v1.Expand": {
|
3508 | 3612 | "type": "object",
|
3509 |
| - "properties": {}, |
3510 | 3613 | "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."
|
3511 | 3614 | },
|
3512 | 3615 | "v1.Operation": {
|
|
3565 | 3668 | },
|
3566 | 3669 | "v1alpha1.Type": {
|
3567 | 3670 | "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 | + }, |
3569 | 3719 | "description": "Represents a CEL type."
|
3570 | 3720 | }
|
3571 | 3721 | },
|
|
0 commit comments