implemented:
- altering of mail settings - sending email Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -13,6 +13,7 @@ dependencies {
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
implementation 'org.json:json:20240303'
|
||||
implementation 'org.bitbucket.b_c:jose4j:0.9.6'
|
||||
implementation 'com.sun.mail:jakarta.mail:2.0.1'
|
||||
implementation project(':de.srsoftware.utils')
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,8 @@ public class Constants {
|
||||
public static final String RESPONSE_TYPE = "response_type";
|
||||
public static final String SCOPE = "scope";
|
||||
public static final String SECRET = "secret";
|
||||
public static final String SENDER_ADDRESS = "sender_address";
|
||||
public static final String SMTP_USER = "smtp_user";
|
||||
public static final String SMTP_PASSWORD = "smtp_pass";
|
||||
public static final String SMTP_AUTH = "smtp_auth";
|
||||
public static final String SMTP_HOST = "smtp_host";
|
||||
public static final String SMTP_PORT = "smtp_port";
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.srsoftware.oidc.api;
|
||||
|
||||
import static de.srsoftware.oidc.api.Constants.*;
|
||||
|
||||
import jakarta.mail.Authenticator;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -35,15 +36,20 @@ public interface MailConfig {
|
||||
props.put("mail.smtp.port", smtpPort());
|
||||
props.put("mail.smtp.auth", smtpAuth() ? "true" : "false");
|
||||
props.put("mail.smtp.starttls.enable", startTls() ? "true" : "false");
|
||||
props.put("mail.smtp.ssl.trust", smtpHost());
|
||||
return props;
|
||||
}
|
||||
|
||||
default Map<String, Object> map() {
|
||||
return Map.of( //
|
||||
SMTP_HOST, smtpHost(), //
|
||||
SMTP_PORT, smtpPort(), //
|
||||
SMTP_AUTH, smtpAuth(), //
|
||||
SENDER_ADDRESS, senderAddress(), //
|
||||
return Map.of( //
|
||||
SMTP_HOST, smtpHost(), //
|
||||
SMTP_PORT, smtpPort(), //
|
||||
SMTP_AUTH, smtpAuth(), //
|
||||
SMTP_USER, senderAddress(), //
|
||||
START_TLS, startTls());
|
||||
}
|
||||
|
||||
Authenticator authenticator();
|
||||
|
||||
MailConfig save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user