Skip to content

Commit 0742585

Browse files
authored
Merge pull request #46068 from gsmet/config-mapping-mailer
Mailer - Switch to @ConfigMapping
2 parents 305e9e7 + 914a67b commit 0742585

File tree

13 files changed

+465
-259
lines changed

13 files changed

+465
-259
lines changed

extensions/mailer/deployment/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
<version>${project.version}</version>
6565
</path>
6666
</annotationProcessorPaths>
67-
<compilerArgs>
68-
<arg>-AlegacyConfigRoot=true</arg>
69-
</compilerArgs>
7067
</configuration>
7168
</execution>
7269
</executions>

extensions/mailer/deployment/src/main/java/io/quarkus/mailer/deployment/MailerProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static class CacheAttachmentsEnabled implements BooleanSupplier {
8181
MailersBuildTimeConfig config;
8282

8383
public boolean getAsBoolean() {
84-
return config.cacheAttachments;
84+
return config.cacheAttachments();
8585
}
8686
}
8787

extensions/mailer/runtime/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@
9595
<version>${project.version}</version>
9696
</path>
9797
</annotationProcessorPaths>
98-
<compilerArgs>
99-
<arg>-AlegacyConfigRoot=true</arg>
100-
</compilerArgs>
10198
</configuration>
10299
</execution>
103100
</executions>

extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/DkimSignOptionsConfig.java

+15-26
Original file line numberDiff line numberDiff line change
@@ -6,88 +6,77 @@
66
import java.util.OptionalLong;
77

88
import io.quarkus.runtime.annotations.ConfigGroup;
9-
import io.quarkus.runtime.annotations.ConfigItem;
9+
import io.smallrye.config.WithDefault;
1010

1111
@ConfigGroup
12-
public class DkimSignOptionsConfig {
12+
public interface DkimSignOptionsConfig {
1313

1414
/**
1515
* Enables DKIM signing.
1616
*/
17-
@ConfigItem(defaultValue = "false")
18-
public boolean enabled;
17+
@WithDefault("false")
18+
boolean enabled();
1919

2020
/**
2121
* Configures the PKCS#8 format private key used to sign the email.
2222
*/
23-
@ConfigItem
24-
public Optional<String> privateKey = Optional.empty();
23+
Optional<String> privateKey();
2524

2625
/**
2726
* Configures the PKCS#8 format private key file path.
2827
*/
29-
@ConfigItem
30-
public Optional<String> privateKeyPath = Optional.empty();
28+
Optional<String> privateKeyPath();
3129

3230
/**
3331
* Configures the Agent or User Identifier (AUID).
3432
*/
35-
@ConfigItem
36-
public Optional<String> auid = Optional.empty();
33+
Optional<String> auid();
3734

3835
/**
3936
* Configures the selector used to query the public key.
4037
*/
41-
@ConfigItem
42-
public Optional<String> selector = Optional.empty();
38+
Optional<String> selector();
4339

4440
/**
4541
* Configures the Signing Domain Identifier (SDID).
4642
*/
47-
@ConfigItem
48-
public Optional<String> sdid = Optional.empty();
43+
Optional<String> sdid();
4944

5045
/**
5146
* Configures the canonicalization algorithm for signed headers.
5247
*/
53-
@ConfigItem
54-
public Optional<CanonicalizationAlgorithmOption> headerCanonAlgo = Optional.empty();
48+
Optional<CanonicalizationAlgorithmOption> headerCanonAlgo();
5549

5650
/**
5751
* Configures the canonicalization algorithm for mail body.
5852
*/
59-
@ConfigItem
60-
public Optional<CanonicalizationAlgorithmOption> bodyCanonAlgo = Optional.empty();
53+
Optional<CanonicalizationAlgorithmOption> bodyCanonAlgo();
6154

6255
/**
6356
* Configures the body limit to sign.
6457
*
6558
* Must be greater than zero.
6659
*/
67-
@ConfigItem
68-
public OptionalInt bodyLimit = OptionalInt.empty();
60+
OptionalInt bodyLimit();
6961

7062
/**
7163
* Configures to enable or disable signature sign timestamp.
7264
*/
73-
@ConfigItem
74-
public Optional<Boolean> signatureTimestamp = Optional.empty();
65+
Optional<Boolean> signatureTimestamp();
7566

7667
/**
7768
* Configures the expire time in seconds when the signature sign will be expired.
7869
*
7970
* Must be greater than zero.
8071
*/
81-
@ConfigItem
82-
public OptionalLong expireTime = OptionalLong.empty();
72+
OptionalLong expireTime();
8373

8474
/**
8575
* Configures the signed headers in DKIM, separated by commas.
8676
*
8777
* The order in the list matters.
8878
*/
89-
@ConfigItem
90-
public Optional<List<String>> signedHeaders = Optional.empty();
79+
Optional<List<String>> signedHeaders();
9180

9281
public enum CanonicalizationAlgorithmOption {
9382
SIMPLE,

0 commit comments

Comments
 (0)