Skip to content

Commit 1048d1e

Browse files
committed
Align configuration properties
1 parent 8650f44 commit 1048d1e

30 files changed

+89
-85
lines changed

README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ The following parameters are available for executable files:
7979
- By default, the application expects an H2 server running at `jdbc:h2:tcp://localhost:9123/mem:registry`.
8080
- For configuring the database kind and the datasource values, the following configuration options are available:
8181

82-
| Option |Command argument| Env. variable |
83-
|---------------------------|---|--------------------------------|
84-
| Registry SQL storage kind |`-Dapicurio.storage.db-kind`| `REGISTRY_STORAGE_DB_KIND` |
85-
| Data Source URL |`-Dapicurio.datasource.url`| `REGISTRY_DATASOURCE_URL` |
86-
| DS Username |`-Dapicurio.datasource.username`| `REGISTRY_DATASOURCE_USERNAME` |
87-
| DS Password |`-Dapicurio.datasource.password`| `REGISTRY_DATASOURCE_PASSWORD` |
82+
| Option | Command argument | Env. variable |
83+
|---------------------------|---------------------------------|--------------------------------|
84+
| Registry SQL storage kind | `-Dapicurio.storage.sql.kind` | `APICURIO_STORAGE_SQL_KIND` |
85+
| Data Source URL | `-Dapicurio.datasource.url` | `APICURIO_DATASOURCE_URL` |
86+
| DS Username | `-Dapicurio.datasource.username` | `APICURIO_DATASOURCE_USERNAME` |
87+
| DS Password | `-Dapicurio.datasource.password` | `APICURIO_DATASOURCE_PASSWORD` |
8888

