Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Standardize configuration properties #173

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
<artifactId>quarkus-oidc</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
Expand Down Expand Up @@ -290,7 +295,6 @@
<inputs>
<param>${project.build.outputDirectory}/application.properties</param>
<param>${project.build.outputDirectory}/application-prod.properties</param>
<param>${project.build.outputDirectory}/application-dev.properties</param>
<param>${project.build.outputDirectory}/application-test.properties</param>
</inputs>
<deleteInputs>false</deleteInputs>
Expand All @@ -307,7 +311,6 @@
<inputs>
<param>${project.build.outputDirectory}/application.properties</param>
<param>${project.build.outputDirectory}/application-prod.properties</param>
<param>${project.build.outputDirectory}/application-dev.properties</param>
<param>${project.build.outputDirectory}/application-test.properties</param>
</inputs>
<deleteInputs>true</deleteInputs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class AuthorizedInterceptor {
@Inject
SecurityIdentity securityIdentity;

@ConfigProperty(name = "app.authn.enabled")
@ConfigProperty(name = "quarkus.oidc.tenant-enabled")
boolean authenticationEnabled;

@AroundInvoke
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class ApiDesignerConfig {
* Constructor.
* @param kcProperties
*/
public ApiDesignerConfig(@DesignerProperties(value = {"designer.ui.config.auth.keycloak"}) Properties kcProperties) {
public ApiDesignerConfig(@DesignerProperties(value = {"designer.ui.config.auth"}) Properties kcProperties) {
this.keycloakConfig = new HashMap<>();
kcProperties.stringPropertyNames().forEach(key -> keycloakConfig.put(key, kcProperties.get(key)));
}
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/resources/application-dev.properties

This file was deleted.

10 changes: 6 additions & 4 deletions app/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# === Prod profile - see README
# HTTP Port
%prod.quarkus.http.port=${HTTP_PORT:8080}
quarkus.http.port=8080

#LOGGING
%prod.quarkus.log.level=${LOG_LEVEL:INFO}
%prod.quarkus.log.console.enable=true
%prod.quarkus.log.category."io.apicurio".level=${REGISTRY_LOG_LEVEL:INFO}
apicurio.log.level=INFO
quarkus.log.level=INFO
quarkus.log.console.enable=true
quarkus.log.category."io.apicurio".level=${apicurio.log.level}

9 changes: 5 additions & 4 deletions app/src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#LOGGING
%test.quarkus.log.level=${LOG_LEVEL:WARN}
%test.quarkus.log.category."io.apicurio".level=${REGISTRY_LOG_LEVEL:INFO}
%test.quarkus.log.console.enable=true
%test.quarkus.http.test-port=0
apicurio.log.level=INFO
quarkus.log.level=WARN
quarkus.log.category."io.apicurio".level=${apicurio.log.level}
quarkus.log.console.enable=true
quarkus.http.test-port=0
56 changes: 26 additions & 30 deletions app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,43 @@

# System Info

app.name=Apicurio API Designer
app.description=The spiritual successor to Apicurio Studio - used as the basis for Red Hat OpenShift API Designer.
app.version=${project.version}
app.date=${timestamp}
app.git.commit-id=${git.commit.id.full}
apicurio.app.name=Apicurio API Designer
apicurio.app.description=The spiritual successor to Apicurio Studio - used as the basis for Red Hat OpenShift API Designer.
apicurio.app.version=${project.version}
apicurio.app.date=${timestamp}
apicurio.app.git.commit-id=${git.commit.id.full}

# Build

quarkus.package.type=fast-jar

# Logging

apicurio.log.level=DEBUG
quarkus.log.console.format=%d{YYYY-MM-dd HH:mm:ss} %p [%C] (%t) %m%n
quarkus.log.min-level=TRACE
quarkus.log.level=${DESIGNER_LOG_LEVEL:INFO}
quarkus.log.category."io.apicurio".level=${DESIGNER_LOG_LEVEL_APICURIO:${quarkus.log.level}}
quarkus.log.level=INFO
quarkus.log.category."io.apicurio".level=${apicurio.log.level}
quarkus.log.console.enable=true

# HTTP

quarkus.http.port=${DESIGNER_HTTP_PORT:8080}
quarkus.http.port=8080
%test.quarkus.http.test-port=0

# Database
apicurio.storage.init=true
apicurio.storage.db-kind=${DESIGNER_STORAGE_DB_KIND:h2}
apicurio.datasource.url=${DESIGNER_STORAGE_DATASOURCE_URL:jdbc:h2:mem:designer}
apicurio.datasource.username=${DESIGNER_STORAGE_DATASOURCE_USERNAME:sa}
apicurio.datasource.password=${DESIGNER_STORAGE_DATASOURCE_PASSWORD:sa}
apicurio.storage.db-kind=h2
apicurio.datasource.url=jdbc:h2:mem:designer
apicurio.datasource.username=sa
apicurio.datasource.password=sa
apicurio.datasource.jdbc.initial-size=20
apicurio.datasource.jdbc.min-size=20
apicurio.datasource.jdbc.max-size=100

# Access logs

quarkus.http.access-log.enabled=${DESIGNER_ACCESS_LOG_ENABLE:false}
quarkus.http.access-log.enabled=false
quarkus.http.access-log.pattern="apicurio-registry.access method="%{METHOD}" path="%{REQUEST_URL}" response_code="%{RESPONSE_CODE}" response_time="%{RESPONSE_TIME}" remote_ip="%{REMOTE_IP}" remote_user="%{REMOTE_USER}" user_agent="%{i,User-Agent}""
quarkus.http.access-log.exclude-pattern=/health/.*

Expand All @@ -50,27 +51,22 @@ designer.redirects.root=/,/apis/designer/v0/system/info
## Always enable CORS

quarkus.http.cors=true
quarkus.http.cors.origins=${DESIGNER_CORS_ALLOWED_ORIGINS:http://localhost:8888}
quarkus.http.cors.methods=${DESIGNER_CORS_ALLOWED_METHODS:GET,PUT,POST,PATCH,DELETE,OPTIONS}
quarkus.http.cors.headers=${DESIGNER_CORS_ALLOWED_HEADERS:x-designer-description,x-designer-name,x-designer-type,x-designer-origin,access-control-request-method,access-control-allow-credentials,access-control-allow-origin,access-control-allow-headers,authorization,content-type}
quarkus.http.cors.origins=http://localhost:8888
quarkus.http.cors.methods=GET,PUT,POST,PATCH,DELETE,OPTIONS
quarkus.http.cors.headers=x-designer-description,x-designer-name,x-designer-type,x-designer-origin,access-control-request-method,access-control-allow-credentials,access-control-allow-origin,access-control-allow-headers,authorization,content-type

## Authentication

app.authn.enabled=${AUTH_ENABLED:false}
app.authn.token.endpoint=${OIDC_TOKENT_ENDPOINT:https://auth.apicur.io/auth/realms/apicurio-local}
apicurio.authn.basic-client-credentials.enabled=false
apicurio.authn.basic-client-credentials.cache-expiration=5
apicurio.authn.basic-client-credentials.enabled.dynamic.allow=true

designer.config.auth.oidc.url=${OIDC_URL:https://auth.apicur.io/auth/realms/apicurio-local}

app.authn.basic-auth-client-credentials.enabled=${CLIENT_CREDENTIALS_BASIC_AUTH_ENABLED:false}
app.authn.basic-auth-client-credentials.cache-expiration=${CLIENT_CREDENTIALS_BASIC_CACHE_EXPIRATION:10}
app.authn.basic-auth-client-credentials.enabled.dynamic.allow=true

app.authn.audit.log.prefix=api-designer.audit
app.authn.client-id=${OIDC_API_CLIENT_ID:designer-api}
app.authn.client-secret=${OIDC_API_CLIENT_SECRET:designer-api-secret}
apicurio.authn.audit.log.prefix=api-designer.audit

quarkus.oidc.enabled=true
quarkus.oidc.auth-server-url=${designer.config.auth.oidc.url}
quarkus.oidc.tenant-enabled=${app.authn.enabled}
quarkus.oidc.client-id=${app.authn.client-id}
quarkus.oidc.auth-server-url=https://auth.apicur.io/auth/realms/apicurio-local
quarkus.oidc.token-path=https://auth.apicur.io/auth/realms/apicurio-local/protocol/openid-connect/token
quarkus.oidc.tenant-enabled=false
quarkus.oidc.client-id=designer-api
quarkus.oidc.client-secret=designer-api-secret
quarkus.oidc.application-type=service

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ public Map<String, String> start() {
Map<String, String> props = new HashMap<>();

//Set registry properties
props.put("app.authn.enabled", "true");
props.put("designer.config.auth.oidc.url", authServerUrl);
props.put("app.authn.token.endpoint", tokenEndpoint);
props.put("quarkus.oidc.tenant-enabled", "true");
props.put("quarkus.oidc.auth-server-url", authServerUrl);
props.put("quarkus.oidc.token-path", tokenEndpoint);


return props;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DesignsResourceAuthTest {
@Inject
DesignsResourceTestShared drts;

@ConfigProperty(name = "app.authn.token.endpoint")
@ConfigProperty(name = "quarkus.oidc.token-path")
String tokenEndpoint;

private List<Filter> original;
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@

<!-- Quarkus -->

<version.quarkus>3.6.6</version.quarkus>
<version.quarkus>3.8.2</version.quarkus>
<quarkus.profile>dev</quarkus.profile>

<!-- Dependency Versions -->

<lombok.version>1.18.30</lombok.version>
<apicurio-common-app-components.version>0.2.6.Final</apicurio-common-app-components.version>
<apicurio-common-app-components.version>1.1.0.CR2</apicurio-common-app-components.version>
<apicurio-common-rest-client.version>0.1.18.Final</apicurio-common-rest-client.version>
<annotation-api.version>1.3.5</annotation-api.version>
<version.puppycrawl>10.12.7</version.puppycrawl>
Expand Down
Loading