From d847b1a332de50e0fde362227e6853156685546a Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Wed, 27 Nov 2024 22:18:37 +0000 Subject: [PATCH 1/2] fix: correct type for contextual tuples in python (#884) --- src/components/Docs/SnippetViewer/CheckRequestViewer.tsx | 4 +--- .../Docs/SnippetViewer/ListObjectsRequestViewer.tsx | 4 +--- src/components/Docs/SnippetViewer/ListUsersRequestViewer.tsx | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/components/Docs/SnippetViewer/CheckRequestViewer.tsx b/src/components/Docs/SnippetViewer/CheckRequestViewer.tsx index ae42a6c65..770866e82 100644 --- a/src/components/Docs/SnippetViewer/CheckRequestViewer.tsx +++ b/src/components/Docs/SnippetViewer/CheckRequestViewer.tsx @@ -162,9 +162,7 @@ body = ClientCheckRequest( ? ` contextual_tuples=[ ${contextualTuples - .map( - (tuple) => `ClientTupleKey(user="${tuple.user}", relation="${tuple.relation}", object="${tuple.object}")`, - ) + .map((tuple) => `ClientTuple(user="${tuple.user}", relation="${tuple.relation}", object="${tuple.object}")`) .join(',\n ')} ],` : `` diff --git a/src/components/Docs/SnippetViewer/ListObjectsRequestViewer.tsx b/src/components/Docs/SnippetViewer/ListObjectsRequestViewer.tsx index 7ce197155..aaaba6373 100644 --- a/src/components/Docs/SnippetViewer/ListObjectsRequestViewer.tsx +++ b/src/components/Docs/SnippetViewer/ListObjectsRequestViewer.tsx @@ -182,9 +182,7 @@ body = ClientListObjectsRequest( ? ` contextual_tuples=[ ${contextualTuples - .map( - (tuple) => `ClientTupleKey(user="${tuple.user}", relation="${tuple.relation}", object="${tuple.object}")`, - ) + .map((tuple) => `ClientTuple(user="${tuple.user}", relation="${tuple.relation}", object="${tuple.object}")`) .join(',\n ')} ],` : `` diff --git a/src/components/Docs/SnippetViewer/ListUsersRequestViewer.tsx b/src/components/Docs/SnippetViewer/ListUsersRequestViewer.tsx index 67404a27b..e68ade211 100644 --- a/src/components/Docs/SnippetViewer/ListUsersRequestViewer.tsx +++ b/src/components/Docs/SnippetViewer/ListUsersRequestViewer.tsx @@ -240,9 +240,7 @@ var response = await fgaClient.ListUsers(body, options); ? ` contextual_tuples=[ ${contextualTuples - .map( - (tuple) => `ClientTupleKey(user="${tuple.user}", relation="${tuple.relation}", object="${tuple.object}")`, - ) + .map((tuple) => `ClientTuple(user="${tuple.user}", relation="${tuple.relation}", object="${tuple.object}")`) .join(',\n ')} ],` : `` From d1123171c73c8c8a15c0398a98752bea23a5c89c Mon Sep 17 00:00:00 2001 From: Soura Bhattacharyya Date: Thu, 28 Nov 2024 03:52:48 +0530 Subject: [PATCH 2/2] chore: reword the definition of a `relation` in Contextual and Time-based Authorization documentation (#831) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrés Aguiar Co-authored-by: Raghd Hamzeh --- docs/content/modeling/contextual-time-based-authorization.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/modeling/contextual-time-based-authorization.mdx b/docs/content/modeling/contextual-time-based-authorization.mdx index 937dd0e21..62179e262 100644 --- a/docs/content/modeling/contextual-time-based-authorization.mdx +++ b/docs/content/modeling/contextual-time-based-authorization.mdx @@ -41,7 +41,7 @@ To follow this guide, you should be familiar with some . ### concepts -- A : is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system. +- A : Defined in the type definition of an authorization model, a relation is a string that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system. - A : is a call to the check endpoint that returns whether the user has a certain relationship with an object. - A : a grouping consisting of a user, a relation and an object stored in - A : a tuple that can be added to a Check request, and only exists within the context of that particular request.