diff --git a/docs/docs/reference/configuration.md b/docs/docs/reference/configuration.md index 1244317c0..184366ab3 100644 --- a/docs/docs/reference/configuration.md +++ b/docs/docs/reference/configuration.md @@ -75,7 +75,6 @@ service: cache: number_of_counters: 10_000 max_cost: 10MiB - relationship: # The database section specifies the database engine and connection settings, # including the URI for the database, whether or not to auto-migrate the database, @@ -423,6 +422,59 @@ audits, decision logs, authorization model)
++ +#### Definition + +Configurations for the permify service and how it should behave. You can configure the circuit breaker pattern, configuration watcher, and service specific options for permission and schema services (rate limiting, concurrency limiting, cache size). + +#### Structure + +``` +├── service +| ├── circuit_breaker +| ├── watch: +| | ├── enabled +| ├── schema: +| | ├── cache: +| | | ├── number_of_counters +| | | ├── max_cost +| | permission: +| | | ├── bulk_limit +| | | ├── concurrency_limit +| | | ├── cache: +| | | | ├── number_of_counters +| | | | ├── max_cost +``` + +#### Glossary + +| Required | Argument | Default | Description | +|----------|-------------------------------------|---------|---------------------------------------------------| +| [ ] | circuit_breaker | false | switch option to use the circuit breaker pattern. | +| [ ] | watch | false | switch option for configuration watcher. | +| [ ] | schema.cache.number_of_counters | 1_000 | number of counters for schema service. | +| [ ] | schema.cache.max_cost | 10MiB | max cost for schema cache. | +| [ ] | permission.bulk_limit | 100 | bulk operations limit for permission service. | +| [ ] | permission.concurrency_limit | 100 | concurrency limit for permission service. | +| [ ] | permission.cache.max_cost | 10MiB | max cost for permission service. | + +#### ENV + +| Argument | ENV | Type | +|-----------------------------------------------|--------------------------------------------------------|----------| +| service-circuit-breaker | PERMIFY_SERVICE_CIRCUIT_BREAKER | boolean | +| service-watch-enabled | PERMIFY_SERVICE_WATCH_ENABLED | boolean | +| service-schema-cache-number-of-counters | PERMIFY_SERVICE_SCHEMA_CACHE_NUMBER_OF_COUNTERS | int | +| service-schema-cache-max-cost | PERMIFY_SERVICE_SCHEMA_CACHE_MAX_COST | int | +| service-permission-bulk-limit | PERMIFY_SERVICE_PERMISSION_BULK_LIMIT | int | +| service-permission-concurrency-limit | PERMIFY_SERVICE_PERMISSION_CONCURRENCY_LIMIT | int | +| service-permission-cache-max-cost | PERMIFY_SERVICE_PERMISSION_CACHE_MAX_COST | int | + +
+diff --git a/pkg/cmd/flags/serve.go b/pkg/cmd/flags/serve.go index 4e2c11fd8..070cab4fa 100644 --- a/pkg/cmd/flags/serve.go +++ b/pkg/cmd/flags/serve.go @@ -310,6 +310,14 @@ func RegisterServeFlags(cmd *cobra.Command) { panic(err) } + flags.Int("service-permission-bulk-limit", conf.Service.Permission.BulkLimit, "bulk operations limit") + if err = viper.BindPFlag("service.permission.bulk_limit", flags.Lookup("service-permission-bulk-limit")); err != nil { + panic(err) + } + if err = viper.BindEnv("service.permission.bulk_limit", "PERMIFY_SERVICE_PERMISSION_BULK_LIMIT"); err != nil { + panic(err) + } + flags.Int("service-permission-concurrency-limit", conf.Service.Permission.ConcurrencyLimit, "concurrency limit") if err = viper.BindPFlag("service.permission.concurrency_limit", flags.Lookup("service-permission-concurrency-limit")); err != nil { panic(err)