Skip to content

Commit

Permalink
chore: rename FGA_AUTHORIZATION_MODEL_ID to FGA_MODEL_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Apr 9, 2024
1 parent 769ea8a commit e69524c
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion config/clients/dotnet/CHANGELOG.md.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
Expand Down
6 changes: 3 additions & 3 deletions config/clients/dotnet/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion config/clients/dotnet/template/README_retries.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion config/clients/go/CHANGELOG.md.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions config/clients/go/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion config/clients/go/template/README_retries.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/clients/go/template/example/example1/example1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})

Expand Down
8 changes: 4 additions & 4 deletions config/clients/java/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
));
Expand All @@ -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"))
Expand Down Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion config/clients/java/template/README_retries.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions config/clients/js/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
```

Expand All @@ -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: {
Expand All @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion config/clients/js/template/README_retries.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/clients/js/template/example/example1/example1.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down
2 changes: 1 addition & 1 deletion config/clients/python/template/README_calling_api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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,
# ...
# )

Expand Down
8 changes: 4 additions & 4 deletions config/clients/python/template/README_initializing.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e69524c

Please sign in to comment.