8989
To see additional options, visit:
9090
- [Data Source config](https://quarkus.io/guides/datasource)
@@ -107,13 +107,13 @@ scram-sha-512 credentials for user authorisation.
107107
```
108108
java \
109109
-Dapicurio.storage.kind=kafkasql \
110-
-Dregistry.kafka.common.bootstrap.servers=<kafka_bootstrap_server_address> \
111-
-Dregistry.kafka.common.ssl.truststore.location=<truststore_file_location>\
112-
-Dregistry.kafka.common.ssl.truststore.password=<truststore_file_password> \
113-
-Dregistry.kafka.common.ssl.truststore.type=PKCS12 \
114-
-Dregistry.kafka.common.security.protocol=SASL_SSL \
115-
-Dregistry.kafka.common.sasl.mechanism=SCRAM-SHA-512 \
116-
-Dregistry.kafka.common.sasl.jaas.config='org.apache.kafka.common.security.scram.ScramLoginModule required username="<username>" password="<password>";' \
110+
-Dapicurio.kafka.common.bootstrap.servers=<kafka_bootstrap_server_address> \
111+
-Dapicurio.kafka.common.ssl.truststore.location=<truststore_file_location>\
112+
-Dapicurio.kafka.common.ssl.truststore.password=<truststore_file_password> \
113+
-Dapicurio.kafka.common.ssl.truststore.type=PKCS12 \
114+
-Dapicurio.kafka.common.security.protocol=SASL_SSL \
115+
-Dapicurio.kafka.common.sasl.mechanism=SCRAM-SHA-512 \
116+
-Dapicurio.kafka.common.sasl.jaas.config='org.apache.kafka.common.security.scram.ScramLoginModule required username="<username>" password="<password>";' \
117117
-jar app/target/apicurio-registry-app-3.0.0-SNAPSHOT-runner.jar
118118
```
119119
This will start up the registry with the persistence managed by the external kafka cluster.
@@ -176,11 +176,11 @@ services:
176176
ports:
177177
- 8080:8080
178178
environment:
179-
REGISTRY_STORAGE_KIND: 'sql'
180-
REGISTRY_STORAGE_DB_KIND: 'postgresql'
181-
REGISTRY_DATASOURCE_URL: 'jdbc:postgresql://postgres/apicurio-registry'
182-
REGISTRY_DATASOURCE_USERNAME: apicurio-registry
183-
REGISTRY_DATASOURCE_PASSWORD: password
179+
APICURIO_STORAGE_KIND: 'sql'
180+
APICURIO_STORAGE_DB_KIND: 'postgresql'
181+
APICURIO_DATASOURCE_URL: 'jdbc:postgresql://postgres/apicurio-registry'
182+
APICURIO_DATASOURCE_USERNAME: apicurio-registry
183+
APICURIO_DATASOURCE_PASSWORD: password
184184
```
185185
- Run `docker-compose -f test.yml up`
186186

@@ -205,10 +205,10 @@ In order no enable this integration, you will need to set the following environm
205205

206206
|Option|Env. variable|
207207
|---|---|
208-
|`REGISTRY_AUTH_TYPE`|Set to `oidc` (default is `none`)|
209-
|`REGISTRY_AUTH_URL`|OIDC auth URL|
210-
|`REGISTRY_AUTH_REDIRECT_URL`|OIDC redirect URL|
211-
|`REGISTRY_AUTH_CLIENT_ID`|The client for the UI|
208+
|`APICURIO_AUTH_TYPE`|Set to `oidc` (default is `none`)|
209+
|`APICURIO_AUTH_URL`|OIDC auth URL|
210+
|`APICURIO_AUTH_REDIRECT_URL`|OIDC redirect URL|
211+
|`APICURIO_AUTH_CLIENT_ID`|The client for the UI|
212212

213213
Note that you will need to have everything configured in your OIDC provider, before starting the application
214214
(the realm and the two clients).

app/pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@
113113
<groupId>io.quarkus</groupId>
114114
<artifactId>quarkus-oidc</artifactId>
115115
</dependency>
116+
<dependency>
117+
<groupId>io.quarkus</groupId>
118+
<artifactId>quarkus-elytron-security-properties-file</artifactId>
119+
</dependency>
116120
<dependency>
117121
<groupId>io.quarkus</groupId>
118122
<artifactId>quarkus-smallrye-jwt</artifactId>

app/src/main/java/io/apicurio/registry/limits/RegistryLimitsConfigurationProducer.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class RegistryLimitsConfigurationProducer {
2020
Long defaultMaxTotalSchemas;
2121

2222
@Inject
23-
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-schema-size-bytes")
23+
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-schema-size.bytes")
2424
@Info(category = "limits", description = "Max schema size (bytes)", availableSince = "2.2.3.Final")
2525
Long defaultMaxSchemaSizeBytes;
2626

@@ -39,11 +39,11 @@ public class RegistryLimitsConfigurationProducer {
3939
@Info(category = "limits", description = "Max artifact properties", availableSince = "2.1.0.Final")
4040
Long defaultMaxArtifactProperties;
4141
@Inject
42-
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-property-key-size")
42+
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-property-key-size.bytes")
4343
@Info(category = "limits", description = "Max artifact property key size", availableSince = "2.1.0.Final")
4444
Long defaultMaxPropertyKeyBytesSize;
4545
@Inject
46-
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-property-value-size")
46+
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-property-value-size.bytes")
4747
@Info(category = "limits", description = "Max artifact property value size", availableSince = "2.1.0.Final")
4848
Long defaultMaxPropertyValueBytesSize;
4949

@@ -52,7 +52,7 @@ public class RegistryLimitsConfigurationProducer {
5252
@Info(category = "limits", description = "Max artifact labels", availableSince = "2.2.3.Final")
5353
Long defaultMaxArtifactLabels;
5454
@Inject
55-
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-label-size")
55+
@ConfigProperty(defaultValue = "-1", name = "apicurio.limits.config.max-label-size.bytes")
5656
@Info(category = "limits", description = "Max artifact label size", availableSince = "2.1.0.Final")
5757
Long defaultMaxLabelBytesSize;
5858

app/src/main/java/io/apicurio/registry/metrics/health/liveness/PersistenceExceptionLivenessCheck.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ public class PersistenceExceptionLivenessCheck extends AbstractErrorCounterHealt
3939
* to 60.
4040
* TODO report the absolute count as a metric?
4141
*/
42-
@ConfigProperty(name = "apicurio.metrics.PersistenceExceptionLivenessCheck.counterResetWindowDurationSec", defaultValue = "60")
42+
@ConfigProperty(name = "apicurio.metrics.PersistenceExceptionLivenessCheck.counterResetWindowDuration.seconds", defaultValue = "60")
4343
@Info(category = "health", description = "Counter reset window duration of persistence liveness check", availableSince = "1.0.2.Final")
4444
Integer configCounterResetWindowDurationSec;
4545

4646
/**
4747
* If set to a positive value, reset the liveness status after this time window passes without any further errors.
4848
*/
49-
@ConfigProperty(name = "apicurio.metrics.PersistenceExceptionLivenessCheck.statusResetWindowDurationSec", defaultValue = "300")
49+
@ConfigProperty(name = "apicurio.metrics.PersistenceExceptionLivenessCheck.statusResetWindowDuration.seconds", defaultValue = "300")
5050
@Info(category = "health", description = "Status reset window duration of persistence liveness check", availableSince = "1.0.2.Final")
5151
Integer configStatusResetWindowDurationSec;
5252

53-
@ConfigProperty(name = "apicurio.metrics.PersistenceExceptionLivenessCheck.disableLogging", defaultValue = "false")
53+
@ConfigProperty(name = "apicurio.metrics.PersistenceExceptionLivenessCheck.logging.disabled", defaultValue = "false")
5454
@Info(category = "health", description = "Disable logging of persistence liveness check", availableSince = "2.0.0.Final")
5555
Boolean disableLogging;
5656

app/src/main/java/io/apicurio/registry/metrics/health/liveness/ResponseErrorLivenessCheck.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ public class ResponseErrorLivenessCheck extends AbstractErrorCounterHealthCheck
3535
* to 60.
3636
* TODO report the absolute count as a metric?
3737
*/
38-
@ConfigProperty(name = "apicurio.metrics.ResponseErrorLivenessCheck.counterResetWindowDurationSec", defaultValue = "60")
38+
@ConfigProperty(name = "apicurio.metrics.ResponseErrorLivenessCheck.counterResetWindowDuration.seconds", defaultValue = "60")
3939
@Info(category = "health", description = "Counter reset window duration of response liveness check", availableSince = "1.0.2.Final")
4040
Integer configCounterResetWindowDurationSec;
4141

4242
/**
4343
* If set to a positive value, reset the liveness status after this time window passes without any further errors.
4444
*/
45-
@ConfigProperty(name = "apicurio.metrics.ResponseErrorLivenessCheck.statusResetWindowDurationSec", defaultValue = "300")
45+
@ConfigProperty(name = "apicurio.metrics.ResponseErrorLivenessCheck.statusResetWindowDuration.seconds", defaultValue = "300")
4646
@Info(category = "health", description = "Status reset window duration of response liveness check", availableSince = "1.0.2.Final")
4747
Integer configStatusResetWindowDurationSec;
4848

49-
@ConfigProperty(name = "apicurio.metrics.ResponseErrorLivenessCheck.disableLogging", defaultValue = "false")
49+
@ConfigProperty(name = "apicurio.metrics.ResponseErrorLivenessCheck.logging.disabled", defaultValue = "false")
5050
@Info(category = "health", description = "Disable logging of response liveness check", availableSince = "2.0.0.Final")
5151
Boolean disableLogging;
5252

app/src/main/java/io/apicurio/registry/metrics/health/readiness/PersistenceTimeoutReadinessCheck.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ public class PersistenceTimeoutReadinessCheck extends AbstractErrorCounterHealth
4040
* to 60.
4141
* TODO report the absolute count as a metric?
4242
*/
43-
@ConfigProperty(name = "apicurio.metrics.PersistenceTimeoutReadinessCheck.counterResetWindowDurationSec", defaultValue = "60")
43+
@ConfigProperty(name = "apicurio.metrics.PersistenceTimeoutReadinessCheck.counterResetWindowDuration.seconds", defaultValue = "60")
4444
@Info(category = "health", description = "Counter reset window duration of persistence readiness check", availableSince = "1.0.2.Final")
4545
Integer configCounterResetWindowDurationSec;
4646

4747
/**
4848
* If set to a positive value, reset the readiness status after this time window passes without any further errors.
4949
*/
50-
@ConfigProperty(name = "apicurio.metrics.PersistenceTimeoutReadinessCheck.statusResetWindowDurationSec", defaultValue = "300")
50+
@ConfigProperty(name = "apicurio.metrics.PersistenceTimeoutReadinessCheck.statusResetWindowDuration.seconds", defaultValue = "300")
5151
@Info(category = "health", description = "Status reset window duration of persistence readiness check", availableSince = "1.0.2.Final")
5252
Integer configStatusResetWindowDurationSec;
5353

app/src/main/java/io/apicurio/registry/metrics/health/readiness/ResponseTimeoutReadinessCheck.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ public class ResponseTimeoutReadinessCheck extends AbstractErrorCounterHealthChe
4848
* to 60.
4949
* TODO report the absolute count as a metric?
5050
*/
51-
@ConfigProperty(name = "apicurio.metrics.ResponseTimeoutReadinessCheck.counterResetWindowDurationSec", defaultValue = "60")
51+
@ConfigProperty(name = "apicurio.metrics.ResponseTimeoutReadinessCheck.counterResetWindowDuration.seconds", defaultValue = "60")
5252
@Info(category = "health", description = "Counter reset window duration of response readiness check", availableSince = "1.0.2.Final")
5353
Instance<Integer> configCounterResetWindowDurationSec;
5454

5555
/**
5656
* If set to a positive value, reset the readiness status after this time window passes without any further errors.
5757
*/
58-
@ConfigProperty(name = "apicurio.metrics.ResponseTimeoutReadinessCheck.statusResetWindowDurationSec", defaultValue = "300")
58+
@ConfigProperty(name = "apicurio.metrics.ResponseTimeoutReadinessCheck.statusResetWindowDuration.seconds", defaultValue = "300")
5959
@Info(category = "health", description = "Status reset window duration of response readiness check", availableSince = "1.0.2.Final")
6060
Instance<Integer> configStatusResetWindowDurationSec;
6161

app/src/main/java/io/apicurio/registry/rest/RestConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
@Singleton
1111
public class RestConfig {
1212

13-
@ConfigProperty(name = "apicurio.rest.artifact.download.maxSize", defaultValue = "1000000")
13+
@ConfigProperty(name = "apicurio.rest.artifact.download.maxSize.bytes", defaultValue = "1000000")
1414
@Info(category = "rest", description = "Max size of the artifact allowed to be downloaded from URL", availableSince = "2.2.6-SNAPSHOT")
1515
int downloadMaxSize;
1616

17-
@ConfigProperty(name = "apicurio.rest.artifact.download.skipSSLValidation", defaultValue = "false")
17+
@ConfigProperty(name = "apicurio.rest.artifact.download.sslValidation.disabled", defaultValue = "false")
1818
@Info(category = "rest", description = "Skip SSL validation when downloading artifacts from URL", availableSince = "2.2.6-SNAPSHOT")
1919
boolean downloadSkipSSLValidation;
2020

app/src/main/java/io/apicurio/registry/rest/v2/AdminResourceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class AdminResourceImpl implements AdminResource {
8686
HttpServletRequest request;
8787

8888
@Dynamic(label = "Download link expiry", description = "The number of seconds that a generated link to a .zip download file is active before expiring.")
89-
@ConfigProperty(name = "apicurio.download.href.ttl", defaultValue = "30")
89+
@ConfigProperty(name = "apicurio.download.href.ttl.seconds", defaultValue = "30")
9090
@Info(category = "download", description = "Download link expiry", availableSince = "2.1.2.Final")
9191
Supplier<Long> downloadHrefTtl;
9292

app/src/main/java/io/apicurio/registry/rest/v3/AdminResourceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public class AdminResourceImpl implements AdminResource {
105105
HttpServletRequest request;
106106

107107
@Dynamic(label = "Download link expiry", description = "The number of seconds that a generated link to a .zip download file is active before expiring.")
108-
@ConfigProperty(name = "apicurio.download.href.ttl", defaultValue = "30")
108+
@ConfigProperty(name = "apicurio.download.href.ttl.seconds", defaultValue = "30")
109109
@Info(category = "download", description = "Download link expiry", availableSince = "2.1.2.Final")
110110
Supplier<Long> downloadHrefTtl;
111111

app/src/main/java/io/apicurio/registry/storage/impl/sql/RegistryDatasourceProducer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class RegistryDatasourceProducer {
1919
@Inject
2020
Logger log;
2121

22-
@ConfigProperty(name = "apicurio.storage.db-kind", defaultValue = "h2")
22+
@ConfigProperty(name = "apicurio.storage.sql.kind", defaultValue = "h2")
2323
@Info(category = "storage", description = "Application datasource database type", availableSince = "3.0.0.Final")
2424
String databaseType;
2525

app/src/main/java/io/apicurio/registry/storage/impl/sql/SqlStatementsProducer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class SqlStatementsProducer {
1313
@Inject
1414
Logger log;
1515

16-
@ConfigProperty(name = "apicurio.storage.db-kind", defaultValue = "h2")
16+
@ConfigProperty(name = "apicurio.storage.sql.kind", defaultValue = "h2")
1717
@Info(category = "storage", description = "Datasource Db kind", availableSince = "2.0.0.Final")
1818
String databaseType;
1919

app/src/main/java/io/apicurio/registry/storage/metrics/StorageMetricsStore.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class StorageMetricsStore {
3737
Logger log;
3838

3939
@Inject
40-
@ConfigProperty(defaultValue = "30000", name = "apicurio.storage.metrics.cache.check-period")
40+
@ConfigProperty(defaultValue = "30000", name = "apicurio.storage.metrics.cache.check-period.ms")
4141
@Info(category = "health", description = "Storage metrics cache check period", availableSince = "2.1.0.Final")
4242
Long limitsCheckPeriod;
4343

app/src/main/java/io/apicurio/registry/ui/UserInterfaceConfigProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class UserInterfaceConfigProperties {
2929
public String authOidcClientId;
3030

3131

32-
@ConfigProperty(name = "apicurio.ui.features.readOnly", defaultValue = "false")
32+
@ConfigProperty(name = "apicurio.ui.features.read-only.enabled", defaultValue = "false")
3333
@Info(category = "ui", description = "Enabled to set the UI to read-only mode", availableSince = "3.0.0")
3434
public String featureReadOnly;
3535
@ConfigProperty(name = "apicurio.ui.features.breadcrumbs", defaultValue = "true")

app/src/main/java/io/apicurio/registry/ui/servlets/RedirectFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@ApplicationScoped
1919
public class RedirectFilter implements Filter {
2020

21-
@ConfigProperty(name = "apicurio.enable-redirects")
21+
@ConfigProperty(name = "apicurio.redirects.enabled")
2222
@Info(category = "redirects", description = "Enable redirects", availableSince = "2.1.2.Final")
2323
Boolean redirectsEnabled;
2424

app/src/main/resources/application-prod.properties

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Readiness and Liveness
22
apicurio.metrics.PersistenceExceptionLivenessCheck.errorThreshold=5
3-
apicurio.metrics.PersistenceExceptionLivenessCheck.counterResetWindowDurationSec=30
4-
apicurio.metrics.PersistenceExceptionLivenessCheck.statusResetWindowDurationSec=60
3+
apicurio.metrics.PersistenceExceptionLivenessCheck.counterResetWindowDuration.seconds=30
4+
apicurio.metrics.PersistenceExceptionLivenessCheck.statusResetWindowDuration.seconds=60
55
apicurio.metrics.ResponseErrorLivenessCheck.errorThreshold=5
6-
apicurio.metrics.ResponseErrorLivenessCheck.counterResetWindowDurationSec=30
7-
apicurio.metrics.ResponseErrorLivenessCheck.statusResetWindowDurationSec=60
6+
apicurio.metrics.ResponseErrorLivenessCheck.counterResetWindowDuration.seconds=30
7+
apicurio.metrics.ResponseErrorLivenessCheck.statusResetWindowDuration.seconds=60
88

99
apicurio.metrics.PersistenceTimeoutReadinessCheck.errorThreshold=5
10-
apicurio.metrics.PersistenceTimeoutReadinessCheck.counterResetWindowDurationSec=30
11-
apicurio.metrics.PersistenceTimeoutReadinessCheck.statusResetWindowDurationSec=60
10+
apicurio.metrics.PersistenceTimeoutReadinessCheck.counterResetWindowDuration.seconds=30
11+
apicurio.metrics.PersistenceTimeoutReadinessCheck.statusResetWindowDuration.seconds=60
1212
apicurio.metrics.PersistenceTimeoutReadinessCheck.timeoutSec=10
1313
apicurio.metrics.ResponseTimeoutReadinessCheck.errorThreshold=5
14-
apicurio.metrics.ResponseTimeoutReadinessCheck.counterResetWindowDurationSec=30
15-
apicurio.metrics.ResponseTimeoutReadinessCheck.statusResetWindowDurationSec=60
14+
apicurio.metrics.ResponseTimeoutReadinessCheck.counterResetWindowDuration.seconds=30
15+
apicurio.metrics.ResponseTimeoutReadinessCheck.statusResetWindowDuration.seconds=60
1616
apicurio.metrics.ResponseTimeoutReadinessCheck.timeoutSec=20
1717

1818
apicurio.liveness.errors.ignored=

app/src/main/resources/application-test.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ apicurio.events.kafka.config.bootstrap.servers=localhost:9092
1313
# Metrics
1414
apicurio.metrics.ResponseTimeoutReadinessCheck.errorThreshold=10000
1515
apicurio.metrics.ResponseErrorLivenessCheck.errorThreshold=10000
16-
apicurio.metrics.ResponseErrorLivenessCheck.disableLogging=true
16+
apicurio.metrics.ResponseErrorLivenessCheck.logging.disabled=true
1717
apicurio.metrics.PersistenceTimeoutReadinessCheck.errorThreshold=10000
1818
apicurio.metrics.PersistenceExceptionLivenessCheck.errorThreshold=10000
19-
apicurio.metrics.PersistenceExceptionLivenessCheck.disableLogging=true
19+
apicurio.metrics.PersistenceExceptionLivenessCheck.logging.disabled=true
2020

2121
#Log config
2222
apicurio.logconfigjob.every=1s

0 commit comments

Comments
 (0)