Class DevServicesConfig
- java.lang.Object
-
- io.quarkus.oidc.deployment.devservices.keycloak.DevServicesConfig
-
public class DevServicesConfig extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDevServicesConfig.Grant
-
Field Summary
Fields Modifier and Type Field Description Map<String,String>containerEnvEnvironment variables that are passed to the container.booleancreateRealmIndicates if the Keycloak realm has to be created when the realm file pointed to by the `realm-path` property does not exist.booleanenabledIf DevServices has been explicitly enabled or disabled.DevServicesConfig.GrantgrantDeprecated.UseDevUiConfig.grant.StringimageNameThe container image name to use, for container-based DevServices providers.Optional<String>javaOptsThe JAVA_OPTS passed to the keycloak JVMOptional<Boolean>keycloakXImageIf Keycloak-X image is used.OptionalIntportOptional fixed port the dev service will listen to.Optional<String>realmNameThe Keycloak realm name.Optional<List<String>>realmPathThe comma-separated list of class or file system paths to Keycloak realm files which will be used to initialize Keycloak.Map<String,List<String>>rolesThe Keycloak user roles.StringserviceNameThe value of thequarkus-dev-service-keycloaklabel attached to the started container.booleansharedIndicates if the Keycloak container managed by Quarkus Dev Services is shared.booleanshowLogsShow Keycloak log messages with a "Keycloak:" prefix.Optional<String>startCommandKeycloak start command.Map<String,String>usersThe Keycloak users map containing the username and password pairs.
-
Constructor Summary
Constructors Constructor Description DevServicesConfig()
-
-
-
Field Detail
-
enabled
@ConfigItem(defaultValue="true") public boolean enabled
If DevServices has been explicitly enabled or disabled.When DevServices is enabled Quarkus will attempt to automatically configure and start Keycloak when running in Dev or Test mode and when Docker is running.
-
imageName
@ConfigItem(defaultValue="quay.io/keycloak/keycloak:22.0.5") public String imageName
The container image name to use, for container-based DevServices providers. Image with a Quarkus based distribution is used by default. Image with a WildFly based distribution can be selected instead, for example: `quay.io/keycloak/keycloak:19.0.3-legacy`.Note Keycloak Quarkus and Keycloak WildFly images are initialized differently. By default, Dev Services for Keycloak will assume it is a Keycloak Quarkus image if the image version does not end with a '-legacy' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check.
-
keycloakXImage
@ConfigItem public Optional<Boolean> keycloakXImage
If Keycloak-X image is used. By default, Dev Services for Keycloak will assume a Keycloak-X image is used if the image name contains a 'keycloak-x' string. Set 'quarkus.keycloak.devservices.keycloak-x-image' to override this check which may be necessary if you build custom Keycloak-X or Keycloak images. You do not need to set this property if the default check works.
-
shared
@ConfigItem(defaultValue="true") public boolean shared
Indicates if the Keycloak container managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Keycloak starts a new container.The discovery uses the
quarkus-dev-service-labellabel. The value is configured using theservice-nameproperty.Container sharing is only used in dev mode.
-
serviceName
@ConfigItem(defaultValue="quarkus") public String serviceName
The value of thequarkus-dev-service-keycloaklabel attached to the started container. This property is used whensharedis set totrue. In this case, before starting a container, Dev Services for Keycloak looks for a container with thequarkus-dev-service-keycloaklabel set to the configured value. If found, it will use this container instead of starting a new one. Otherwise, it starts a new container with thequarkus-dev-service-keycloaklabel set to the specified value.Container sharing is only used in dev mode.
-
realmPath
@ConfigItem public Optional<List<String>> realmPath
The comma-separated list of class or file system paths to Keycloak realm files which will be used to initialize Keycloak. The first value in this list will be used to initialize default tenant connection properties.
-
showLogs
@ConfigItem(defaultValue="false") public boolean showLogs
Show Keycloak log messages with a "Keycloak:" prefix.
-
startCommand
@ConfigItem public Optional<String> startCommand
Keycloak start command. Use this property to experiment with Keycloak start options, see {@link https://www.keycloak.org/server/all-config}. Note it will be ignored when loading legacy Keycloak WildFly images.
-
realmName
@ConfigItem public Optional<String> realmName
The Keycloak realm name. This property will be used to create the realm if the realm file pointed to by the `realm-path` property does not exist, default value is `quarkus` in this case. If the realm file pointed to by the `realm-path` property exists then it is still recommended to set this property for Dev Services for Keycloak to avoid parsing the realm file to determine the realm name.
-
createRealm
@ConfigItem(defaultValue="true") public boolean createRealm
Indicates if the Keycloak realm has to be created when the realm file pointed to by the `realm-path` property does not exist. Disable it if you'd like to create a realm using Keycloak Administration Console or Keycloak Admin API from io.quarkus.test.common.QuarkusTestResourceLifecycleManager.
-
users
@ConfigItem public Map<String,String> users
The Keycloak users map containing the username and password pairs. If this map is empty then two users, 'alice' and 'bob' with the passwords matching their names will be created. This property will be used to create the Keycloak users if the realm file pointed to by the `realm-path` property does not exist.
-
roles
@ConfigItem public Map<String,List<String>> roles
The Keycloak user roles. If this map is empty then a user named 'alice' will get 'admin' and 'user' roles and all other users will get a 'user' role. This property will be used to create the Keycloak roles if the realm file pointed to by the `realm-path` property does not exist.
-
grant
@Deprecated public DevServicesConfig.Grant grant
Deprecated.UseDevUiConfig.grant.Grant type.
-
port
@ConfigItem public OptionalInt port
Optional fixed port the dev service will listen to.If not defined, the port will be chosen randomly.
-
-