-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Elytron Security JDBC config classes to @ConfigMappin
- Loading branch information
1 parent
6236798
commit 9678bc5
Showing
10 changed files
with
88 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 6 additions & 13 deletions
19
...y-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/AttributeMappingConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
package io.quarkus.elytron.security.jdbc; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.smallrye.config.WithDefault; | ||
|
||
/** | ||
* Configuration information used to populate a {@linkplain org.wildfly.security.auth.realm.jdbc.mapper.AttributeMapper} | ||
*/ | ||
@ConfigGroup | ||
public class AttributeMappingConfig { | ||
public interface AttributeMappingConfig { | ||
|
||
/** | ||
* The index (1 based numbering) of column to map | ||
*/ | ||
@ConfigItem | ||
public int index; | ||
@WithDefault("0") | ||
int index(); | ||
|
||
/** | ||
* The target attribute name | ||
*/ | ||
@ConfigItem | ||
public String to; | ||
String to(); | ||
|
||
@Override | ||
public String toString() { | ||
return "AttributeMappingConfig{" + | ||
"index=" + index + | ||
", to='" + to + '\'' + | ||
'}'; | ||
} | ||
String toString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 10 additions & 14 deletions
24
...time/src/main/java/io/quarkus/elytron/security/jdbc/JdbcSecurityRealmBuildTimeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,29 @@ | ||
package io.quarkus.elytron.security.jdbc; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.smallrye.config.ConfigMapping; | ||
import io.smallrye.config.WithDefault; | ||
|
||
/** | ||
* A configuration object for a jdbc based realm configuration, | ||
* {@linkplain org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealm} | ||
*/ | ||
@ConfigRoot(name = "security.jdbc", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) | ||
public class JdbcSecurityRealmBuildTimeConfig { | ||
@ConfigMapping(prefix = "quarkus.security.jdbc") | ||
@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) | ||
public interface JdbcSecurityRealmBuildTimeConfig { | ||
|
||
/** | ||
* The realm name | ||
*/ | ||
@ConfigItem(defaultValue = "Quarkus") | ||
public String realmName; | ||
@WithDefault("Quarkus") | ||
String realmName(); | ||
|
||
/** | ||
* If the properties store is enabled. | ||
*/ | ||
@ConfigItem | ||
public boolean enabled; | ||
@WithDefault("false") | ||
boolean enabled(); | ||
|
||
@Override | ||
public String toString() { | ||
return "JdbcRealmConfig{" + | ||
", realmName='" + realmName + '\'' + | ||
", enabled=" + enabled + | ||
'}'; | ||
} | ||
String toString(); | ||
} |
19 changes: 8 additions & 11 deletions
19
...untime/src/main/java/io/quarkus/elytron/security/jdbc/JdbcSecurityRealmRuntimeConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
package io.quarkus.elytron.security.jdbc; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.smallrye.config.ConfigMapping; | ||
import io.smallrye.config.WithName; | ||
|
||
/** | ||
* A configuration object for a jdbc based realm configuration, | ||
* {@linkplain org.wildfly.security.auth.realm.jdbc.JdbcSecurityRealm} | ||
*/ | ||
@ConfigRoot(name = "security.jdbc", phase = ConfigPhase.RUN_TIME) | ||
public class JdbcSecurityRealmRuntimeConfig { | ||
@ConfigMapping(prefix = "quarkus.security.jdbc") | ||
@ConfigRoot(phase = ConfigPhase.RUN_TIME) | ||
public interface JdbcSecurityRealmRuntimeConfig { | ||
|
||
/** | ||
* The principal-queries config | ||
*/ | ||
@ConfigItem(name = "principal-query") | ||
public PrincipalQueriesConfig principalQueries; | ||
@WithName("principal-query") | ||
PrincipalQueriesConfig principalQueries(); | ||
// https://github.com/wildfly/wildfly-core/blob/main/elytron/src/test/resources/org/wildfly/extension/elytron/security-realms.xml#L18 | ||
|
||
@Override | ||
public String toString() { | ||
return "JdbcRealmConfig{" + | ||
"principalQueries=" + principalQueries + | ||
'}'; | ||
} | ||
String toString(); | ||
} |
11 changes: 0 additions & 11 deletions
11
...-jdbc/runtime/src/main/java/io/quarkus/elytron/security/jdbc/PasswordKeyMapperConfig.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.