diff --git a/service/config/sample.yml b/service/config/sample.yml index 3162ca2c4..08e44939b 100644 --- a/service/config/sample.yml +++ b/service/config/sample.yml @@ -529,3 +529,6 @@ externalRequestFilter: - /example permittedInternalRanges: - 127.0.0.0/8 + +idlePrimaryDeviceReminder: + minIdleDuration: P30D diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java index 9d623ab59..f79e2ce46 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java @@ -37,6 +37,7 @@ import org.whispersystems.textsecuregcm.configuration.FcmConfiguration; import org.whispersystems.textsecuregcm.configuration.GcpAttachmentsConfiguration; import org.whispersystems.textsecuregcm.configuration.GenericZkConfig; import org.whispersystems.textsecuregcm.configuration.GooglePlayBillingConfiguration; +import org.whispersystems.textsecuregcm.configuration.IdlePrimaryDeviceReminderConfiguration; import org.whispersystems.textsecuregcm.configuration.KeyTransparencyServiceConfiguration; import org.whispersystems.textsecuregcm.configuration.LinkDeviceSecretConfiguration; import org.whispersystems.textsecuregcm.configuration.MaxDeviceConfiguration; @@ -339,6 +340,10 @@ public class WhisperServerConfiguration extends Configuration { @JsonProperty private boolean logMessageDeliveryLoops; + @JsonProperty + private IdlePrimaryDeviceReminderConfiguration idlePrimaryDeviceReminder = + new IdlePrimaryDeviceReminderConfiguration(Duration.ofDays(30)); + public TlsKeyStoreConfiguration getTlsKeyStoreConfiguration() { return tlsKeyStore; } @@ -566,4 +571,7 @@ public class WhisperServerConfiguration extends Configuration { return logMessageDeliveryLoops; } + public IdlePrimaryDeviceReminderConfiguration idlePrimaryDeviceReminderConfiguration() { + return idlePrimaryDeviceReminder; + } } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index 70f2e1f24..41f099123 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -82,6 +82,7 @@ import org.whispersystems.textsecuregcm.auth.CertificateGenerator; import org.whispersystems.textsecuregcm.auth.CloudflareTurnCredentialsManager; import org.whispersystems.textsecuregcm.auth.DisconnectionRequestManager; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; +import org.whispersystems.textsecuregcm.auth.IdlePrimaryDeviceAuthenticatedWebSocketUpgradeFilter; import org.whispersystems.textsecuregcm.auth.PhoneVerificationTokenManager; import org.whispersystems.textsecuregcm.auth.RegistrationLockVerificationManager; import org.whispersystems.textsecuregcm.auth.TurnTokenGenerator; @@ -980,6 +981,8 @@ public class WhisperServerService extends Application