From d7cd87d2c1ef778d56b2c78f48234a02a04b84b3 Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Thu, 11 Apr 2024 15:21:32 +0300 Subject: [PATCH] fix(docs): Consistent use of FGA_API_URL (#713) --- docs/content/getting-started/configure-model.mdx | 14 +++++++------- docs/content/getting-started/create-store.mdx | 2 +- docs/content/getting-started/framework.mdx | 4 ++-- docs/content/getting-started/perform-check.mdx | 14 +++++++------- .../getting-started/perform-list-objects.mdx | 14 +++++++------- .../setup-openfga/configure-openfga.mdx | 4 ++-- docs/content/getting-started/setup-sdk-client.mdx | 6 +++--- docs/content/getting-started/update-tuples.mdx | 14 +++++++------- docs/content/interacting/read-tuple-changes.mdx | 12 ++++++------ src/components/Docs/SdkSetup/Prerequisite.tsx | 4 ++-- .../Docs/SnippetViewer/CheckRequestViewer.tsx | 2 +- .../Docs/SnippetViewer/ExpandRequestViewer.tsx | 2 +- .../SnippetViewer/ListObjectsRequestViewer.tsx | 2 +- .../SnippetViewer/ReadChangesRequestViewer.tsx | 2 +- .../Docs/SnippetViewer/ReadRequestViewer.tsx | 2 +- src/components/Docs/SnippetViewer/SdkSetup.tsx | 6 +++--- .../Docs/SnippetViewer/WriteAuthzModelViewer.tsx | 2 +- .../Docs/SnippetViewer/WriteRequestViewer.tsx | 2 +- 18 files changed, 54 insertions(+), 54 deletions(-) diff --git a/docs/content/getting-started/configure-model.mdx b/docs/content/getting-started/configure-model.mdx index 2fabdd19c..839a389a1 100644 --- a/docs/content/getting-started/configure-model.mdx +++ b/docs/content/getting-started/configure-model.mdx @@ -32,14 +32,14 @@ This article explains how to configure an 2. You have [installed the SDK](./install-sdk.mdx), [created the store](./create-store.mdx) and [setup the SDK client](./setup-sdk-client.mdx). -3. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +3. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -55,7 +55,7 @@ This article explains how to configure an 2. You have [installed the SDK](./install-sdk.mdx), [created the store](./create-store.mdx) and [setup the SDK client](./setup-sdk-client.mdx). -3. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +3. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -71,14 +71,14 @@ This article explains how to configure an ```shell -curl -X POST $FGA_API_HOST/stores \ +curl -X POST $FGA_API_URL/stores \ -H "content-type: application/json" \ -d '{"name": "FGA Demo Store"}' ``` diff --git a/docs/content/getting-started/framework.mdx b/docs/content/getting-started/framework.mdx index bec01e8d2..670390d9b 100644 --- a/docs/content/getting-started/framework.mdx +++ b/docs/content/getting-started/framework.mdx @@ -34,7 +34,7 @@ This section will illustrate how to integrate @@ -43,7 +43,7 @@ This section will illustrate how to integrate diff --git a/docs/content/getting-started/perform-check.mdx b/docs/content/getting-started/perform-check.mdx index bf687cdfd..9f5733c16 100644 --- a/docs/content/getting-started/perform-check.mdx +++ b/docs/content/getting-started/perform-check.mdx @@ -35,7 +35,7 @@ This section will illustrate how to perform a 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx) and [updated the _relationship tuples_](./update-tuples.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -53,7 +53,7 @@ This section will illustrate how to perform a 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx) and [updated the _relationship tuples_](./update-tuples.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -71,7 +71,7 @@ This section will illustrate how to perform a 2. You have [configured the _authorization model_](./configure-model.mdx). -3. You have loaded `FGA_STORE_ID` and `FGA_SERVER_URL` as environment variables. +3. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -87,7 +87,7 @@ This section will illustrate how to perform a 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx) and [updated the _relationship tuples_](./update-tuples.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -44,7 +44,7 @@ This section will illustrate how to perform a 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx) and [updated the _relationship tuples_](./update-tuples.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -62,7 +62,7 @@ This section will illustrate how to perform a 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx) and [updated the _relationship tuples_](./update-tuples.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -79,7 +79,7 @@ This section will illustrate how to perform a 2. You have [configured the _authorization model_](./configure-model.mdx) and [updated the _relationship tuples_](./update-tuples.mdx). -3. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +3. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. diff --git a/docs/content/getting-started/setup-openfga/configure-openfga.mdx b/docs/content/getting-started/setup-openfga/configure-openfga.mdx index 5111c88dc..5dc63a59e 100644 --- a/docs/content/getting-started/setup-openfga/configure-openfga.mdx +++ b/docs/content/getting-started/setup-openfga/configure-openfga.mdx @@ -232,7 +232,7 @@ OpenFGA is configured with an HTTP health check endpoint `/healthz` and a gRPC h ```shell -curl -X GET $FGA_API_HOST/healthz +curl -X GET $FGA_API_URL/healthz # {"status":"SERVING"} ``` @@ -243,7 +243,7 @@ curl -X GET $FGA_API_HOST/healthz ```shell # See https://github.com/fullstorydev/grpcurl#installation -grpcurl -plaintext $FGA_API_HOST grpc.health.v1.Health/Check +grpcurl -plaintext $FGA_API_URL grpc.health.v1.Health/Check # {"status":"SERVING"} ``` diff --git a/docs/content/getting-started/setup-sdk-client.mdx b/docs/content/getting-started/setup-sdk-client.mdx index 52de9720c..9419835ef 100644 --- a/docs/content/getting-started/setup-sdk-client.mdx +++ b/docs/content/getting-started/setup-sdk-client.mdx @@ -133,7 +133,7 @@ public class Example { ```shell -export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 +export FGA_API_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \`store create\`, \`store list\` and \`model validate\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty ``` @@ -288,7 +288,7 @@ public class Example { ```shell -export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 +export FGA_API_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \`store create\`, \`store list\` and \`model validate\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty export FGA_API_TOKEN=YOUR_API_TOKEN @@ -456,7 +456,7 @@ public class Example { ```shell -export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 +export FGA_API_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \`store create\`, \`store list\` and \`model validate\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty export FGA_API_TOKEN_ISSUER=YOUR_API_TOKEN_ISSUER diff --git a/docs/content/getting-started/update-tuples.mdx b/docs/content/getting-started/update-tuples.mdx index 587483350..99e16a338 100644 --- a/docs/content/getting-started/update-tuples.mdx +++ b/docs/content/getting-started/update-tuples.mdx @@ -34,7 +34,7 @@ This section will illustrate how to update _ 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -50,7 +50,7 @@ This section will illustrate how to update _ 2. You have [installed the SDK](./install-sdk.mdx). 3. You have [configured the _authorization model_](./configure-model.mdx). -4. You have loaded `FGA_STORE_ID` and `FGA_API_HOST` as environment variables. +4. You have loaded `FGA_STORE_ID` and `FGA_API_URL` as environment variables. @@ -66,21 +66,21 @@ This section will illustrate how to update _ `"${r}"`).join(', ')}]}`; case SupportedLanguage.CURL: /* eslint-disable max-len */ - return `curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ + return `curl -X POST $FGA_API_URL/stores/$FGA_STORE_ID/list-objects \\ -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization -H "content-type: application/json" \\ -d '{ diff --git a/src/components/Docs/SnippetViewer/ReadChangesRequestViewer.tsx b/src/components/Docs/SnippetViewer/ReadChangesRequestViewer.tsx index f39a440b8..189e51381 100644 --- a/src/components/Docs/SnippetViewer/ReadChangesRequestViewer.tsx +++ b/src/components/Docs/SnippetViewer/ReadChangesRequestViewer.tsx @@ -22,7 +22,7 @@ function readChangesRequestViewer(lang: SupportedLanguage, opts: ReadChangesRequ const tokenString = `${opts.continuationToken ? '"continuation_token": "' + opts.continuationToken + '", ' : ''}`; // eslint-disable-next-line max-len const pageSizeString = `${opts.pageSize ? '"page_size": ' + opts.pageSize : ''}`; - return `curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ + return `curl -X POST $FGA_API_URL/stores/$FGA_STORE_ID/changes \\ -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization -H "content-type: application/json" \\ -d '{${typeString}${tokenString}${pageSizeString}}'`; diff --git a/src/components/Docs/SnippetViewer/ReadRequestViewer.tsx b/src/components/Docs/SnippetViewer/ReadRequestViewer.tsx index 237897656..cb87eb457 100644 --- a/src/components/Docs/SnippetViewer/ReadRequestViewer.tsx +++ b/src/components/Docs/SnippetViewer/ReadRequestViewer.tsx @@ -48,7 +48,7 @@ function readRequestViewer(lang: SupportedLanguage, opts: ReadRequestViewerOpts) : ''; // eslint-disable-next-line max-len - return `curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ + return `curl -X POST $FGA_API_URL/stores/$FGA_STORE_ID/read \\ -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization -H "content-type: application/json" ${requestTuplePayload}' diff --git a/src/components/Docs/SnippetViewer/SdkSetup.tsx b/src/components/Docs/SnippetViewer/SdkSetup.tsx index 66d654f3b..790ab8a9b 100644 --- a/src/components/Docs/SnippetViewer/SdkSetup.tsx +++ b/src/components/Docs/SnippetViewer/SdkSetup.tsx @@ -35,7 +35,7 @@ export function sdkSetupHeader(lang: SupportedLanguage, languageMappings: Langua switch (lang) { case SupportedLanguage.CURL: case SupportedLanguage.CLI: - return `Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) + return `Set FGA_API_URL according to the service you are using (e.g. https://api.fga.example) `; case SupportedLanguage.JS_SDK: @@ -159,11 +159,11 @@ export function GenerateSetupHeader(lang: SupportedLanguage, skipSetup?: boolean break; case SupportedLanguage.CLI: content = sdkSetupHeader(SupportedLanguage.CLI, configuredLanguage); - summary = 'Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)'; + summary = 'Set FGA_API_URL according to the service you are using (e.g. https://api.fga.example)'; break; case SupportedLanguage.CURL: content = sdkSetupHeader(SupportedLanguage.CURL, configuredLanguage); - summary = 'Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)'; + summary = 'Set FGA_API_URL according to the service you are using (e.g. https://api.fga.example)'; break; case SupportedLanguage.PLAYGROUND: diff --git a/src/components/Docs/SnippetViewer/WriteAuthzModelViewer.tsx b/src/components/Docs/SnippetViewer/WriteAuthzModelViewer.tsx index 5c9da840e..9020dc349 100644 --- a/src/components/Docs/SnippetViewer/WriteAuthzModelViewer.tsx +++ b/src/components/Docs/SnippetViewer/WriteAuthzModelViewer.tsx @@ -14,7 +14,7 @@ function writeAuthZModelViewerCli(authorizationModel: AuthorizationModel): strin } function writeAuthZModelViewerCurl(authorizationModel: AuthorizationModel): string { - return `curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/authorization-models \\ + return `curl -X POST $FGA_API_URL/stores/$FGA_STORE_ID/authorization-models \\ -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization -H "content-type: application/json" \\ -d '${JSON.stringify(authorizationModel)}'`; diff --git a/src/components/Docs/SnippetViewer/WriteRequestViewer.tsx b/src/components/Docs/SnippetViewer/WriteRequestViewer.tsx index 78b42d754..c9f52e3ed 100644 --- a/src/components/Docs/SnippetViewer/WriteRequestViewer.tsx +++ b/src/components/Docs/SnippetViewer/WriteRequestViewer.tsx @@ -68,7 +68,7 @@ ${ const writes = `"writes": { "tuple_keys" : [${writeTuples}] }`; const deletes = `"deletes": { "tuple_keys" : [${deleteTuples}] }`; const separator = `${opts.deleteRelationshipTuples && opts.relationshipTuples ? ',' : ''}`; - return `curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ + return `curl -X POST $FGA_API_URL/stores/$FGA_STORE_ID/write \\ -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization -H "content-type: application/json" \\ -d '{${opts.relationshipTuples ? writes : ''}${separator}${