From 769ea8a252399ee066e6bc56bf20f397fc4da7a0 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Mon, 8 Apr 2024 17:47:32 +0100 Subject: [PATCH 1/2] chore(go-sdk): update code block for retry configuration --- .../go/template/README_retries.mustache | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/config/clients/go/template/README_retries.mustache b/config/clients/go/template/README_retries.mustache index 42af72e9..49a9027f 100644 --- a/config/clients/go/template/README_retries.mustache +++ b/config/clients/go/template/README_retries.mustache @@ -6,23 +6,24 @@ Apply your custom retry values by passing this struct to the `ClientConfiguratio ```golang import ( - . "github.com/openfga/go-sdk/client" - "os" + "os" + + openfga "github.com/openfga/go-sdk" + . "github.com/openfga/go-sdk/client" ) func main() { - fgaClient, err := NewSdkClient(&ClientConfiguration{ - ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.fga.example - StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production - RetryParams: &openfga.RetryParams{ - MaxRetry: 3, // retry up to 3 times on API requests - MinWaitInMs: 250, // wait a minimum of 250 milliseconds between requests - }, - }) + fgaClient, err := NewSdkClient(&ClientConfiguration{ + ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.fga.example + StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` + AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + RetryParams: &openfga.RetryParams{ + MaxRetry: 3, // retry up to 3 times on API requests + MinWaitInMs: 250, // wait a minimum of 250 milliseconds between requests + }, + }) - if err != nil { - // .. Handle error - } -} -``` \ No newline at end of file + if err != nil { + // .. Handle error + } +} \ No newline at end of file From e69524ccef962fb5b2b030d978b0ab0e7112de4f Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 10:41:29 +0100 Subject: [PATCH 2/2] chore: rename FGA_AUTHORIZATION_MODEL_ID to FGA_MODEL_ID --- config/clients/dotnet/CHANGELOG.md.mustache | 2 +- .../clients/dotnet/template/README_initializing.mustache | 6 +++--- config/clients/dotnet/template/README_retries.mustache | 2 +- .../clients/dotnet/template/example/Example1/Example1.cs | 2 +- config/clients/go/CHANGELOG.md.mustache | 2 +- config/clients/go/template/README_initializing.mustache | 8 ++++---- config/clients/go/template/README_retries.mustache | 2 +- config/clients/go/template/example/example1/example1.go | 2 +- config/clients/java/template/README_initializing.mustache | 8 ++++---- config/clients/java/template/README_retries.mustache | 2 +- .../src/main/java/dev/openfga/sdk/example/Example1.java | 2 +- .../main/kotlin/dev/openfga/sdk/example/KotlinExample1.kt | 2 +- config/clients/js/template/README_initializing.mustache | 6 +++--- config/clients/js/template/README_retries.mustache | 2 +- config/clients/js/template/example/example1/example1.mjs | 2 +- .../clients/python/template/README_calling_api.mustache | 2 +- .../clients/python/template/README_initializing.mustache | 8 ++++---- 17 files changed, 30 insertions(+), 30 deletions(-) diff --git a/config/clients/dotnet/CHANGELOG.md.mustache b/config/clients/dotnet/CHANGELOG.md.mustache index 7b06c3df..e17bcdd5 100644 --- a/config/clients/dotnet/CHANGELOG.md.mustache +++ b/config/clients/dotnet/CHANGELOG.md.mustache @@ -38,7 +38,7 @@ Some of the changes to expect: var configuration = new ClientConfiguration() { ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL"), // required, e.g. https://api.fga.example StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_AUTHORIZATION_MODEL_ID"), // Optional, can be overridden per request + AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); ``` diff --git a/config/clients/dotnet/template/README_initializing.mustache b/config/clients/dotnet/template/README_initializing.mustache index fea0cea5..a7881577 100644 --- a/config/clients/dotnet/template/README_initializing.mustache +++ b/config/clients/dotnet/template/README_initializing.mustache @@ -16,7 +16,7 @@ namespace Example { var configuration = new ClientConfiguration() { ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL") ?? "http://localhost:8080", // required, e.g. https://api.{{sampleApiDomain}} StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_AUTHORIZATION_MODEL_ID"), // Optional, can be overridden per request + AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request }; var fgaClient = new {{appShortName}}Client(configuration); var response = await fgaClient.ReadAuthorizationModels(); @@ -42,7 +42,7 @@ namespace Example { var configuration = new ClientConfiguration() { ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL") ?? "http://localhost:8080", // required, e.g. https://api.{{sampleApiDomain}} StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_AUTHORIZATION_MODEL_ID"), // Optional, can be overridden per request + AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request Credentials = new Credentials() { Method = CredentialsMethod.ApiToken, Config = new CredentialsConfig() { @@ -74,7 +74,7 @@ namespace Example { var configuration = new ClientConfiguration() { ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL") ?? "http://localhost:8080", // required, e.g. https://api.{{sampleApiDomain}} StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_AUTHORIZATION_MODEL_ID"), // Optional, can be overridden per request + AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request Credentials = new Credentials() { Method = CredentialsMethod.ClientCredentials, Config = new CredentialsConfig() { diff --git a/config/clients/dotnet/template/README_retries.mustache b/config/clients/dotnet/template/README_retries.mustache index 6ebd963e..af18dd41 100644 --- a/config/clients/dotnet/template/README_retries.mustache +++ b/config/clients/dotnet/template/README_retries.mustache @@ -16,7 +16,7 @@ namespace Example { var configuration = new ClientConfiguration() { ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL") ?? "http://localhost:8080", // required, e.g. https://api.fga.example StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_AUTHORIZATION_MODEL_ID"), // Optional, can be overridden per request + AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request RetryParams = new RetryParams() { MaxRetry = 3, // retry up to 3 times on API requests MinWaitInMs = 250 // wait a minimum of 250 milliseconds between requests diff --git a/config/clients/dotnet/template/example/Example1/Example1.cs b/config/clients/dotnet/template/example/Example1/Example1.cs index 7bf7a189..f4e003d0 100644 --- a/config/clients/dotnet/template/example/Example1/Example1.cs +++ b/config/clients/dotnet/template/example/Example1/Example1.cs @@ -24,7 +24,7 @@ public static async Task Main() { var configuration = new ClientConfiguration { ApiUrl = Environment.GetEnvironmentVariable("FGA_API_URL") ?? "http://localhost:8080", // required, e.g. https://api.fga.example StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_AUTHORIZATION_MODEL_ID"), // Optional, can be overridden per request + AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request Credentials = credentials }; var fgaClient = new OpenFgaClient(configuration); diff --git a/config/clients/go/CHANGELOG.md.mustache b/config/clients/go/CHANGELOG.md.mustache index 87cd60b0..79fb8be2 100644 --- a/config/clients/go/CHANGELOG.md.mustache +++ b/config/clients/go/CHANGELOG.md.mustache @@ -61,7 +61,7 @@ Some of the changes to expect: fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.fga.example StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production }) ``` - When initializing a client, `AuthorizationModelId` is no longer a pointer, and you can just pass the string directly diff --git a/config/clients/go/template/README_initializing.mustache b/config/clients/go/template/README_initializing.mustache index 415a9858..98f5b704 100644 --- a/config/clients/go/template/README_initializing.mustache +++ b/config/clients/go/template/README_initializing.mustache @@ -14,7 +14,7 @@ func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.{{sampleApiDomain}} StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production }) if err != nil { @@ -36,7 +36,7 @@ func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.{{sampleApiDomain}} StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodApiToken, Config: &credentials.Config{ @@ -65,7 +65,7 @@ func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.{{sampleApiDomain}} StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodClientCredentials, Config: &credentials.Config{ @@ -97,7 +97,7 @@ func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.{{sampleApiDomain}} StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodClientCredentials, Config: &credentials.Config{ diff --git a/config/clients/go/template/README_retries.mustache b/config/clients/go/template/README_retries.mustache index 49a9027f..aa5d3361 100644 --- a/config/clients/go/template/README_retries.mustache +++ b/config/clients/go/template/README_retries.mustache @@ -16,7 +16,7 @@ func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.fga.example StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production RetryParams: &openfga.RetryParams{ MaxRetry: 3, // retry up to 3 times on API requests MinWaitInMs: 250, // wait a minimum of 250 milliseconds between requests diff --git a/config/clients/go/template/example/example1/example1.go b/config/clients/go/template/example/example1/example1.go index 3d2ad43d..6e547d70 100644 --- a/config/clients/go/template/example/example1/example1.go +++ b/config/clients/go/template/example/example1/example1.go @@ -32,7 +32,7 @@ func mainInner() error { fgaClient, err := client.NewSdkClient(&client.ClientConfiguration{ ApiUrl: apiUrl, StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores` - AuthorizationModelId: os.Getenv("FGA_AUTHORIZATION_MODEL_ID"), // optional, recommended to be set for production + AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production Credentials: &creds, }) diff --git a/config/clients/java/template/README_initializing.mustache b/config/clients/java/template/README_initializing.mustache index bbf2f0d4..e6c85e29 100644 --- a/config/clients/java/template/README_initializing.mustache +++ b/config/clients/java/template/README_initializing.mustache @@ -15,7 +15,7 @@ public class Example { var config = new ClientConfiguration() .apiUrl(System.getenv("FGA_API_URL")) // If not specified, will default to "http://localhost:8080" .storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores() - .authorizationModelId(System.getenv("FGA_AUTHORIZATION_MODEL_ID")); // Optional, can be overridden per request + .authorizationModelId(System.getenv("FGA_MODEL_ID")); // Optional, can be overridden per request var fgaClient = new OpenFgaClient(config); var response = fgaClient.readAuthorizationModels().get(); @@ -38,7 +38,7 @@ public class Example { var config = new ClientConfiguration() .apiUrl(System.getenv("FGA_API_URL")) // If not specified, will default to "http://localhost:8080" .storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores() - .authorizationModelId(System.getenv("FGA_AUTHORIZATION_MODEL_ID")) // Optional, can be overridden per request + .authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request .credentials(new Credentials( new ApiToken(System.getenv("FGA_API_TOKEN")) // will be passed as the "Authorization: Bearer ${ApiToken}" request header )); @@ -64,7 +64,7 @@ public class Example { var config = new ClientConfiguration() .apiUrl(System.getenv("FGA_API_URL")) // If not specified, will default to "http://localhost:8080" .storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores() - .authorizationModelId(System.getenv("FGA_AUTHORIZATION_MODEL_ID")) // Optional, can be overridden per request + .authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request .credentials(new Credentials( new ClientCredentials() .apiTokenIssuer(System.getenv("FGA_API_TOKEN_ISSUER")) @@ -94,7 +94,7 @@ public class Example { var config = new ClientConfiguration() .apiUrl(System.getenv("FGA_API_URL")) // If not specified, will default to "http://localhost:8080" .storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores() - .authorizationModelId(System.getenv("FGA_AUTHORIZATION_MODEL_ID")) // Optional, can be overridden per request + .authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request .credentials(new Credentials( new ClientCredentials() .apiTokenIssuer(System.getenv("FGA_API_TOKEN_ISSUER")) diff --git a/config/clients/java/template/README_retries.mustache b/config/clients/java/template/README_retries.mustache index 1231d7e7..cf187eb7 100644 --- a/config/clients/java/template/README_retries.mustache +++ b/config/clients/java/template/README_retries.mustache @@ -13,7 +13,7 @@ public class Example { var config = new ClientConfiguration() .apiUrl(System.getenv("FGA_API_URL")) // If not specified, will default to "http://localhost:8080" .storeId(System.getenv("FGA_STORE_ID")) // Not required when calling createStore() or listStores() - .authorizationModelId(System.getenv("FGA_AUTHORIZATION_MODEL_ID")) // Optional, can be overridden per request + .authorizationModelId(System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request .maxRetries(3) // retry up to 3 times on API requests .minimumRetryDelay(250); // wait a minimum of 250 milliseconds between requests diff --git a/config/clients/java/template/example/example1/src/main/java/dev/openfga/sdk/example/Example1.java b/config/clients/java/template/example/example1/src/main/java/dev/openfga/sdk/example/Example1.java index d17c42a1..efbb7ba9 100644 --- a/config/clients/java/template/example/example1/src/main/java/dev/openfga/sdk/example/Example1.java +++ b/config/clients/java/template/example/example1/src/main/java/dev/openfga/sdk/example/Example1.java @@ -29,7 +29,7 @@ public void run(String apiUrl) throws Exception { .apiUrl(apiUrl) // required, e.g. https://api.fga.example .storeId(System.getenv("FGA_STORE_ID")) // not needed when calling `CreateStore` or `ListStores` .authorizationModelId( - System.getenv("FGA_AUTHORIZATION_MODEL_ID")) // Optional, can be overridden per request + System.getenv("FGA_MODEL_ID")) // Optional, can be overridden per request .credentials(credentials); var fgaClient = new OpenFgaClient(configuration); diff --git a/config/clients/java/template/example/example1/src/main/kotlin/dev/openfga/sdk/example/KotlinExample1.kt b/config/clients/java/template/example/example1/src/main/kotlin/dev/openfga/sdk/example/KotlinExample1.kt index 8dd22de6..ee287262 100644 --- a/config/clients/java/template/example/example1/src/main/kotlin/dev/openfga/sdk/example/KotlinExample1.kt +++ b/config/clients/java/template/example/example1/src/main/kotlin/dev/openfga/sdk/example/KotlinExample1.kt @@ -30,7 +30,7 @@ internal class KotlinExample1 { .apiUrl(System.getenv("FGA_API_URL")) // required, e.g. https://api.fga.example .storeId(System.getenv("FGA_STORE_ID")) // not needed when calling `CreateStore` or `ListStores` .authorizationModelId( - System.getenv("FGA_AUTHORIZATION_MODEL_ID") + System.getenv("FGA_MODEL_ID") ) // Optional, can be overridden per request .credentials(credentials) val fgaClient = OpenFgaClient(configuration) diff --git a/config/clients/js/template/README_initializing.mustache b/config/clients/js/template/README_initializing.mustache index 1d117d2f..4507178f 100644 --- a/config/clients/js/template/README_initializing.mustache +++ b/config/clients/js/template/README_initializing.mustache @@ -10,7 +10,7 @@ const { {{appShortName}}Client } = require('{{packageName}}'); // OR import { {{ const fgaClient = new {{appShortName}}Client({ apiUrl: process.env.FGA_API_URL, // required storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); ``` @@ -22,7 +22,7 @@ const { {{appShortName}}Client } = require('{{packageName}}'); // OR import { {{ const fgaClient = new {{appShortName}}Client({ apiUrl: process.env.FGA_API_URL, // required storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request credentials: { method: CredentialsMethod.ApiToken, config: { @@ -40,7 +40,7 @@ const { {{appShortName}}Client } = require('{{packageName}}'); // OR import { {{ const fgaClient = new {{appShortName}}Client({ apiUrl: process.env.FGA_API_URL, // required storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request credentials: { method: CredentialsMethod.ClientCredentials, config: { diff --git a/config/clients/js/template/README_retries.mustache b/config/clients/js/template/README_retries.mustache index 86a94d43..faeda00f 100644 --- a/config/clients/js/template/README_retries.mustache +++ b/config/clients/js/template/README_retries.mustache @@ -10,7 +10,7 @@ const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient const fgaClient = new OpenFgaClient({ apiUrl: process.env.FGA_API_URL, // required storeId: process.env.FGA_STORE_ID, // not needed when calling `CreateStore` or `ListStores` - authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // Optional, can be overridden per request + authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request retryParams: { maxRetry: 3, // retry up to 3 times on API requests minWaitInMs: 250 // wait a minimum of 250 milliseconds between requests diff --git a/config/clients/js/template/example/example1/example1.mjs b/config/clients/js/template/example/example1/example1.mjs index 808a7f84..52b48984 100644 --- a/config/clients/js/template/example/example1/example1.mjs +++ b/config/clients/js/template/example/example1/example1.mjs @@ -17,7 +17,7 @@ async function main () { const fgaClient = new OpenFgaClient({ apiUrl: process.env.FGA_API_URL || "http://localhost:8080", storeId: process.env.FGA_STORE_ID, // not needed when calling `createStore` or `listStores` - authorizationModelId: process.env.FGA_AUTHORIZATION_MODEL_ID, // optional, recommended for production, + authorizationModelId: process.env.FGA_MODEL_ID, // optional, recommended for production, credentials }); diff --git a/config/clients/python/template/README_calling_api.mustache b/config/clients/python/template/README_calling_api.mustache index 866feb0b..5b93a9bf 100644 --- a/config/clients/python/template/README_calling_api.mustache +++ b/config/clients/python/template/README_calling_api.mustache @@ -215,7 +215,7 @@ Reads the latest authorization model (note: this ignores the model id in configu # Create the cofiguration object # configuration = ClientConfiguration( # ... -# authorization_model_id = FGA_AUTHORIZATION_MODEL_ID, +# authorization_model_id = FGA_MODEL_ID, # ... # ) diff --git a/config/clients/python/template/README_initializing.mustache b/config/clients/python/template/README_initializing.mustache index 3a746a78..96b8fb62 100644 --- a/config/clients/python/template/README_initializing.mustache +++ b/config/clients/python/template/README_initializing.mustache @@ -12,7 +12,7 @@ async def main(): configuration = ClientConfiguration( api_url=FGA_API_URL, # required store_id=FGA_STORE_ID, # optional, not needed when calling `CreateStore` or `ListStores` - authorization_model_id=FGA_AUTHORIZATION_MODEL_ID, # Optional, can be overridden per request + authorization_model_id=FGA_MODEL_ID, # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: @@ -32,7 +32,7 @@ async def main(): configuration = ClientConfiguration( api_url=FGA_API_URL, # required store_id=FGA_STORE_ID, # optional, not needed when calling `CreateStore` or `ListStores` - authorization_model_id=FGA_AUTHORIZATION_MODEL_ID, # Optional, can be overridden per request + authorization_model_id=FGA_MODEL_ID, # Optional, can be overridden per request credentials=Credentials( method='api_token', configuration=CredentialConfiguration( @@ -58,7 +58,7 @@ async def main(): configuration = ClientConfiguration( api_url=FGA_API_URL, # required store_id=FGA_STORE_ID, # optional, not needed when calling `CreateStore` or `ListStores` - authorization_model_id=FGA_AUTHORIZATION_MODEL_ID, # Optional, can be overridden per request + authorization_model_id=FGA_MODEL_ID, # Optional, can be overridden per request credentials=Credentials( method='client_credentials', configuration=CredentialConfiguration( @@ -90,7 +90,7 @@ def main(): configuration = ClientConfiguration( api_url=FGA_API_URL, # required store_id=FGA_STORE_ID, # optional, not needed when calling `CreateStore` or `ListStores` - authorization_model_id=FGA_AUTHORIZATION_MODEL_ID, # optional, can be overridden per request + authorization_model_id=FGA_MODEL_ID, # optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient with OpenFgaClient(configuration) as fga_client: