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

Commit

Permalink
Updated config properties to be prefixed by "apicurio." instead of "d…
Browse files Browse the repository at this point in the history
…esigner."
  • Loading branch information
EricWittmann committed Mar 19, 2024
1 parent d222d66 commit 3aced49
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
import java.util.Map;
import java.util.Properties;

import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import jakarta.annotation.PostConstruct;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.slf4j.Logger;

import io.apicurio.common.apps.config.Info;
import io.apicurio.designer.common.config.DesignerProperties;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;

/**
* @author [email protected]
Expand All @@ -38,43 +39,43 @@ public class ApiDesignerConfig {
Logger log;

@Inject
@ConfigProperty(name = "designer.ui.config.uiContextPath", defaultValue = "/ui/")
//@Info(category = "ui", description = "UI context path", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.uiContextPath", defaultValue = "/ui/")
@Info(category = "ui", description = "UI context path", availableSince = "1.0.0.Final")
public String uiContextPath;

@Inject
@ConfigProperty(name = "designer.ui.config.apiUrl", defaultValue = "_")
//@Info(category = "ui", description = "UI APIs URL", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.apiUrl", defaultValue = "_")
@Info(category = "ui", description = "UI APIs URL", availableSince = "1.0.0.Final")
public String apiUrl;

@Inject
@ConfigProperty(name = "designer.ui.config.editorsUrl", defaultValue = "/editors/")
//@Info(category = "ui", description = "UI APIs URL", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.editorsUrl", defaultValue = "/editors/")
@Info(category = "ui", description = "UI APIs URL", availableSince = "1.0.0.Final")
public String editorsUrl;

@Inject
@ConfigProperty(name = "quarkus.oidc.tenant-enabled", defaultValue = "false")
//@Info(category = "ui", description = "UI OIDC tenant enabled", availableSince = "1.0.0.Final")
@Info(category = "ui", description = "UI OIDC tenant enabled", availableSince = "1.0.0.Final")
public boolean authenticationEnabled;

@Inject
@ConfigProperty(name = "designer.ui.config.auth.type", defaultValue = "none")
//@Info(category = "ui", description = "UI auth type", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.auth.type", defaultValue = "none")
@Info(category = "ui", description = "UI auth type", availableSince = "1.0.0.Final")
public String uiAuthType;

@Inject
@ConfigProperty(name = "designer.ui.config.auth.oidc.url", defaultValue = "none")
//@Info(category = "ui", description = "UI auth OIDC URL", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.auth.oidc.url", defaultValue = "none")
@Info(category = "ui", description = "UI auth OIDC URL", availableSince = "1.0.0.Final")
public String oidcUrl;

@Inject
@ConfigProperty(name = "designer.ui.config.auth.oidc.client-id", defaultValue = "none")
//@Info(category = "ui", description = "UI auth OIDC client ID", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.auth.oidc.client-id", defaultValue = "none")
@Info(category = "ui", description = "UI auth OIDC client ID", availableSince = "1.0.0.Final")
public String oidcClientId;

@Inject
@ConfigProperty(name = "designer.ui.config.auth.oidc.redirect-url", defaultValue = "none")
//@Info(category = "ui", description = "UI auth OIDC redirect URL", availableSince = "1.0.0.Final")
@ConfigProperty(name = "apicurio.ui.config.auth.oidc.redirect-url", defaultValue = "none")
@Info(category = "ui", description = "UI auth OIDC redirect URL", availableSince = "1.0.0.Final")
public String oidcRedirectUri;

public final Map<String, Object> keycloakConfig;
Expand All @@ -83,7 +84,7 @@ public class ApiDesignerConfig {
* Constructor.
* @param kcProperties
*/
public ApiDesignerConfig(@DesignerProperties(value = {"designer.ui.config.auth"}) Properties kcProperties) {
public ApiDesignerConfig(@DesignerProperties(value = {"apicurio.ui.config.auth"}) Properties kcProperties) {
this.keycloakConfig = new HashMap<>();
kcProperties.stringPropertyNames().forEach(key -> keycloakConfig.put(key, kcProperties.get(key)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SqlStatementsProducer {
Logger log;

@ConfigProperty(name = "apicurio.storage.db-kind", defaultValue = "h2")
@Info(category = "storage", description = "Datasource Db kind", availableSince = "0.1.0.Final")
@Info(category = "storage", description = "Datasource Db kind", availableSince = "1.0.0.Final")
String databaseType;

/**
Expand Down
15 changes: 8 additions & 7 deletions app/src/main/java/io/apicurio/designer/ui/RedirectFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import java.util.HashMap;
import java.util.Map;

import org.eclipse.microprofile.config.inject.ConfigProperty;

import io.apicurio.common.apps.config.Info;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
Expand All @@ -30,21 +34,18 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import jakarta.annotation.PostConstruct;
import org.eclipse.microprofile.config.inject.ConfigProperty;

/**
* @author [email protected]
*/
@ApplicationScoped
public class RedirectFilter implements Filter {

@ConfigProperty(name = "designer.enable-redirects", defaultValue = "true")
// @Info(category = "redirects", description = "Enable redirects", availableSince = "2.1.2.Final")
@ConfigProperty(name = "apicurio.enable-redirects", defaultValue = "true")
@Info(category = "redirects", description = "Enable redirects", availableSince = "1.0.0.Final")
Boolean redirectsEnabled;

@ConfigProperty(name = "designer.redirects")
// @Info(category = "redirects", description = "Registry redirects", availableSince = "2.1.2.Final")
@ConfigProperty(name = "apicurio.redirects")
@Info(category = "redirects", description = "Designer redirects", availableSince = "1.0.0.Final")
Map<String, String> redirectsConfig;
Map<String, String> redirects = new HashMap<>();

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ quarkus.http.access-log.exclude-pattern=/health/.*

# Redirects

designer.enable-redirects=false
designer.redirects.root=/,/apis/designer/v0/system/info
apicurio.enable-redirects=false
apicurio.redirects.root=/,/apis/designer/v0/system/info

## Always enable CORS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
public class PropertiesUtil {
private static final Logger log = LoggerFactory.getLogger(PropertiesUtil.class);
// explicit debug, since properties can have unresolved env vars
private static final boolean debug = Boolean.getBoolean("designer.debug");
private static final boolean debug = Boolean.getBoolean("apicurio.debug");

/**
* Filter/strip prefixes from configuration properties.
Expand Down
34 changes: 19 additions & 15 deletions ui/ui-app/src/app/pages/components/home/DesignsEmptyState.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FunctionComponent } from "react";
import {
Button,
Button, Card, CardBody,
EmptyState,
EmptyStateActions,
EmptyStateBody,
Expand All @@ -25,19 +25,23 @@ export type DesignsEmptyStateProps = {
*/
export const DesignsEmptyState: FunctionComponent<DesignsEmptyStateProps> = ({ onCreate, onImport }: DesignsEmptyStateProps) => {
return (
<EmptyState>
<EmptyStateHeader titleText="No designs" headingLevel="h4" icon={<EmptyStateIcon icon={AddCircleOIcon} />} />
<EmptyStateBody>
To get started, create or import a design.
</EmptyStateBody>
<EmptyStateFooter>
<EmptyStateActions>
<Button data-testid="btn-create-design" variant="primary" onClick={onCreate}>Create design</Button>
</EmptyStateActions>
<EmptyStateActions>
<ImportDropdown onImport={onImport} />
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
<Card>
<CardBody>
<EmptyState>
<EmptyStateHeader titleText="No designs" headingLevel="h4" icon={<EmptyStateIcon icon={AddCircleOIcon} />} />
<EmptyStateBody>
To get started, create or import a design.
</EmptyStateBody>
<EmptyStateFooter>
<EmptyStateActions>
<Button data-testid="btn-create-design" variant="primary" onClick={onCreate}>Create design</Button>
</EmptyStateActions>
<EmptyStateActions>
<ImportDropdown onImport={onImport} />
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</CardBody>
</Card>
);
};
3 changes: 1 addition & 2 deletions ui/ui-editors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To run the app locally, do the following:

```bash
$ npm install
$ npm run start
$ npm run dev
```

Then open your browser (if it doesn't automatically open) to http://localhost:9011/?demo
Expand All @@ -16,7 +16,6 @@ To run a production build using docker:

```bash
$ npm install
$ npm run prebuild
$ npm run build
$ docker build -t="apicurio/apicurio-studio-editors" --rm .
$ docker run --rm -it -p 8080:8080 apicurio/apicurio-studio-editors
Expand Down

0 comments on commit 3aced49

Please sign in to comment.