diff --git a/api-doc/pom.xml b/api-doc/pom.xml index c112c1e08..8a8d9086a 100644 --- a/api-doc/pom.xml +++ b/api-doc/pom.xml @@ -22,7 +22,7 @@ io.swagger.core.v3 - swagger-maven-plugin + swagger-maven-plugin-jakarta ${swagger.version} signal-server-openapi diff --git a/api-doc/src/main/java/org/signal/openapi/OpenApiExtension.java b/api-doc/src/main/java/org/signal/openapi/OpenApiExtension.java index b6d97cfcc..c30a03076 100644 --- a/api-doc/src/main/java/org/signal/openapi/OpenApiExtension.java +++ b/api-doc/src/main/java/org/signal/openapi/OpenApiExtension.java @@ -13,6 +13,7 @@ import io.swagger.v3.jaxrs2.ResolvedParameter; import io.swagger.v3.jaxrs2.ext.AbstractOpenAPIExtension; import io.swagger.v3.jaxrs2.ext.OpenAPIExtension; import io.swagger.v3.oas.models.Components; +import jakarta.ws.rs.Consumes; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Iterator; @@ -20,7 +21,6 @@ import java.util.List; import java.util.Optional; import java.util.ServiceLoader; import java.util.Set; -import javax.ws.rs.Consumes; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; /** diff --git a/api-doc/src/main/java/org/signal/openapi/OpenApiReader.java b/api-doc/src/main/java/org/signal/openapi/OpenApiReader.java index 63f199c94..a1b0dffc4 100644 --- a/api-doc/src/main/java/org/signal/openapi/OpenApiReader.java +++ b/api-doc/src/main/java/org/signal/openapi/OpenApiReader.java @@ -15,11 +15,11 @@ import io.swagger.v3.jaxrs2.Reader; import io.swagger.v3.jaxrs2.ResolvedParameter; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.security.SecurityRequirement; +import jakarta.ws.rs.Consumes; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collections; import java.util.List; -import javax.ws.rs.Consumes; /** * One of the extension mechanisms of Swagger Core library (OpenAPI processor) is via custom implementations diff --git a/integration-tests/src/main/java/org/signal/integration/Operations.java b/integration-tests/src/main/java/org/signal/integration/Operations.java index 40a4ea0dc..4711fb782 100644 --- a/integration-tests/src/main/java/org/signal/integration/Operations.java +++ b/integration-tests/src/main/java/org/signal/integration/Operations.java @@ -10,6 +10,9 @@ import static java.util.Objects.requireNonNull; import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.io.Resources; import com.google.common.net.HttpHeaders; +import io.dropwizard.configuration.ConfigurationValidationException; +import io.dropwizard.jersey.validation.Validators; +import jakarta.validation.ConstraintViolation; import java.io.IOException; import java.lang.invoke.MethodHandles; import java.net.URI; @@ -26,8 +29,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; import java.util.concurrent.Executors; -import io.dropwizard.configuration.ConfigurationValidationException; -import io.dropwizard.jersey.validation.Validators; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.tuple.Pair; @@ -52,7 +53,6 @@ import org.whispersystems.textsecuregcm.storage.Device; import org.whispersystems.textsecuregcm.util.HeaderUtils; import org.whispersystems.textsecuregcm.util.HttpUtils; import org.whispersystems.textsecuregcm.util.SystemMapper; -import javax.validation.ConstraintViolation; public final class Operations { diff --git a/integration-tests/src/main/java/org/signal/integration/config/Config.java b/integration-tests/src/main/java/org/signal/integration/config/Config.java index 5343625d8..f9aa3cbe6 100644 --- a/integration-tests/src/main/java/org/signal/integration/config/Config.java +++ b/integration-tests/src/main/java/org/signal/integration/config/Config.java @@ -5,9 +5,9 @@ package org.signal.integration.config; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.DynamoDbClientFactory; public record Config(@NotBlank String domain, diff --git a/integration-tests/src/main/java/org/signal/integration/config/DynamoDbTables.java b/integration-tests/src/main/java/org/signal/integration/config/DynamoDbTables.java index 03e4a8183..2e76e3c70 100644 --- a/integration-tests/src/main/java/org/signal/integration/config/DynamoDbTables.java +++ b/integration-tests/src/main/java/org/signal/integration/config/DynamoDbTables.java @@ -5,7 +5,7 @@ package org.signal.integration.config; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; public record DynamoDbTables(@NotBlank String registrationRecovery, @NotBlank String verificationSessions) { diff --git a/pom.xml b/pom.xml index c3b88a808..31950bc3f 100644 --- a/pom.xml +++ b/pom.xml @@ -41,9 +41,10 @@ 3.37.0 1.12.0 2.17.0 - 3.0.10 + 4.0.10 1.1.13 - 1.23.0 + + 2.2.1 26.50.0 1.61.1 2.11.0 @@ -318,9 +319,8 @@ org.wiremock - - wiremock-standalone - 3.3.1 + wiremock + 3.9.1 test diff --git a/service/pom.xml b/service/pom.xml index bf9580173..60fd98ad9 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -38,7 +38,7 @@ io.swagger.core.v3 - swagger-jaxrs2 + swagger-jaxrs2-jakarta ${swagger.version} diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java index 08643cbfb..2ff9ca3cd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerConfiguration.java @@ -6,13 +6,13 @@ package org.whispersystems.textsecuregcm; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.core.Configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.attachments.TusConfiguration; import org.whispersystems.textsecuregcm.configuration.ApnConfiguration; import org.whispersystems.textsecuregcm.configuration.AppleAppStoreConfiguration; @@ -30,8 +30,8 @@ import org.whispersystems.textsecuregcm.configuration.DogstatsdConfiguration; import org.whispersystems.textsecuregcm.configuration.DynamoDbClientFactory; import org.whispersystems.textsecuregcm.configuration.DynamoDbTables; import org.whispersystems.textsecuregcm.configuration.ExternalRequestFilterConfiguration; -import org.whispersystems.textsecuregcm.configuration.FaultTolerantRedisClusterFactory; import org.whispersystems.textsecuregcm.configuration.FaultTolerantRedisClientFactory; +import org.whispersystems.textsecuregcm.configuration.FaultTolerantRedisClusterFactory; import org.whispersystems.textsecuregcm.configuration.FcmConfiguration; import org.whispersystems.textsecuregcm.configuration.GcpAttachmentsConfiguration; import org.whispersystems.textsecuregcm.configuration.GenericZkConfig; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java index 7eb2b58b4..f9a2f7cda 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/WhisperServerService.java @@ -33,6 +33,9 @@ import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.resolver.ResolvedAddressTypes; import io.netty.resolver.dns.DnsNameResolver; import io.netty.resolver.dns.DnsNameResolverBuilder; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.Filter; +import jakarta.servlet.ServletRegistration; import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.net.http.HttpClient; @@ -59,11 +62,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.function.Function; import java.util.stream.Stream; import javax.annotation.Nullable; -import javax.servlet.DispatcherType; -import javax.servlet.Filter; -import javax.servlet.FilterRegistration; -import javax.servlet.ServletRegistration; -import org.eclipse.jetty.servlets.CrossOriginFilter; import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; import org.glassfish.jersey.server.ServerProperties; import org.signal.i18n.HeaderControlledResourceBundleLookup; @@ -194,13 +192,13 @@ import org.whispersystems.textsecuregcm.push.APNSender; import org.whispersystems.textsecuregcm.push.FcmSender; import org.whispersystems.textsecuregcm.push.MessageSender; import org.whispersystems.textsecuregcm.push.ProvisioningManager; -import org.whispersystems.textsecuregcm.push.WebSocketConnectionEventManager; import org.whispersystems.textsecuregcm.push.PushNotificationManager; import org.whispersystems.textsecuregcm.push.PushNotificationScheduler; import org.whispersystems.textsecuregcm.push.ReceiptSender; +import org.whispersystems.textsecuregcm.push.WebSocketConnectionEventManager; import org.whispersystems.textsecuregcm.redis.ConnectionEventLogger; -import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisClusterClient; import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisClient; +import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisClusterClient; import org.whispersystems.textsecuregcm.registration.RegistrationServiceClient; import org.whispersystems.textsecuregcm.s3.PolicySigner; import org.whispersystems.textsecuregcm.s3.PostPolicyGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/attachments/TusConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/attachments/TusConfiguration.java index 5991c8ab3..c6f6889db 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/attachments/TusConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/attachments/TusConfiguration.java @@ -5,9 +5,9 @@ package org.whispersystems.textsecuregcm.attachments; +import jakarta.validation.constraints.NotEmpty; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; import org.whispersystems.textsecuregcm.util.ExactlySize; -import javax.validation.constraints.NotEmpty; public record TusConfiguration( @ExactlySize(32) SecretBytes userAuthenticationTokenSharedSecret, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/Anonymous.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/Anonymous.java index fa8a8190e..37e795a4e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/Anonymous.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/Anonymous.java @@ -5,9 +5,9 @@ package org.whispersystems.textsecuregcm.auth; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response; import java.util.Base64; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; public class Anonymous { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/CloudflareTurnCredentialsManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/CloudflareTurnCredentialsManager.java index b71eed4cf..dbe4f548e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/CloudflareTurnCredentialsManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/CloudflareTurnCredentialsManager.java @@ -7,6 +7,7 @@ package org.whispersystems.textsecuregcm.auth; import com.fasterxml.jackson.core.JsonProcessingException; import io.netty.resolver.dns.DnsNameResolver; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.net.Inet6Address; import java.net.URI; @@ -16,7 +17,6 @@ import java.util.List; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; -import javax.ws.rs.core.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.configuration.CircuitBreakerConfiguration; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/CombinedUnidentifiedSenderAccessKeys.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/CombinedUnidentifiedSenderAccessKeys.java index 869be2d55..71271830e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/CombinedUnidentifiedSenderAccessKeys.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/CombinedUnidentifiedSenderAccessKeys.java @@ -5,10 +5,10 @@ package org.whispersystems.textsecuregcm.auth; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.util.Base64; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; public class CombinedUnidentifiedSenderAccessKeys { private final byte[] combinedUnidentifiedSenderAccessKeys; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/ContainerRequestUtil.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/ContainerRequestUtil.java index 4e8cd7ecf..af1d15bbb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/ContainerRequestUtil.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/ContainerRequestUtil.java @@ -5,15 +5,14 @@ package org.whispersystems.textsecuregcm.auth; -import org.glassfish.jersey.server.ContainerRequest; -import org.whispersystems.textsecuregcm.storage.Account; -import org.whispersystems.textsecuregcm.storage.Device; -import javax.ws.rs.core.SecurityContext; -import java.util.Map; +import jakarta.ws.rs.core.SecurityContext; import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; +import org.glassfish.jersey.server.ContainerRequest; +import org.whispersystems.textsecuregcm.storage.Account; +import org.whispersystems.textsecuregcm.storage.Device; class ContainerRequestUtil { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/GroupSendTokenHeader.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/GroupSendTokenHeader.java index 643000daf..a0ed59b0d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/GroupSendTokenHeader.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/GroupSendTokenHeader.java @@ -5,10 +5,9 @@ package org.whispersystems.textsecuregcm.auth; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response.Status; import java.util.Base64; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response.Status; - import org.signal.libsignal.zkgroup.InvalidInputException; import org.signal.libsignal.zkgroup.groupsend.GroupSendFullToken; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/InvalidAuthorizationHeaderException.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/InvalidAuthorizationHeaderException.java index d5b85daa9..40d136fa2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/InvalidAuthorizationHeaderException.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/InvalidAuthorizationHeaderException.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.auth; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response.Status; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response.Status; public class InvalidAuthorizationHeaderException extends WebApplicationException { public InvalidAuthorizationHeaderException(String s) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/OptionalAccess.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/OptionalAccess.java index 366bffe2b..d480be828 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/OptionalAccess.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/OptionalAccess.java @@ -5,12 +5,12 @@ package org.whispersystems.textsecuregcm.auth; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response; import java.security.MessageDigest; import java.util.Optional; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; import org.whispersystems.textsecuregcm.identity.IdentityType; import org.whispersystems.textsecuregcm.identity.ServiceIdentifier; import org.whispersystems.textsecuregcm.storage.Account; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/PhoneVerificationTokenManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/PhoneVerificationTokenManager.java index 2dd23b6d2..d9c174ae2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/PhoneVerificationTokenManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/PhoneVerificationTokenManager.java @@ -7,18 +7,18 @@ package org.whispersystems.textsecuregcm.auth; import io.grpc.Status; import io.grpc.StatusRuntimeException; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.ServerErrorException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Response; import java.security.MessageDigest; import java.time.Duration; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.entities.PhoneVerificationRequest; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java index 7ae1961e4..6831640d6 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManager.java @@ -12,12 +12,12 @@ import io.micrometer.core.instrument.DistributionSummary; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Response; import java.time.Duration; import java.time.Instant; import java.util.List; import javax.annotation.Nullable; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.whispersystems.textsecuregcm.controllers.RateLimitExceededException; import org.whispersystems.textsecuregcm.entities.PhoneVerificationRequest; @@ -26,8 +26,8 @@ import org.whispersystems.textsecuregcm.entities.Svr3Credentials; import org.whispersystems.textsecuregcm.limits.RateLimiters; import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil; import org.whispersystems.textsecuregcm.push.NotPushRegisteredException; -import org.whispersystems.textsecuregcm.push.WebSocketConnectionEventManager; import org.whispersystems.textsecuregcm.push.PushNotificationManager; +import org.whispersystems.textsecuregcm.push.WebSocketConnectionEventManager; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; import org.whispersystems.textsecuregcm.storage.Device; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/WebsocketRefreshRequestEventListener.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/WebsocketRefreshRequestEventListener.java index bbc4efc8d..ff80e24f4 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/WebsocketRefreshRequestEventListener.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/WebsocketRefreshRequestEventListener.java @@ -9,11 +9,11 @@ import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; +import jakarta.ws.rs.container.ResourceInfo; +import jakarta.ws.rs.core.Context; import java.util.Arrays; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -import javax.ws.rs.container.ResourceInfo; -import javax.ws.rs.core.Context; import org.glassfish.jersey.server.monitoring.RequestEvent; import org.glassfish.jersey.server.monitoring.RequestEvent.Type; import org.glassfish.jersey.server.monitoring.RequestEventListener; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManager.java index 903fb4b58..1df40636d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManager.java @@ -3,6 +3,8 @@ package org.whispersystems.textsecuregcm.backup; import com.fasterxml.jackson.core.JsonProcessingException; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; import java.net.URI; @@ -21,8 +23,6 @@ import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallDnsRecords.java b/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallDnsRecords.java index 0d20fea56..278beb2c6 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallDnsRecords.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallDnsRecords.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.calls.routing; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.net.InetAddress; import java.util.List; import java.util.Map; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTable.java b/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTable.java index ea3b7b5a3..88d5f1541 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTable.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/calls/routing/CallRoutingTable.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.calls.routing; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import java.math.BigInteger; import java.net.Inet4Address; import java.net.Inet6Address; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java b/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java index f111815cb..fc8825bf6 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java @@ -9,13 +9,13 @@ import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; import com.google.common.annotations.VisibleForTesting; import io.micrometer.core.instrument.Metrics; +import jakarta.ws.rs.BadRequestException; import java.io.IOException; import java.util.Locale; import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.function.Function; -import javax.ws.rs.BadRequestException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AccountsTableConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AccountsTableConfiguration.java index b2ae5bd09..8fe4b1a0e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AccountsTableConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AccountsTableConfiguration.java @@ -2,8 +2,8 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotBlank; import org.whispersystems.textsecuregcm.configuration.DynamoDbTables.Table; -import javax.validation.constraints.NotBlank; public class AccountsTableConfiguration extends Table { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ApnConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ApnConfiguration.java index 440c6423f..9251f5966 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ApnConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ApnConfiguration.java @@ -4,8 +4,8 @@ */ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AppleAppStoreConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AppleAppStoreConfiguration.java index c2637a926..be5cf6c57 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AppleAppStoreConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/AppleAppStoreConfiguration.java @@ -6,11 +6,11 @@ package org.whispersystems.textsecuregcm.configuration; import com.apple.itunes.storekit.model.Environment; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; /** diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ArtServiceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ArtServiceConfiguration.java index ce2c79b47..9e1a450bf 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ArtServiceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ArtServiceConfiguration.java @@ -7,8 +7,8 @@ package org.whispersystems.textsecuregcm.configuration; import static org.apache.commons.lang3.ObjectUtils.firstNonNull; +import jakarta.validation.constraints.NotNull; import java.time.Duration; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; import org.whispersystems.textsecuregcm.util.ExactlySize; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgeConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgeConfiguration.java index 8fe806b74..8e9b37882 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgeConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgeConfiguration.java @@ -7,9 +7,9 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.List; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.entities.BadgeSvg; import org.whispersystems.textsecuregcm.util.ExactlySize; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgesConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgesConfiguration.java index dd067bf7a..4fec0f21a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgesConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BadgesConfiguration.java @@ -11,13 +11,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import io.dropwizard.validation.ValidationMethod; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; public class BadgesConfiguration { private final List badges; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BraintreeConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BraintreeConfiguration.java index f0ac64ac4..8a6d28f1d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BraintreeConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/BraintreeConfiguration.java @@ -5,12 +5,12 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.Map; import java.util.Set; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; import org.whispersystems.textsecuregcm.subscriptions.PaymentMethod; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/Cdn3StorageManagerConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/Cdn3StorageManagerConfiguration.java index 64cc5f4bd..39fb09828 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/Cdn3StorageManagerConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/Cdn3StorageManagerConfiguration.java @@ -1,9 +1,9 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.Collections; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; /** diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CdnConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CdnConfiguration.java index 93a07a88a..e2428291a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CdnConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CdnConfiguration.java @@ -5,9 +5,9 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; public record CdnConfiguration(@NotNull @Valid StaticAwsCredentialsFactory credentials, @NotBlank String bucket, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CircuitBreakerConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CircuitBreakerConfiguration.java index 96488e158..b593321bd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CircuitBreakerConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CircuitBreakerConfiguration.java @@ -8,13 +8,13 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; public class CircuitBreakerConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientCdnConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientCdnConfiguration.java index 224855667..8b12c3a1f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientCdnConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientCdnConfiguration.java @@ -1,13 +1,8 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; /** * Configuration used to interact with a cdn via HTTP diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientReleaseConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientReleaseConfiguration.java index 890ad2bc2..847d7ddfd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientReleaseConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ClientReleaseConfiguration.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.time.Duration; public record ClientReleaseConfiguration(@NotNull Duration refreshInterval) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CloudflareTurnConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CloudflareTurnConfiguration.java index 0e7f593a5..c9decf9b4 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CloudflareTurnConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/CloudflareTurnConfiguration.java @@ -5,11 +5,11 @@ package org.whispersystems.textsecuregcm.configuration; -import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; public record CloudflareTurnConfiguration(@NotNull SecretString apiToken, @NotBlank String endpoint, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DefaultPubSubPublisherFactory.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DefaultPubSubPublisherFactory.java index 93cec6b8e..935f67580 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DefaultPubSubPublisherFactory.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DefaultPubSubPublisherFactory.java @@ -14,10 +14,10 @@ import com.google.auth.oauth2.ExternalAccountCredentials; import com.google.cloud.pubsub.v1.Publisher; import com.google.cloud.pubsub.v1.PublisherInterface; import com.google.pubsub.v1.TopicName; +import jakarta.validation.constraints.NotBlank; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; -import javax.validation.constraints.NotBlank; @JsonTypeName("default") public record DefaultPubSubPublisherFactory(@NotBlank String project, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DirectoryV2Configuration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DirectoryV2Configuration.java index afe069ca9..059d3a6cf 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DirectoryV2Configuration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DirectoryV2Configuration.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.Valid; +import jakarta.validation.Valid; public class DirectoryV2Configuration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DogstatsdConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DogstatsdConfiguration.java index 906f47ded..fa92402c3 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DogstatsdConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DogstatsdConfiguration.java @@ -8,9 +8,9 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import io.micrometer.statsd.StatsdFlavor; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import java.time.Duration; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; @JsonTypeName("default") public class DogstatsdConfiguration implements DatadogConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbClientConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbClientConfiguration.java index a1405c271..afcd9af5f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbClientConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbClientConfiguration.java @@ -5,11 +5,11 @@ package org.whispersystems.textsecuregcm.configuration; -import java.time.Duration; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import java.time.Duration; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.http.crt.AwsCrtHttpClient; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbTables.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbTables.java index 0d221c638..2eb8644b6 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbTables.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/DynamoDbTables.java @@ -7,10 +7,10 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.time.Duration; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; public class DynamoDbTables { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ExternalRequestFilterConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ExternalRequestFilterConfiguration.java index ff231d347..f92050c47 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ExternalRequestFilterConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ExternalRequestFilterConfiguration.java @@ -5,9 +5,9 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.Set; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.InetAddressRange; public record ExternalRequestFilterConfiguration(@Valid @NotNull Set<@NotNull String> paths, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/FcmConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/FcmConfiguration.java index bd6b3e5e0..2e0c3fa51 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/FcmConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/FcmConfiguration.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; public record FcmConfiguration(@NotNull SecretString credentials) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GcpAttachmentsConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GcpAttachmentsConfiguration.java index 8c075e255..646eb0136 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GcpAttachmentsConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GcpAttachmentsConfiguration.java @@ -6,9 +6,9 @@ package org.whispersystems.textsecuregcm.configuration; import io.dropwizard.validation.ValidationMethod; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import org.apache.commons.lang3.StringUtils; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GenericZkConfig.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GenericZkConfig.java index 2ebcace88..5bb22d2b3 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GenericZkConfig.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GenericZkConfig.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; public record GenericZkConfig(@NotNull SecretBytes serverSecret) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GooglePlayBillingConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GooglePlayBillingConfiguration.java index 6f168d792..8f51151e0 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GooglePlayBillingConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/GooglePlayBillingConfiguration.java @@ -5,9 +5,9 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import java.util.Map; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; /** diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/IssuedReceiptsTableConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/IssuedReceiptsTableConfiguration.java index e7969f521..d4a090741 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/IssuedReceiptsTableConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/IssuedReceiptsTableConfiguration.java @@ -6,8 +6,8 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotEmpty; import java.time.Duration; -import javax.validation.constraints.NotEmpty; public class IssuedReceiptsTableConfiguration extends DynamoDbTables.TableWithExpiration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/KeyTransparencyServiceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/KeyTransparencyServiceConfiguration.java index c142a4004..8339fffcd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/KeyTransparencyServiceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/KeyTransparencyServiceConfiguration.java @@ -5,10 +5,10 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; public record KeyTransparencyServiceConfiguration(@NotBlank String host, @Positive int port, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MaxDeviceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MaxDeviceConfiguration.java index b9b26ece8..9e82a2a9f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MaxDeviceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MaxDeviceConfiguration.java @@ -6,8 +6,8 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; public class MaxDeviceConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageByteLimitCardinalityEstimatorConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageByteLimitCardinalityEstimatorConfiguration.java index 1630c5698..891fd1534 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageByteLimitCardinalityEstimatorConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageByteLimitCardinalityEstimatorConfiguration.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.time.Duration; public record MessageByteLimitCardinalityEstimatorConfiguration(@NotNull Duration period) {} diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageCacheConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageCacheConfiguration.java index 62519ab32..cbfca432b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageCacheConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MessageCacheConfiguration.java @@ -6,9 +6,8 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; public class MessageCacheConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MonitoredS3ObjectConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MonitoredS3ObjectConfiguration.java index 9e5e6145f..ff7d9c601 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MonitoredS3ObjectConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/MonitoredS3ObjectConfiguration.java @@ -6,11 +6,11 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonTypeName; -import org.whispersystems.textsecuregcm.s3.S3ObjectMonitor; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; +import jakarta.validation.constraints.NotBlank; import java.time.Duration; import java.util.concurrent.ScheduledExecutorService; -import javax.validation.constraints.NotBlank; +import org.whispersystems.textsecuregcm.s3.S3ObjectMonitor; +import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; @JsonTypeName("default") public record MonitoredS3ObjectConfiguration( diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/NoiseWebSocketTunnelConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/NoiseWebSocketTunnelConfiguration.java index 624147c9f..5ebd658bd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/NoiseWebSocketTunnelConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/NoiseWebSocketTunnelConfiguration.java @@ -1,8 +1,8 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; import org.signal.libsignal.protocol.InvalidKeyException; import org.signal.libsignal.protocol.ecc.Curve; import org.signal.libsignal.protocol.ecc.ECKeyPair; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationConfiguration.java index 8c1a1e2d5..552ebc05a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationConfiguration.java @@ -5,12 +5,12 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Positive; import java.math.BigDecimal; import java.time.Duration; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Positive; /** * @param boost configuration for individual donations diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationCurrencyConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationCurrencyConfiguration.java index 9fa696b3b..aa9d872e9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationCurrencyConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/OneTimeDonationCurrencyConfiguration.java @@ -5,11 +5,11 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.NotNull; import java.math.BigDecimal; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.ExactlySize; /** diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceClientsConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceClientsConfiguration.java index 9669ed08c..231609c9c 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceClientsConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceClientsConfiguration.java @@ -6,11 +6,11 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.net.http.HttpClient; import java.util.Map; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; import org.whispersystems.textsecuregcm.currency.CoinMarketCapClient; import org.whispersystems.textsecuregcm.currency.FixerClient; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceConfiguration.java index 31883feb4..ccdfafad4 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/PaymentsServiceConfiguration.java @@ -5,11 +5,11 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.List; +import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; public record PaymentsServiceConfiguration(@NotNull SecretBytes userAuthenticationTokenSharedSecret, @NotEmpty List paymentCurrencies, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisClusterConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisClusterConfiguration.java index 0a0352e00..1fa6bb342 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisClusterConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisClusterConfiguration.java @@ -9,10 +9,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.annotations.VisibleForTesting; import io.lettuce.core.resource.ClientResources; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.time.Duration; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisClusterClient; @JsonTypeName("default") diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisConfiguration.java index ba6c458dc..6a32bb223 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RedisConfiguration.java @@ -9,10 +9,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.annotations.VisibleForTesting; import io.lettuce.core.resource.ClientResources; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.time.Duration; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.redis.FaultTolerantRedisClient; @JsonTypeName("default") diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RegistrationServiceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RegistrationServiceConfiguration.java index 44cc49080..d4f118972 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RegistrationServiceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RegistrationServiceConfiguration.java @@ -2,10 +2,10 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonTypeName; import io.dropwizard.core.setup.Environment; +import jakarta.validation.constraints.NotBlank; import java.io.IOException; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; -import javax.validation.constraints.NotBlank; import org.whispersystems.textsecuregcm.registration.IdentityTokenCallCredentials; import org.whispersystems.textsecuregcm.registration.RegistrationServiceClient; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RemoteConfigConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RemoteConfigConfiguration.java index 83f8d40ac..7786cef21 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RemoteConfigConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RemoteConfigConfiguration.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.constraints.NotNull; import java.util.Map; -import javax.validation.constraints.NotNull; public record RemoteConfigConfiguration(@NotNull Map globalConfig) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ReportMessageConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ReportMessageConfiguration.java index 98d2f0061..1edf2d008 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ReportMessageConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ReportMessageConfiguration.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.time.Duration; public class ReportMessageConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RetryConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RetryConfiguration.java index 9110b05d7..41032a120 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RetryConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/RetryConfiguration.java @@ -6,12 +6,9 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.Min; - -import java.time.Duration; - import io.github.resilience4j.retry.RetryConfig; +import jakarta.validation.constraints.Min; +import java.time.Duration; public class RetryConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureStorageServiceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureStorageServiceConfiguration.java index ebf6c2349..dab7d5848 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureStorageServiceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureStorageServiceConfiguration.java @@ -5,11 +5,11 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; public record SecureStorageServiceConfiguration(@NotNull SecretBytes userAuthenticationTokenSharedSecret, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery2Configuration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery2Configuration.java index a0a333195..1d73d1ee7 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery2Configuration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery2Configuration.java @@ -4,11 +4,11 @@ */ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; import org.whispersystems.textsecuregcm.util.ExactlySize; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery3Configuration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery3Configuration.java index 71eecffd0..16f454405 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery3Configuration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SecureValueRecovery3Configuration.java @@ -4,15 +4,14 @@ */ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import java.util.List; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; import org.whispersystems.textsecuregcm.util.ExactlySize; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import java.util.List; - public record SecureValueRecovery3Configuration( @NotBlank String uri, @ExactlySize(32) SecretBytes userAuthenticationTokenSharedSecret, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SpamFilterConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SpamFilterConfiguration.java index c30028c35..185ed3c4d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SpamFilterConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SpamFilterConfiguration.java @@ -7,7 +7,7 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; public class SpamFilterConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StaticAwsCredentialsFactory.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StaticAwsCredentialsFactory.java index 269699a89..5c34e3c9b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StaticAwsCredentialsFactory.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StaticAwsCredentialsFactory.java @@ -7,11 +7,11 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; -import javax.validation.constraints.NotNull; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = StaticAwsCredentialsFactory.class) @JsonTypeName("static") diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StripeConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StripeConfiguration.java index cef389757..2984f9e0e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StripeConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/StripeConfiguration.java @@ -5,12 +5,12 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.util.Map; import java.util.Set; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; import org.whispersystems.textsecuregcm.subscriptions.PaymentMethod; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionConfiguration.java index 3bcb20824..152a6f535 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionConfiguration.java @@ -10,18 +10,16 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Sets; import io.dropwizard.validation.ValidationMethod; -import org.whispersystems.textsecuregcm.backup.BackupLevelUtil; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.Collections; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import org.whispersystems.textsecuregcm.backup.BackupLevelUtil; public class SubscriptionConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionLevelConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionLevelConfiguration.java index f8aab68a8..86c5af9db 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionLevelConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionLevelConfiguration.java @@ -6,11 +6,11 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; public sealed interface SubscriptionLevelConfiguration permits SubscriptionLevelConfiguration.Backup, SubscriptionLevelConfiguration.Donation { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionPriceConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionPriceConfiguration.java index 1e3439f61..5636a66ad 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionPriceConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/SubscriptionPriceConfiguration.java @@ -5,13 +5,13 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.Valid; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.math.BigDecimal; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.subscriptions.PaymentProvider; public record SubscriptionPriceConfiguration(@Valid @NotEmpty Map processorIds, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TlsKeyStoreConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TlsKeyStoreConfiguration.java index 6b52e31f4..1bd2c1d68 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TlsKeyStoreConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TlsKeyStoreConfiguration.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.configuration; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretString; -import javax.validation.constraints.NotNull; public record TlsKeyStoreConfiguration(@NotNull SecretString password) { } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TurnUriConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TurnUriConfiguration.java index 913d49790..6697dde8d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TurnUriConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/TurnUriConfiguration.java @@ -1,8 +1,8 @@ package org.whispersystems.textsecuregcm.configuration; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Collections; import java.util.List; import java.util.Set; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/UnidentifiedDeliveryConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/UnidentifiedDeliveryConfiguration.java index 18971349e..50eb96709 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/UnidentifiedDeliveryConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/UnidentifiedDeliveryConfiguration.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.signal.libsignal.protocol.InvalidKeyException; import org.signal.libsignal.protocol.ecc.Curve; import org.signal.libsignal.protocol.ecc.ECPrivateKey; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ZkConfig.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ZkConfig.java index a0aebf91f..2fc2992e8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ZkConfig.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/ZkConfig.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.configuration; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.configuration.secrets.SecretBytes; public record ZkConfig(@NotNull SecretBytes serverSecret, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicCaptchaConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicCaptchaConfiguration.java index 378c4a884..d34a0e61b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicCaptchaConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicCaptchaConfiguration.java @@ -7,14 +7,14 @@ package org.whispersystems.textsecuregcm.configuration.dynamic; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; -import org.whispersystems.textsecuregcm.captcha.Action; +import jakarta.validation.constraints.DecimalMax; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.NotNull; import java.math.BigDecimal; import java.util.Collections; import java.util.Map; import java.util.Set; -import javax.validation.constraints.DecimalMax; -import javax.validation.constraints.DecimalMin; -import javax.validation.constraints.NotNull; +import org.whispersystems.textsecuregcm.captcha.Action; public class DynamicCaptchaConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfiguration.java index d1e41bc14..4a7df9ec1 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfiguration.java @@ -6,12 +6,12 @@ package org.whispersystems.textsecuregcm.configuration.dynamic; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import javax.validation.Valid; import org.whispersystems.textsecuregcm.limits.RateLimiterConfig; public class DynamicConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicExperimentEnrollmentConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicExperimentEnrollmentConfiguration.java index 9d9f019a6..7d779d313 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicExperimentEnrollmentConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicExperimentEnrollmentConfiguration.java @@ -6,13 +6,13 @@ package org.whispersystems.textsecuregcm.configuration.dynamic; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.Collections; import java.util.Set; import java.util.UUID; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; public class DynamicExperimentEnrollmentConfiguration { @@ -80,4 +80,3 @@ public class DynamicExperimentEnrollmentConfiguration { return excludedUuids; } } - diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicPreRegistrationExperimentEnrollmentConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicPreRegistrationExperimentEnrollmentConfiguration.java index d81b1595e..e80ad4077 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicPreRegistrationExperimentEnrollmentConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicPreRegistrationExperimentEnrollmentConfiguration.java @@ -6,11 +6,11 @@ package org.whispersystems.textsecuregcm.configuration.dynamic; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; import java.util.Collections; import java.util.Set; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; public class DynamicPreRegistrationExperimentEnrollmentConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicTurnConfiguration.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicTurnConfiguration.java index c811377aa..a0032791b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicTurnConfiguration.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicTurnConfiguration.java @@ -6,9 +6,9 @@ package org.whispersystems.textsecuregcm.configuration.dynamic; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; import java.util.Collections; import java.util.List; -import javax.validation.Valid; import org.whispersystems.textsecuregcm.configuration.TurnUriConfiguration; public class DynamicTurnConfiguration { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/BaseSecretValidator.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/BaseSecretValidator.java index d7887535e..69f82febf 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/BaseSecretValidator.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/BaseSecretValidator.java @@ -7,9 +7,9 @@ package org.whispersystems.textsecuregcm.configuration.secrets; import static java.util.Objects.requireNonNull; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; import java.lang.annotation.Annotation; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; public abstract class BaseSecretValidator> implements ConstraintValidator { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretBytesList.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretBytesList.java index 88dec09b2..dd9e461e2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretBytesList.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretBytesList.java @@ -6,9 +6,9 @@ package org.whispersystems.textsecuregcm.configuration.secrets; import com.google.common.collect.ImmutableList; +import jakarta.validation.constraints.NotEmpty; import java.util.Collection; import java.util.List; -import javax.validation.constraints.NotEmpty; import org.hibernate.validator.internal.constraintvalidators.bv.notempty.NotEmptyValidatorForCollection; public class SecretBytesList extends Secret> { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretStringList.java b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretStringList.java index e08fe5b54..1254158e8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretStringList.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretStringList.java @@ -6,9 +6,9 @@ package org.whispersystems.textsecuregcm.configuration.secrets; import com.google.common.collect.ImmutableList; +import jakarta.validation.constraints.NotEmpty; import java.util.Collection; import java.util.List; -import javax.validation.constraints.NotEmpty; import org.hibernate.validator.internal.constraintvalidators.bv.notempty.NotEmptyValidatorForCollection; public class SecretStringList extends Secret> { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java index 10d149e8b..a61beaeb7 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java @@ -9,31 +9,31 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HEAD; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.util.Base64; import java.util.Objects; import java.util.Optional; import java.util.UUID; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.GET; -import javax.ws.rs.HEAD; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.signal.libsignal.usernames.BaseUsernameException; import org.whispersystems.textsecuregcm.auth.AccountAndAuthenticatedDeviceHolder; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java index 1288988a9..f41698740 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2.java @@ -17,25 +17,25 @@ import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.time.Instant; import java.util.Optional; import java.util.UUID; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ChangesPhoneNumber; import org.whispersystems.textsecuregcm.auth.PhoneVerificationTokenManager; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArchiveController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArchiveController.java index 6ab6bcadc..8ca188a0f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArchiveController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArchiveController.java @@ -20,6 +20,25 @@ import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.PositiveOrZero; +import jakarta.validation.constraints.Size; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -37,25 +56,6 @@ import java.util.concurrent.CompletionStage; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.PositiveOrZero; -import javax.validation.constraints.Size; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.signal.libsignal.protocol.ecc.ECPublicKey; import org.signal.libsignal.zkgroup.InvalidInputException; import org.signal.libsignal.zkgroup.backups.BackupAuthCredentialPresentation; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArtController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArtController.java index ba47480e8..e41f344eb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArtController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ArtController.java @@ -7,11 +7,11 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.util.UUID; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AttachmentControllerV4.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AttachmentControllerV4.java index b37664d59..2523c5a0f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AttachmentControllerV4.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AttachmentControllerV4.java @@ -10,14 +10,14 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.security.SecureRandom; import java.util.Base64; import java.util.Map; import javax.annotation.Nonnull; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.attachments.AttachmentGenerator; import org.whispersystems.textsecuregcm.attachments.GcsAttachmentGenerator; import org.whispersystems.textsecuregcm.attachments.TusAttachmentGenerator; @@ -94,4 +94,3 @@ public class AttachmentControllerV4 { return Base64.getUrlEncoder().encodeToString(bytes); } } - diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallLinkController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallLinkController.java index 4558a628c..ff698fa5b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallLinkController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallLinkController.java @@ -3,15 +3,15 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.time.Instant; import java.time.temporal.ChronoUnit; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.signal.libsignal.protocol.ServiceId; import org.signal.libsignal.zkgroup.GenericServerSecretParams; import org.signal.libsignal.zkgroup.InvalidInputException; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingController.java index fb1548101..149876fca 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingController.java @@ -12,17 +12,17 @@ import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Optional; import java.util.UUID; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2.java index de674b554..15326f3f0 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2.java @@ -12,6 +12,12 @@ import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; @@ -19,12 +25,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.UUID; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.CloudflareTurnCredentialsManager; import org.whispersystems.textsecuregcm.auth.TurnToken; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CertificateController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CertificateController.java index 060f61a5c..5dc654afd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CertificateController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/CertificateController.java @@ -13,6 +13,14 @@ import io.dropwizard.auth.Auth; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tags; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; import java.security.InvalidKeyException; import java.time.Clock; import java.time.Duration; @@ -22,14 +30,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; import javax.annotation.Nonnull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; import org.signal.libsignal.protocol.ServiceId; import org.signal.libsignal.zkgroup.GenericServerSecretParams; import org.signal.libsignal.zkgroup.auth.AuthCredentialWithPniResponse; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java index 27e993851..12cc974a3 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ChallengeController.java @@ -18,22 +18,22 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.io.IOException; -import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; +import org.whispersystems.textsecuregcm.entities.AnswerCaptchaChallengeRequest; import org.whispersystems.textsecuregcm.entities.AnswerChallengeRequest; import org.whispersystems.textsecuregcm.entities.AnswerPushChallengeRequest; -import org.whispersystems.textsecuregcm.entities.AnswerCaptchaChallengeRequest; import org.whispersystems.textsecuregcm.filters.RemoteAddressFilter; import org.whispersystems.textsecuregcm.limits.RateLimitChallengeManager; import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java index 40369b72e..0eca85943 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DeviceController.java @@ -17,6 +17,27 @@ import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.time.Duration; import java.time.Instant; import java.util.Arrays; @@ -30,27 +51,6 @@ import java.util.concurrent.CompletionStage; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ContainerRequest; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.BasicAuthorizationHeader; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DirectoryV2Controller.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DirectoryV2Controller.java index 9c020c6f9..c1dc6c92e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DirectoryV2Controller.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DirectoryV2Controller.java @@ -7,13 +7,13 @@ package org.whispersystems.textsecuregcm.controllers; import com.google.common.annotations.VisibleForTesting; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.time.Clock; import java.util.UUID; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DonationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DonationController.java index 553920951..6619094d8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DonationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/DonationController.java @@ -7,6 +7,15 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.time.Clock; import java.time.Instant; import java.util.Objects; @@ -14,15 +23,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.function.Function; import javax.annotation.Nonnull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.signal.libsignal.zkgroup.InvalidInputException; import org.signal.libsignal.zkgroup.VerificationFailedException; import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialPresentation; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeepAliveController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeepAliveController.java index 8813d9a37..21a627b7e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeepAliveController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeepAliveController.java @@ -12,12 +12,12 @@ import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tags; import io.micrometer.core.instrument.Timer; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; import java.time.Duration; import java.time.Instant; import java.util.Optional; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java index 197f98029..d47215458 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java @@ -14,26 +14,25 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import java.nio.ByteBuffer; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.ServerErrorException; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.time.Duration; import java.util.Optional; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletionException; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.GET; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.signal.keytransparency.client.AciMonitorRequest; import org.signal.keytransparency.client.E164MonitorRequest; import org.signal.keytransparency.client.E164SearchRequest; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeysController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeysController.java index 1a7c844ad..7f1bfd951 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeysController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeysController.java @@ -15,6 +15,24 @@ import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.parameters.RequestBody; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -25,24 +43,6 @@ import java.util.Optional; import java.util.UUID; import java.util.concurrent.CompletableFuture; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.signal.libsignal.protocol.IdentityKey; import org.signal.libsignal.zkgroup.ServerSecretParams; import org.signal.libsignal.zkgroup.VerificationFailedException; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java index f9f68b8f5..f236800bf 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java @@ -24,6 +24,29 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.InternalServerErrorException; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.security.MessageDigest; import java.time.Clock; import java.time.Duration; @@ -47,29 +70,6 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.apache.commons.lang3.StringUtils; import org.glassfish.jersey.server.ManagedAsync; import org.signal.libsignal.protocol.SealedSenderMultiRecipientMessage; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/OneTimeDonationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/OneTimeDonationController.java index 5ae90df4d..b9512a264 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/OneTimeDonationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/OneTimeDonationController.java @@ -10,6 +10,22 @@ import io.dropwizard.auth.Auth; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.math.BigDecimal; import java.time.Clock; import java.time.Duration; @@ -22,22 +38,6 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.signal.libsignal.zkgroup.InvalidInputException; import org.signal.libsignal.zkgroup.VerificationFailedException; import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialRequest; @@ -52,13 +52,13 @@ import org.whispersystems.textsecuregcm.storage.IssuedReceiptsManager; import org.whispersystems.textsecuregcm.storage.OneTimeDonationsManager; import org.whispersystems.textsecuregcm.subscriptions.BraintreeManager; import org.whispersystems.textsecuregcm.subscriptions.ChargeFailure; +import org.whispersystems.textsecuregcm.subscriptions.CustomerAwareSubscriptionPaymentProcessor; import org.whispersystems.textsecuregcm.subscriptions.PaymentDetails; import org.whispersystems.textsecuregcm.subscriptions.PaymentMethod; +import org.whispersystems.textsecuregcm.subscriptions.PaymentProvider; import org.whispersystems.textsecuregcm.subscriptions.PaymentStatus; import org.whispersystems.textsecuregcm.subscriptions.StripeManager; import org.whispersystems.textsecuregcm.subscriptions.SubscriptionCurrencyUtil; -import org.whispersystems.textsecuregcm.subscriptions.PaymentProvider; -import org.whispersystems.textsecuregcm.subscriptions.CustomerAwareSubscriptionPaymentProcessor; import org.whispersystems.textsecuregcm.util.ExactlySize; import org.whispersystems.textsecuregcm.util.HeaderUtils; import org.whispersystems.textsecuregcm.util.ua.ClientPlatform; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/PaymentsController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/PaymentsController.java index eebc6f613..6d6383fdc 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/PaymentsController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/PaymentsController.java @@ -7,10 +7,10 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java index 0ba41450c..41b00287c 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProfileController.java @@ -12,6 +12,25 @@ import io.dropwizard.auth.Auth; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.time.Clock; @@ -28,25 +47,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.function.Function; import java.util.stream.Collectors; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ManagedAsync; import org.signal.libsignal.protocol.IdentityKey; import org.signal.libsignal.protocol.ServiceId; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProvisioningController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProvisioningController.java index c072fe342..5c6232b46 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProvisioningController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/ProvisioningController.java @@ -17,18 +17,18 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.Base64; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.entities.ProvisioningMessage; import org.whispersystems.textsecuregcm.limits.RateLimiters; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java index a048ffce4..79398b76f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RegistrationController.java @@ -17,22 +17,22 @@ import io.swagger.v3.oas.annotations.headers.Header; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; import java.util.Optional; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.whispersystems.textsecuregcm.auth.BasicAuthorizationHeader; import org.whispersystems.textsecuregcm.auth.PhoneVerificationTokenManager; import org.whispersystems.textsecuregcm.auth.RegistrationLockVerificationManager; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigController.java index 81826315d..7b54d4e31 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigController.java @@ -8,6 +8,10 @@ package org.whispersystems.textsecuregcm.controllers; import com.google.common.annotations.VisibleForTesting; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; @@ -18,10 +22,6 @@ import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.entities.UserRemoteConfig; import org.whispersystems.textsecuregcm.entities.UserRemoteConfigList; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java index 64a2ec7bb..c6b157e73 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureStorageController.java @@ -7,10 +7,10 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java index 9b8581160..f0bc31379 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2Controller.java @@ -10,19 +10,19 @@ import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.time.Clock; import java.util.List; import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3Controller.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3Controller.java index aaefb01e7..9eab281ab 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3Controller.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3Controller.java @@ -10,20 +10,20 @@ import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.time.Clock; import java.util.List; import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/StickerController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/StickerController.java index bde281eb1..1b94418c8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/StickerController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/StickerController.java @@ -7,19 +7,19 @@ package org.whispersystems.textsecuregcm.controllers; import io.dropwizard.auth.Auth; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; import java.security.SecureRandom; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.HexFormat; import java.util.LinkedList; import java.util.List; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.entities.StickerPackFormUploadAttributes; import org.whispersystems.textsecuregcm.entities.StickerPackFormUploadAttributes.StickerPackFormUploadItem; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java index 76bea791e..f98627ed1 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java @@ -18,6 +18,28 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.math.BigDecimal; import java.time.Clock; import java.time.Instant; @@ -34,28 +56,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialResponse; import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; import org.whispersystems.textsecuregcm.backup.BackupManager; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java index 99ebd1364..96f25d6f8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VerificationController.java @@ -15,6 +15,28 @@ import io.grpc.StatusRuntimeException; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.PATCH; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ServerErrorException; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; @@ -31,28 +53,6 @@ import java.util.Optional; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletionException; import java.util.concurrent.TimeUnit; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.Consumes; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.PATCH; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.slf4j.Logger; @@ -67,7 +67,6 @@ import org.whispersystems.textsecuregcm.entities.UpdateVerificationSessionReques import org.whispersystems.textsecuregcm.entities.VerificationCodeRequest; import org.whispersystems.textsecuregcm.entities.VerificationSessionResponse; import org.whispersystems.textsecuregcm.filters.RemoteAddressFilter; -import org.whispersystems.textsecuregcm.limits.RateLimiter; import org.whispersystems.textsecuregcm.limits.RateLimiters; import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil; import org.whispersystems.textsecuregcm.push.PushNotification; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountAttributes.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountAttributes.java index 6980b77d6..04bdcae83 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountAttributes.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountAttributes.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.VisibleForTesting; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.Size; import java.util.Optional; import java.util.Set; import javax.annotation.Nullable; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.Size; import org.whispersystems.textsecuregcm.auth.UnidentifiedAccessUtil; import org.whispersystems.textsecuregcm.storage.DeviceCapability; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountIdentifierResponse.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountIdentifierResponse.java index e3067d628..58e4e1bf9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountIdentifierResponse.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AccountIdentifierResponse.java @@ -7,7 +7,7 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier; import org.whispersystems.textsecuregcm.util.ServiceIdentifierAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerCaptchaChallengeRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerCaptchaChallengeRequest.java index a2f0bbd16..cec351de3 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerCaptchaChallengeRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerCaptchaChallengeRequest.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; public class AnswerCaptchaChallengeRequest extends AnswerChallengeRequest { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerPushChallengeRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerPushChallengeRequest.java index 97177f453..8238749a0 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerPushChallengeRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AnswerPushChallengeRequest.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; public class AnswerPushChallengeRequest extends AnswerChallengeRequest { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ApnRegistrationId.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ApnRegistrationId.java index 793125de3..0675caff3 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ApnRegistrationId.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ApnRegistrationId.java @@ -4,8 +4,7 @@ */ package org.whispersystems.textsecuregcm.entities; -import javax.annotation.Nullable; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public record ApnRegistrationId(@NotEmpty String apnRegistrationId) { } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckRequest.java index 5f5852afc..327b37563 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckRequest.java @@ -9,9 +9,9 @@ import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.whispersystems.textsecuregcm.util.E164; public record AuthCheckRequest(@Schema(description = "The e164-formatted phone number.") diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV2.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV2.java index de4137d7b..7c7851b08 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV2.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV2.java @@ -8,7 +8,7 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; import java.util.Map; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public record AuthCheckResponseV2(@Schema(description = "A dictionary with the auth check results: `SVR Credentials -> 'match'/'no-match'/'invalid'`") @NotNull Map matches) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV3.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV3.java index 81ace2b80..df204ffde 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV3.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/AuthCheckResponseV3.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; import java.util.Map; import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; public record AuthCheckResponseV3( diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/BadgeSvg.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/BadgeSvg.java index fef8cda78..6a63b7aac 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/BadgeSvg.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/BadgeSvg.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Strings; import java.util.Objects; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public class BadgeSvg { private final String light; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckRequest.java index daf3cc0c7..ff8b7565b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckRequest.java @@ -9,9 +9,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.List; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.whispersystems.textsecuregcm.identity.ServiceIdentifier; import org.whispersystems.textsecuregcm.util.ExactlySize; import org.whispersystems.textsecuregcm.util.ServiceIdentifierAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckResponse.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckResponse.java index 719e3073e..7dd040ef5 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckResponse.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/BatchIdentityCheckResponse.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import org.signal.libsignal.protocol.IdentityKey; import org.whispersystems.textsecuregcm.identity.ServiceIdentifier; import org.whispersystems.textsecuregcm.util.IdentityKeyAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ChangeNumberRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ChangeNumberRequest.java index da4d443c1..ec48f59fb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ChangeNumberRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ChangeNumberRequest.java @@ -14,10 +14,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import org.signal.libsignal.protocol.IdentityKey; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; import org.whispersystems.textsecuregcm.util.IdentityKeyAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ConfirmUsernameHashRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ConfirmUsernameHashRequest.java index 449e78041..8b23c8ff9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ConfirmUsernameHashRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ConfirmUsernameHashRequest.java @@ -6,9 +6,9 @@ package org.whispersystems.textsecuregcm.entities; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateProfileRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateProfileRequest.java index b92543b26..4e53db690 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateProfileRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateProfileRequest.java @@ -10,8 +10,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.List; import java.util.Optional; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import org.signal.libsignal.zkgroup.profiles.ProfileKeyCommitment; import org.whispersystems.textsecuregcm.util.ByteArrayBase64WithPaddingAdapter; import org.whispersystems.textsecuregcm.util.ExactlySize; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateVerificationSessionRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateVerificationSessionRequest.java index e3011c8af..57da5049a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateVerificationSessionRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/CreateVerificationSessionRequest.java @@ -8,8 +8,8 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.google.common.annotations.VisibleForTesting; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; import org.whispersystems.textsecuregcm.util.E164; // Not a record, because Jackson does not support @JsonUnwrapped with records diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceActivationRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceActivationRequest.java index eeed1d128..e722062ac 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceActivationRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceActivationRequest.java @@ -2,8 +2,8 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.Optional; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceName.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceName.java index 3fac11c8a..08f791f0f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceName.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/DeviceName.java @@ -8,8 +8,8 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Size; public record DeviceName(@JsonSerialize(using = ByteArrayAdapter.Serializing.class) @JsonDeserialize(using = ByteArrayAdapter.Deserializing.class) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/EncryptedUsername.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/EncryptedUsername.java index 8a696eb28..e8c2316b8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/EncryptedUsername.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/EncryptedUsername.java @@ -9,8 +9,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.whispersystems.textsecuregcm.util.ByteArrayBase64UrlAdapter; public record EncryptedUsername( diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/GcmRegistrationId.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/GcmRegistrationId.java index f715301a6..427f85407 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/GcmRegistrationId.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/GcmRegistrationId.java @@ -4,7 +4,7 @@ */ package org.whispersystems.textsecuregcm.entities; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public record GcmRegistrationId(@NotEmpty String gcmRegistrationId) { } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/GetCreateCallLinkCredentialsRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/GetCreateCallLinkCredentialsRequest.java index f3665f49a..227b3afd5 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/GetCreateCallLinkCredentialsRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/GetCreateCallLinkCredentialsRequest.java @@ -1,6 +1,6 @@ package org.whispersystems.textsecuregcm.entities; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public record GetCreateCallLinkCredentialsRequest(@NotEmpty byte[] createCallLinkCredentialRequest) {} diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessageList.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessageList.java index 50113db8a..1368c603d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessageList.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessageList.java @@ -15,9 +15,9 @@ import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; public record IncomingMessageList(@NotNull @Valid List<@NotNull IncomingMessage> messages, boolean online, boolean urgent, long timestamp) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyDistinguishedKeyResponse.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyDistinguishedKeyResponse.java index 2d254da2e..1f4414637 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyDistinguishedKeyResponse.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyDistinguishedKeyResponse.java @@ -8,7 +8,7 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; public record KeyTransparencyDistinguishedKeyResponse( diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorRequest.java index 19c1b6a1a..107de23cd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorRequest.java @@ -8,13 +8,13 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; import java.util.List; import java.util.Optional; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; import org.whispersystems.textsecuregcm.util.ByteArrayBase64UrlAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorResponse.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorResponse.java index 8dac8ee08..ed63af6a1 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorResponse.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencyMonitorResponse.java @@ -8,10 +8,9 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; -import javax.validation.constraints.NotNull; - public record KeyTransparencyMonitorResponse( @NotNull @JsonSerialize(using = ByteArrayAdapter.Serializing.class) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchRequest.java index 897988614..d22e54569 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchRequest.java @@ -8,6 +8,10 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import java.util.Optional; import org.signal.libsignal.protocol.IdentityKey; import org.whispersystems.textsecuregcm.identity.AciServiceIdentifier; import org.whispersystems.textsecuregcm.util.ByteArrayBase64UrlAdapter; @@ -16,11 +20,6 @@ import org.whispersystems.textsecuregcm.util.E164; import org.whispersystems.textsecuregcm.util.IdentityKeyAdapter; import org.whispersystems.textsecuregcm.util.ServiceIdentifierAdapter; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; -import java.util.Optional; - public record KeyTransparencySearchRequest( @NotNull @JsonSerialize(using = ServiceIdentifierAdapter.ServiceIdentifierSerializer.class) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchResponse.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchResponse.java index 3b2068cb9..14d19a143 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchResponse.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/KeyTransparencySearchResponse.java @@ -8,11 +8,9 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; -import javax.validation.constraints.NotNull; -import java.util.Optional; - public record KeyTransparencySearchResponse( @NotNull @JsonSerialize(using = ByteArrayAdapter.Serializing.class) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/LinkDeviceRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/LinkDeviceRequest.java index ed6fe3113..c15f815de 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/LinkDeviceRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/LinkDeviceRequest.java @@ -4,10 +4,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; import io.swagger.v3.oas.annotations.media.Schema; - -import javax.validation.Valid; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import java.util.Optional; public record LinkDeviceRequest(@Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = """ diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberDiscoverabilityRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberDiscoverabilityRequest.java index ba0e52a2f..cef90eaef 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberDiscoverabilityRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberDiscoverabilityRequest.java @@ -1,5 +1,5 @@ package org.whispersystems.textsecuregcm.entities; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; public record PhoneNumberDiscoverabilityRequest(@NotNull Boolean discoverableByPhoneNumber) {} diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberIdentityKeyDistributionRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberIdentityKeyDistributionRequest.java index cfa46f232..d05ddbf08 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberIdentityKeyDistributionRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneNumberIdentityKeyDistributionRequest.java @@ -8,13 +8,12 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; import org.signal.libsignal.protocol.IdentityKey; import org.whispersystems.textsecuregcm.util.IdentityKeyAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneVerificationRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneVerificationRequest.java index c471936cf..2c53f8f4b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneVerificationRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/PhoneVerificationRequest.java @@ -7,9 +7,9 @@ package org.whispersystems.textsecuregcm.entities; import static org.apache.commons.lang3.StringUtils.isNotBlank; +import jakarta.validation.constraints.AssertTrue; +import jakarta.ws.rs.ClientErrorException; import java.util.Base64; -import javax.validation.constraints.AssertTrue; -import javax.ws.rs.ClientErrorException; import org.apache.http.HttpStatus; public interface PhoneVerificationRequest { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ProvisioningMessage.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ProvisioningMessage.java index 959f9d80f..49f496f1b 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ProvisioningMessage.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ProvisioningMessage.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public record ProvisioningMessage( @Schema(description = "The MIME base64-encoded body of the provisioning message to send to the destination device") diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RateLimitChallenge.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RateLimitChallenge.java index bb396ea42..4565c9125 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RateLimitChallenge.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RateLimitChallenge.java @@ -2,8 +2,8 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.constraints.NotNull; import java.util.List; -import javax.validation.constraints.NotNull; public class RateLimitChallenge { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java index c4fa3a74c..a17fec553 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java @@ -7,7 +7,7 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; public class RedeemReceiptRequest { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java index f08ecc7c7..f6fa2ee90 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationLock.java @@ -7,8 +7,8 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Size; public class RegistrationLock { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationRequest.java index 5702aa226..677dfd4d2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RegistrationRequest.java @@ -12,12 +12,12 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.VisibleForTesting; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.AssertTrue; +import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.Optional; import javax.annotation.Nullable; -import javax.validation.Valid; -import javax.validation.constraints.AssertTrue; -import javax.validation.constraints.NotNull; import org.signal.libsignal.protocol.IdentityKey; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; import org.whispersystems.textsecuregcm.util.IdentityKeyAdapter; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RemoteAttachment.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RemoteAttachment.java index 9b95e0554..6a51636d8 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RemoteAttachment.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RemoteAttachment.java @@ -6,8 +6,8 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.util.ValidBase64URLString; public record RemoteAttachment( diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ReserveUsernameHashRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ReserveUsernameHashRequest.java index be37a9197..1ba0babe9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/ReserveUsernameHashRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/ReserveUsernameHashRequest.java @@ -8,12 +8,12 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import java.util.List; import org.whispersystems.textsecuregcm.controllers.AccountController; import org.whispersystems.textsecuregcm.util.ByteArrayBase64UrlAdapter; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import java.util.List; public record ReserveUsernameHashRequest( @NotNull diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RestoreAccountRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RestoreAccountRequest.java index 89ecf5a4e..05351a503 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RestoreAccountRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RestoreAccountRequest.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; @Schema(description = """ Represents a request from a new device to restore account data by some method. diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetKeysRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetKeysRequest.java index e8a797c37..796d1c764 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetKeysRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetKeysRequest.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; import java.util.List; -import javax.validation.Valid; public record SetKeysRequest( @Valid diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetShareSetRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetShareSetRequest.java index 8bcc4a2fb..122564334 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetShareSetRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/SetShareSetRequest.java @@ -6,9 +6,9 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotEmpty; import org.whispersystems.textsecuregcm.util.ByteArrayAdapter; import org.whispersystems.textsecuregcm.util.ExactlySize; -import javax.validation.constraints.NotEmpty; public record SetShareSetRequest( @Schema(description = """ diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/SubmitVerificationCodeRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/SubmitVerificationCodeRequest.java index 07bf48487..14cc359d4 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/SubmitVerificationCodeRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/SubmitVerificationCodeRequest.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.entities; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; public record SubmitVerificationCodeRequest(@NotBlank String code) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/TransferArchiveUploadedRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/TransferArchiveUploadedRequest.java index 60f27be89..ba27b0036 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/TransferArchiveUploadedRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/TransferArchiveUploadedRequest.java @@ -6,11 +6,11 @@ package org.whispersystems.textsecuregcm.entities; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.Positive; import org.whispersystems.textsecuregcm.storage.Device; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.Positive; public record TransferArchiveUploadedRequest(@Min(1) @Max(Device.MAXIMUM_DEVICE_ID) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameHashResponse.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameHashResponse.java index f2738668e..6199f5780 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameHashResponse.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameHashResponse.java @@ -8,12 +8,12 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import java.util.UUID; +import javax.annotation.Nullable; import org.whispersystems.textsecuregcm.controllers.AccountController; import org.whispersystems.textsecuregcm.util.ByteArrayBase64UrlAdapter; import org.whispersystems.textsecuregcm.util.ExactlySize; -import java.util.UUID; -import javax.annotation.Nullable; -import javax.validation.Valid; public record UsernameHashResponse( @Valid diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameLinkHandle.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameLinkHandle.java index 0840b4a77..d9ed9ff9e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameLinkHandle.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/UsernameLinkHandle.java @@ -5,10 +5,9 @@ package org.whispersystems.textsecuregcm.entities; -import java.util.UUID; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import java.util.UUID; public record UsernameLinkHandle( @Schema(description = "A handle that can be included in username links to retrieve the stored encrypted username") diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/VerificationCodeRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/VerificationCodeRequest.java index b85a2c04e..dcbcec481 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/VerificationCodeRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/VerificationCodeRequest.java @@ -6,7 +6,7 @@ package org.whispersystems.textsecuregcm.entities; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import org.whispersystems.textsecuregcm.registration.MessageTransport; public record VerificationCodeRequest(@NotNull Transport transport, @NotNull String client) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilter.java index 963d0cf3f..5813ed54a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilter.java @@ -14,15 +14,15 @@ import io.grpc.ServerCallHandler; import io.grpc.ServerInterceptor; import io.grpc.Status; import io.micrometer.core.instrument.Metrics; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.InetAddress; import java.util.Set; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.grpc.RequestAttributesUtil; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilter.java index bc3de7d07..5385c8977 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilter.java @@ -5,13 +5,13 @@ package org.whispersystems.textsecuregcm.filters; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.util.HttpServletRequestUtil; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java index d640a8b6b..0d5f18836 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilter.java @@ -14,17 +14,17 @@ import io.grpc.ServerCall; import io.grpc.ServerCallHandler; import io.grpc.ServerInterceptor; import io.micrometer.core.instrument.Metrics; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; import java.util.Set; import javax.annotation.Nullable; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicConfiguration; import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicRemoteDeprecationConfiguration; import org.whispersystems.textsecuregcm.grpc.RequestAttributesUtil; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilter.java index 449410da7..6fa38730a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilter.java @@ -10,13 +10,13 @@ import static java.util.Objects.requireNonNull; import com.google.common.net.InetAddresses; import io.micrometer.core.instrument.Metrics; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; import java.io.IOException; import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; import javax.annotation.Nonnull; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.metrics.MetricsUtil; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilter.java index 7817228ce..c12d05405 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilter.java @@ -5,17 +5,17 @@ package org.whispersystems.textsecuregcm.filters; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.container.ContainerResponseFilter; -import org.whispersystems.textsecuregcm.util.HeaderUtils; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; import java.io.IOException; +import org.whispersystems.textsecuregcm.util.HeaderUtils; /** * Injects a timestamp header into all outbound responses. diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitByIpFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitByIpFilter.java index 2fb834bb7..064670159 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitByIpFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitByIpFilter.java @@ -8,14 +8,17 @@ package org.whispersystems.textsecuregcm.limits; import static java.util.Objects.requireNonNull; import com.google.common.annotations.VisibleForTesting; +import io.micrometer.core.instrument.Metrics; +import io.micrometer.core.instrument.Tag; +import io.micrometer.core.instrument.Tags; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import java.io.IOException; import java.time.Duration; import java.util.Optional; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; import org.glassfish.jersey.server.ExtendedUriInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,10 +27,6 @@ import org.whispersystems.textsecuregcm.filters.RemoteAddressFilter; import org.whispersystems.textsecuregcm.mappers.RateLimitExceededExceptionMapper; import org.whispersystems.textsecuregcm.metrics.MetricsUtil; -import io.micrometer.core.instrument.Metrics; -import io.micrometer.core.instrument.Tag; -import io.micrometer.core.instrument.Tags; - public class RateLimitByIpFilter implements ContainerRequestFilter { private static final Logger logger = LoggerFactory.getLogger(RateLimitByIpFilter.class); diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitChallengeManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitChallengeManager.java index f5c84d8e5..7a5e95515 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitChallengeManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimitChallengeManager.java @@ -7,9 +7,6 @@ package org.whispersystems.textsecuregcm.limits; import static com.codahale.metrics.MetricRegistry.name; -import com.google.i18n.phonenumbers.NumberParseException; -import com.google.i18n.phonenumbers.PhoneNumberUtil; -import com.google.i18n.phonenumbers.Phonenumber; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; @@ -19,15 +16,12 @@ import java.util.Optional; import org.whispersystems.textsecuregcm.captcha.Action; import org.whispersystems.textsecuregcm.captcha.CaptchaChecker; import org.whispersystems.textsecuregcm.controllers.RateLimitExceededException; -import org.whispersystems.textsecuregcm.identity.IdentityType; import org.whispersystems.textsecuregcm.metrics.UserAgentTagUtil; import org.whispersystems.textsecuregcm.push.NotPushRegisteredException; import org.whispersystems.textsecuregcm.spam.ChallengeType; import org.whispersystems.textsecuregcm.spam.RateLimitChallengeListener; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.util.Util; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.core.Response; public class RateLimitChallengeManager { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimiterConfig.java b/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimiterConfig.java index 04c9afd3a..b6e5405da 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimiterConfig.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/limits/RateLimiterConfig.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.limits; -import javax.validation.constraints.AssertTrue; +import jakarta.validation.constraints.AssertTrue; import java.time.Duration; public record RateLimiterConfig(int bucketSize, Duration permitRegenerationDuration) { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/CompletionExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/CompletionExceptionMapper.java index a6eb2396b..ce9d3f3c7 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/CompletionExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/CompletionExceptionMapper.java @@ -5,13 +5,13 @@ package org.whispersystems.textsecuregcm.mappers; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import java.util.Optional; import java.util.concurrent.CompletionException; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; import org.glassfish.jersey.spi.ExceptionMappers; @Provider diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/DeviceLimitExceededExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/DeviceLimitExceededExceptionMapper.java index 3252c5665..b9f5e0b8e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/DeviceLimitExceededExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/DeviceLimitExceededExceptionMapper.java @@ -7,13 +7,11 @@ package org.whispersystems.textsecuregcm.mappers; import com.fasterxml.jackson.annotation.JsonProperty; - +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.whispersystems.textsecuregcm.controllers.DeviceLimitExceededException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - @Provider public class DeviceLimitExceededExceptionMapper implements ExceptionMapper { @Override diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapper.java index d76803800..6180a75c0 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapper.java @@ -7,10 +7,10 @@ package org.whispersystems.textsecuregcm.mappers; import io.dropwizard.jersey.errors.ErrorMessage; import io.grpc.StatusRuntimeException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; @Provider public class GrpcStatusRuntimeExceptionMapper implements ExceptionMapper { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapper.java index ea8b3ec1f..13444bc3f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapper.java @@ -4,14 +4,13 @@ */ package org.whispersystems.textsecuregcm.mappers; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; +import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; -import java.io.IOException; - @Provider public class IOExceptionMapper implements ExceptionMapper { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ImpossiblePhoneNumberExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ImpossiblePhoneNumberExceptionMapper.java index edbd670fa..39d1763b2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ImpossiblePhoneNumberExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ImpossiblePhoneNumberExceptionMapper.java @@ -5,13 +5,13 @@ package org.whispersystems.textsecuregcm.mappers; +import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; + import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.Metrics; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.whispersystems.textsecuregcm.util.ImpossiblePhoneNumberException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; - -import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; public class ImpossiblePhoneNumberExceptionMapper implements ExceptionMapper { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/InvalidWebsocketAddressExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/InvalidWebsocketAddressExceptionMapper.java index 5ad66661a..312e494cb 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/InvalidWebsocketAddressExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/InvalidWebsocketAddressExceptionMapper.java @@ -5,12 +5,11 @@ package org.whispersystems.textsecuregcm.mappers; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.whispersystems.textsecuregcm.websocket.InvalidWebsocketAddressException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - @Provider public class InvalidWebsocketAddressExceptionMapper implements ExceptionMapper { @Override diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/JsonMappingExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/JsonMappingExceptionMapper.java index 25c5c5f9b..0bb7cc406 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/JsonMappingExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/JsonMappingExceptionMapper.java @@ -1,8 +1,8 @@ package org.whispersystems.textsecuregcm.mappers; import com.fasterxml.jackson.databind.JsonMappingException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; public class JsonMappingExceptionMapper implements ExceptionMapper { @Override diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/NonNormalizedPhoneNumberExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/NonNormalizedPhoneNumberExceptionMapper.java index 9a4b26b9f..a9b744e63 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/NonNormalizedPhoneNumberExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/NonNormalizedPhoneNumberExceptionMapper.java @@ -10,9 +10,9 @@ import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; import com.google.i18n.phonenumbers.NumberParseException; import com.google.i18n.phonenumbers.PhoneNumberUtil; import io.micrometer.core.instrument.Metrics; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; import org.whispersystems.textsecuregcm.util.NonNormalizedPhoneNumberException; public class NonNormalizedPhoneNumberExceptionMapper implements ExceptionMapper { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RateLimitExceededExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RateLimitExceededExceptionMapper.java index 5fbb9b488..545098332 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RateLimitExceededExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RateLimitExceededExceptionMapper.java @@ -4,9 +4,9 @@ */ package org.whispersystems.textsecuregcm.mappers; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.controllers.RateLimitExceededException; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RegistrationServiceSenderExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RegistrationServiceSenderExceptionMapper.java index 8c753b274..d40f59c00 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RegistrationServiceSenderExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/RegistrationServiceSenderExceptionMapper.java @@ -6,8 +6,8 @@ package org.whispersystems.textsecuregcm.mappers; import com.google.common.annotations.VisibleForTesting; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.whispersystems.textsecuregcm.registration.RegistrationServiceSenderException; public class RegistrationServiceSenderExceptionMapper implements ExceptionMapper { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ServerRejectedExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ServerRejectedExceptionMapper.java index 37f8787e5..320685361 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ServerRejectedExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/ServerRejectedExceptionMapper.java @@ -5,8 +5,8 @@ package org.whispersystems.textsecuregcm.mappers; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.whispersystems.textsecuregcm.controllers.ServerRejectedException; public class ServerRejectedExceptionMapper implements ExceptionMapper { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/SubscriptionExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/SubscriptionExceptionMapper.java index 0d5f1309a..4511fdf1e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/mappers/SubscriptionExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/mappers/SubscriptionExceptionMapper.java @@ -7,12 +7,12 @@ package org.whispersystems.textsecuregcm.mappers; import com.google.common.annotations.VisibleForTesting; import io.dropwizard.jersey.errors.ErrorMessage; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import org.whispersystems.textsecuregcm.storage.SubscriptionException; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import java.util.Map; +import org.whispersystems.textsecuregcm.storage.SubscriptionException; public class SubscriptionExceptionMapper implements ExceptionMapper { @VisibleForTesting diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/metrics/LogstashTcpSocketAppenderFactory.java b/service/src/main/java/org/whispersystems/textsecuregcm/metrics/LogstashTcpSocketAppenderFactory.java index 028d34abc..74986bea1 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/metrics/LogstashTcpSocketAppenderFactory.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/metrics/LogstashTcpSocketAppenderFactory.java @@ -21,10 +21,10 @@ import io.dropwizard.logging.common.AbstractAppenderFactory; import io.dropwizard.logging.common.async.AsyncAppenderFactory; import io.dropwizard.logging.common.filter.LevelFilterFactory; import io.dropwizard.logging.common.layout.LayoutFactory; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.Optional; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import net.logstash.logback.appender.LogstashTcpSocketAppender; import net.logstash.logback.encoder.LogstashEncoder; import org.whispersystems.textsecuregcm.WhisperServerVersion; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListener.java b/service/src/main/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListener.java index ee5717b02..9413ef41c 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListener.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListener.java @@ -12,15 +12,15 @@ import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.Set; import javax.annotation.Nullable; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.container.ContainerResponseFilter; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/metrics/SignalDatadogReporterFactory.java b/service/src/main/java/org/whispersystems/textsecuregcm/metrics/SignalDatadogReporterFactory.java index fa610ea61..4f0f66eec 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/metrics/SignalDatadogReporterFactory.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/metrics/SignalDatadogReporterFactory.java @@ -15,12 +15,12 @@ import com.codahale.metrics.ScheduledReporter; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import io.dropwizard.metrics.common.BaseReporterFactory; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; import org.apache.commons.lang3.StringUtils; import org.coursera.metrics.datadog.DatadogReporter; import org.coursera.metrics.datadog.DatadogReporter.Expansion; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/providers/MultiRecipientMessageProvider.java b/service/src/main/java/org/whispersystems/textsecuregcm/providers/MultiRecipientMessageProvider.java index 86e9f4142..5e99a5a09 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/providers/MultiRecipientMessageProvider.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/providers/MultiRecipientMessageProvider.java @@ -10,18 +10,18 @@ import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; import io.dropwizard.util.DataSizeUnit; import io.micrometer.core.instrument.DistributionSummary; import io.micrometer.core.instrument.Metrics; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.NoContentException; +import jakarta.ws.rs.ext.MessageBodyReader; +import jakarta.ws.rs.ext.Provider; import java.io.IOException; import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.Consumes; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.NoContentException; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.Provider; import org.signal.libsignal.protocol.InvalidMessageException; import org.signal.libsignal.protocol.InvalidVersionException; import org.signal.libsignal.protocol.SealedSenderMultiRecipientMessage; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/spam/ChallengeConstraintChecker.java b/service/src/main/java/org/whispersystems/textsecuregcm/spam/ChallengeConstraintChecker.java index 90505695f..30ae50438 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/spam/ChallengeConstraintChecker.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/spam/ChallengeConstraintChecker.java @@ -4,10 +4,9 @@ */ package org.whispersystems.textsecuregcm.spam; -import org.whispersystems.textsecuregcm.storage.Account; - -import javax.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestContext; import java.util.Optional; +import org.whispersystems.textsecuregcm.storage.Account; public interface ChallengeConstraintChecker { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationFraudChecker.java b/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationFraudChecker.java index 1018e8a15..7462f312d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationFraudChecker.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationFraudChecker.java @@ -4,8 +4,8 @@ */ package org.whispersystems.textsecuregcm.spam; +import jakarta.ws.rs.container.ContainerRequestContext; import java.util.Optional; -import javax.ws.rs.container.ContainerRequestContext; import org.whispersystems.textsecuregcm.entities.UpdateVerificationSessionRequest; import org.whispersystems.textsecuregcm.registration.VerificationSession; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationRecoveryChecker.java b/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationRecoveryChecker.java index 91e7a9d3b..ed7093f2e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationRecoveryChecker.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/spam/RegistrationRecoveryChecker.java @@ -1,6 +1,6 @@ package org.whispersystems.textsecuregcm.spam; -import javax.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestContext; public interface RegistrationRecoveryChecker { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamChecker.java b/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamChecker.java index d565c1728..48b958972 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamChecker.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamChecker.java @@ -4,12 +4,12 @@ */ package org.whispersystems.textsecuregcm.spam; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Response; +import java.util.Optional; import org.whispersystems.textsecuregcm.auth.AccountAndAuthenticatedDeviceHolder; import org.whispersystems.textsecuregcm.identity.ServiceIdentifier; import org.whispersystems.textsecuregcm.storage.Account; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Response; -import java.util.Optional; public interface SpamChecker { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamFilter.java b/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamFilter.java index f435f64b8..1aaa4877f 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamFilter.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/spam/SpamFilter.java @@ -7,11 +7,9 @@ package org.whispersystems.textsecuregcm.spam; import io.dropwizard.configuration.ConfigurationValidationException; import io.dropwizard.lifecycle.Managed; +import jakarta.validation.Validator; import java.io.IOException; -import java.util.List; import java.util.function.Function; -import javax.validation.Validator; -import org.whispersystems.textsecuregcm.captcha.CaptchaChecker; import org.whispersystems.textsecuregcm.captcha.CaptchaClient; import org.whispersystems.textsecuregcm.storage.ReportedMessageListener; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java index 6165e1af3..e38f3b62a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java @@ -9,16 +9,15 @@ import static org.whispersystems.textsecuregcm.metrics.MetricsUtil.name; import com.google.common.annotations.VisibleForTesting; import io.micrometer.core.instrument.Metrics; - +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; import java.io.IOException; import java.io.InputStream; import java.util.Optional; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.s3.S3ObjectMonitor; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManager.java index 67dfc879e..1a19c065c 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManager.java @@ -10,6 +10,8 @@ import static org.whispersystems.textsecuregcm.util.AttributeValues.n; import static org.whispersystems.textsecuregcm.util.AttributeValues.s; import com.google.common.base.Throwables; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.core.Response.Status; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; @@ -23,8 +25,6 @@ import java.util.function.Consumer; import javax.annotation.Nonnull; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.core.Response.Status; import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialRequest; import org.whispersystems.textsecuregcm.subscriptions.PaymentProvider; import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/RemoteConfig.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/RemoteConfig.java index c1215df12..e78063633 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/RemoteConfig.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/RemoteConfig.java @@ -6,11 +6,10 @@ package org.whispersystems.textsecuregcm.storage; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; import java.util.HashSet; import java.util.Set; import java.util.UUID; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/SubscriberCredentials.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/SubscriberCredentials.java index 2b6856509..534a59b90 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/SubscriberCredentials.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/SubscriberCredentials.java @@ -4,17 +4,17 @@ */ package org.whispersystems.textsecuregcm.storage; -import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; -import javax.annotation.Nonnull; -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; -import javax.ws.rs.InternalServerErrorException; +import jakarta.ws.rs.InternalServerErrorException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.time.Clock; import java.time.Instant; import java.util.Base64; import java.util.Optional; +import javax.annotation.Nonnull; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import org.whispersystems.textsecuregcm.auth.AuthenticatedDevice; public record SubscriberCredentials(@Nonnull byte[] subscriberBytes, @Nonnull byte[] subscriberUser, diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Subscriptions.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Subscriptions.java index 8a99743c9..2f1d49480 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/Subscriptions.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/Subscriptions.java @@ -11,6 +11,8 @@ import static org.whispersystems.textsecuregcm.util.AttributeValues.s; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; +import jakarta.ws.rs.ClientErrorException; +import jakarta.ws.rs.core.Response; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.time.Instant; @@ -21,8 +23,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.ws.rs.ClientErrorException; -import javax.ws.rs.core.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.subscriptions.PaymentProvider; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClient.java b/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClient.java index 2c59fea0c..9ee38b017 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClient.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClient.java @@ -34,6 +34,7 @@ import com.braintree.graphql.clientoperation.CreatePayPalOneTimePaymentMutation; import com.braintree.graphql.clientoperation.TokenizePayPalBillingAgreementMutation; import com.braintree.graphql.clientoperation.TokenizePayPalOneTimePaymentMutation; import com.braintree.graphql.clientoperation.VaultPaymentMethodMutation; +import jakarta.ws.rs.ServiceUnavailableException; import java.math.BigDecimal; import java.net.URI; import java.net.URISyntaxException; @@ -42,7 +43,6 @@ import java.net.http.HttpResponse; import java.util.Base64; import java.util.List; import java.util.concurrent.CompletableFuture; -import javax.ws.rs.ServiceUnavailableException; import okio.Buffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/GooglePlayBillingManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/GooglePlayBillingManager.java index 5cddfee33..5b44976ad 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/GooglePlayBillingManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/GooglePlayBillingManager.java @@ -24,6 +24,7 @@ import com.google.auth.oauth2.GoogleCredentials; import com.google.common.annotations.VisibleForTesting; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tags; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; import java.security.GeneralSecurityException; @@ -39,7 +40,6 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.stream.Collectors; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/BufferingInterceptor.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/BufferingInterceptor.java index 6d881b0b2..b0cb51308 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/BufferingInterceptor.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/BufferingInterceptor.java @@ -4,14 +4,13 @@ */ package org.whispersystems.textsecuregcm.util; -import org.glassfish.jersey.message.internal.CommittingOutputStream; - -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.ext.WriterInterceptor; -import javax.ws.rs.ext.WriterInterceptorContext; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.ext.WriterInterceptor; +import jakarta.ws.rs.ext.WriterInterceptorContext; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import org.glassfish.jersey.message.internal.CommittingOutputStream; /** diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/E164.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/E164.java index ac9f9df8a..0aea8d19e 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/E164.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/E164.java @@ -10,15 +10,15 @@ import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; +import jakarta.validation.Constraint; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.util.Objects; import java.util.Optional; -import javax.validation.Constraint; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; -import javax.validation.Payload; /** * Constraint annotation that requires annotated entity diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySize.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySize.java index 0bb9416f8..c26d03b6a 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySize.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySize.java @@ -13,11 +13,11 @@ import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.TYPE_USE; import static java.lang.annotation.RetentionPolicy.RUNTIME; +import jakarta.validation.Constraint; +import jakarta.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.validation.Constraint; -import javax.validation.Payload; @Target({ FIELD, METHOD, CONSTRUCTOR, PARAMETER, ANNOTATION_TYPE, TYPE_USE }) @Retention(RUNTIME) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySizeValidator.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySizeValidator.java index a66cf939f..dcc0e4b69 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySizeValidator.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/ExactlySizeValidator.java @@ -5,11 +5,11 @@ package org.whispersystems.textsecuregcm.util; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; import java.util.Arrays; import java.util.Set; import java.util.stream.Collectors; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; public abstract class ExactlySizeValidator implements ConstraintValidator { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/HeaderUtils.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/HeaderUtils.java index b2970b35c..3cd14443d 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/HeaderUtils.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/HeaderUtils.java @@ -12,14 +12,14 @@ import io.dropwizard.auth.basic.BasicCredentials; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; +import jakarta.ws.rs.ProcessingException; +import jakarta.ws.rs.container.ContainerRequestContext; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.List; import java.util.Locale; import java.util.Optional; import javax.annotation.Nonnull; -import javax.ws.rs.ProcessingException; -import javax.ws.rs.container.ContainerRequestContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentials; diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtil.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtil.java index f799450f8..5c9c47cbd 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtil.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtil.java @@ -5,7 +5,7 @@ package org.whispersystems.textsecuregcm.util; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; public class HttpServletRequestUtil { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java index 60301a1e9..95e0bcaa2 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java @@ -8,6 +8,7 @@ import com.google.i18n.phonenumbers.NumberParseException; import com.google.i18n.phonenumbers.PhoneNumberUtil; import com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat; import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; +import jakarta.ws.rs.core.Response; import java.time.Clock; import java.time.Duration; import java.util.ArrayList; @@ -25,9 +26,6 @@ import java.util.function.Function; import java.util.random.RandomGenerator; import java.util.regex.Matcher; import java.util.regex.Pattern; - -import javax.ws.rs.core.Response; - import org.apache.commons.lang3.StringUtils; public class Util { diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidBase64URLString.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidBase64URLString.java index a54daa3ef..f10c16da9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidBase64URLString.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidBase64URLString.java @@ -5,20 +5,21 @@ package org.whispersystems.textsecuregcm.util; -import javax.validation.Constraint; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; -import javax.validation.Payload; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import jakarta.validation.Constraint; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.util.Base64; -import java.util.HexFormat; import java.util.Objects; -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - /** * Constraint annotation that requires annotated entity is a valid url-base64 encoded string. */ diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidHexString.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidHexString.java index 4f66a4308..3afbf1e68 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidHexString.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/ValidHexString.java @@ -10,15 +10,15 @@ import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; +import jakarta.validation.Constraint; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Payload; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.util.HexFormat; import java.util.Objects; -import javax.validation.Constraint; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; -import javax.validation.Payload; /** * Constraint annotation that requires annotated entity is a valid hex encoded string. diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapper.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapper.java index 3886598f5..249b09aa4 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapper.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapper.java @@ -8,8 +8,8 @@ package org.whispersystems.textsecuregcm.util.logging; import com.google.common.annotations.VisibleForTesting; import com.google.common.net.HttpHeaders; import io.dropwizard.jersey.errors.LoggingExceptionMapper; -import javax.inject.Provider; -import javax.ws.rs.core.Context; +import jakarta.inject.Provider; +import jakarta.ws.rs.core.Context; import org.glassfish.jersey.server.ContainerRequest; import org.slf4j.Logger; import org.whispersystems.textsecuregcm.util.ua.UnrecognizedUserAgentException; diff --git a/service/src/main/resources/META-INF/validation/constraints-custom.xml b/service/src/main/resources/META-INF/validation/constraints-custom.xml index e1d56701c..2cc865fa4 100644 --- a/service/src/main/resources/META-INF/validation/constraints-custom.xml +++ b/service/src/main/resources/META-INF/validation/constraints-custom.xml @@ -5,11 +5,10 @@ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/validation/mapping http://xmlns.jcp.org/xml/ns/validation/mapping/validation-mapping-2.0.xsd" version="2.0"> - + org.whispersystems.textsecuregcm.configuration.secrets.SecretStringList$ValidatorNotEmpty org.whispersystems.textsecuregcm.configuration.secrets.SecretBytesList$ValidatorNotEmpty - diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/BufferingInterceptorIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/BufferingInterceptorIntegrationTest.java index 470207ac8..b785a0732 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/BufferingInterceptorIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/BufferingInterceptorIntegrationTest.java @@ -7,13 +7,13 @@ import io.dropwizard.core.Configuration; import io.dropwizard.core.setup.Environment; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.apache.commons.lang3.RandomStringUtils; import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; import org.glassfish.jersey.server.ManagedAsync; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketResourceProviderIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketResourceProviderIntegrationTest.java index 9cf245bf8..8d30d203f 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketResourceProviderIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketResourceProviderIntegrationTest.java @@ -1,7 +1,6 @@ package org.whispersystems.textsecuregcm; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.whispersystems.textsecuregcm.filters.RemoteAddressFilter.REMOTE_ADDRESS_ATTRIBUTE_NAME; @@ -10,18 +9,18 @@ import io.dropwizard.core.Configuration; import io.dropwizard.core.setup.Environment; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletRegistration; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; import java.io.IOException; import java.net.URI; import java.util.EnumSet; -import javax.servlet.DispatcherType; -import javax.servlet.ServletRegistration; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; import org.apache.commons.lang3.RandomStringUtils; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketReuseAuthIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketReuseAuthIntegrationTest.java index ee5b0edf5..47c7c4bef 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketReuseAuthIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/WebsocketReuseAuthIntegrationTest.java @@ -16,6 +16,11 @@ import io.dropwizard.core.Configuration; import io.dropwizard.core.setup.Environment; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletRegistration; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; import java.io.IOException; import java.net.URI; import java.util.EnumSet; @@ -28,11 +33,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.IntStream; -import javax.servlet.DispatcherType; -import javax.servlet.ServletRegistration; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; import org.glassfish.jersey.server.ManagedAsync; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/WhisperServerServiceTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/WhisperServerServiceTest.java index 44cfdbb78..6ed4cc231 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/WhisperServerServiceTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/WhisperServerServiceTest.java @@ -12,11 +12,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.util.Resources; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.core.Response; import java.net.URI; import java.util.List; import java.util.Map; -import javax.ws.rs.client.Client; -import javax.ws.rs.core.Response; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.junit.jupiter.api.AfterAll; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/auth/LinkedDeviceRefreshRequirementProviderTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/auth/LinkedDeviceRefreshRequirementProviderTest.java index 696b4708a..14b73efd3 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/auth/LinkedDeviceRefreshRequirementProviderTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/auth/LinkedDeviceRefreshRequirementProviderTest.java @@ -21,6 +21,14 @@ import io.dropwizard.jersey.DropwizardResourceConfig; import io.dropwizard.jersey.jackson.JacksonMessageBodyProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -35,14 +43,6 @@ import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.UpgradeRequest; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/auth/OptionalAccessTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/auth/OptionalAccessTest.java index c05a6a7a5..515c7999a 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/auth/OptionalAccessTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/auth/OptionalAccessTest.java @@ -11,13 +11,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import jakarta.ws.rs.WebApplicationException; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.List; import java.util.Optional; import java.util.OptionalInt; import java.util.UUID; -import javax.ws.rs.WebApplicationException; import org.apache.commons.lang3.RandomStringUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/auth/PhoneNumberChangeRefreshRequirementProviderTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/auth/PhoneNumberChangeRefreshRequirementProviderTest.java index d233ab1b9..69f8adf50 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/auth/PhoneNumberChangeRefreshRequirementProviderTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/auth/PhoneNumberChangeRefreshRequirementProviderTest.java @@ -24,6 +24,11 @@ import io.dropwizard.core.Configuration; import io.dropwizard.core.setup.Environment; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.ServletRegistration; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.client.Invocation; import java.io.IOException; import java.net.URI; import java.util.Collections; @@ -31,11 +36,6 @@ import java.util.EnumSet; import java.util.List; import java.util.Optional; import java.util.UUID; -import javax.servlet.DispatcherType; -import javax.servlet.ServletRegistration; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.client.Invocation; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java index 0dd06227f..fe83bdba1 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/auth/RegistrationLockVerificationManagerTest.java @@ -19,12 +19,12 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import jakarta.ws.rs.WebApplicationException; import java.util.List; import java.util.UUID; import java.util.function.Consumer; import java.util.stream.Stream; import javax.annotation.Nullable; -import javax.ws.rs.WebApplicationException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -34,8 +34,8 @@ import org.whispersystems.textsecuregcm.entities.PhoneVerificationRequest; import org.whispersystems.textsecuregcm.limits.RateLimiter; import org.whispersystems.textsecuregcm.limits.RateLimiters; import org.whispersystems.textsecuregcm.push.NotPushRegisteredException; -import org.whispersystems.textsecuregcm.push.WebSocketConnectionEventManager; import org.whispersystems.textsecuregcm.push.PushNotificationManager; +import org.whispersystems.textsecuregcm.push.WebSocketConnectionEventManager; import org.whispersystems.textsecuregcm.storage.Account; import org.whispersystems.textsecuregcm.storage.AccountsManager; import org.whispersystems.textsecuregcm.storage.Device; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManagerTest.java index e031ef30c..92461b6af 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/backup/Cdn3RemoteStorageManagerTest.java @@ -14,12 +14,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.junit5.WireMockExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; +import jakarta.ws.rs.core.HttpHeaders; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.Executors; -import javax.ws.rs.core.HttpHeaders; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/captcha/CaptchaCheckerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/captcha/CaptchaCheckerTest.java index 1a219f218..39eb03c1a 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/captcha/CaptchaCheckerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/captcha/CaptchaCheckerTest.java @@ -15,18 +15,13 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.whispersystems.textsecuregcm.captcha.CaptchaChecker.SEPARATOR; +import jakarta.ws.rs.BadRequestException; import java.io.IOException; import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Optional; import java.util.UUID; import java.util.stream.Stream; -import javax.ws.rs.BadRequestException; - -import com.google.i18n.phonenumbers.NumberParseException; -import com.google.i18n.phonenumbers.PhoneNumberUtil; -import com.google.i18n.phonenumbers.Phonenumber; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/configuration/StubRegistrationServiceClientFactory.java b/service/src/test/java/org/whispersystems/textsecuregcm/configuration/StubRegistrationServiceClientFactory.java index bdb73cd52..dc8e5f69c 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/configuration/StubRegistrationServiceClientFactory.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/configuration/StubRegistrationServiceClientFactory.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.i18n.phonenumbers.PhoneNumberUtil; import com.google.i18n.phonenumbers.Phonenumber; import io.dropwizard.core.setup.Environment; +import jakarta.validation.constraints.NotNull; import java.io.IOException; import java.security.SecureRandom; import java.time.Duration; @@ -21,7 +22,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; -import javax.validation.constraints.NotNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.whispersystems.textsecuregcm.entities.RegistrationServiceSession; import org.whispersystems.textsecuregcm.registration.ClientType; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretsTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretsTest.java index d234af1b4..e0e62c88e 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretsTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/configuration/secrets/SecretsTest.java @@ -12,13 +12,13 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import com.fasterxml.jackson.databind.JsonMappingException; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.constraints.NotEmpty; import java.util.Base64; import java.util.Collections; import java.util.List; import java.util.Map; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.constraints.NotEmpty; import org.junit.jupiter.api.Test; import org.whispersystems.textsecuregcm.util.ExactlySize; import org.whispersystems.textsecuregcm.util.SystemMapper; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java index ba2ad0525..d0222bee3 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerTest.java @@ -29,6 +29,9 @@ import com.google.common.net.HttpHeaders; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.Response; import java.security.SecureRandom; import java.time.Duration; import java.time.Instant; @@ -40,9 +43,6 @@ import java.util.Optional; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2Test.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2Test.java index d2f94920f..f0b3e4fdf 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2Test.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/AccountControllerV2Test.java @@ -24,6 +24,12 @@ import com.google.i18n.phonenumbers.Phonenumber; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.nio.charset.StandardCharsets; import java.time.Clock; import java.time.Duration; @@ -41,12 +47,6 @@ import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nullable; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.apache.http.HttpStatus; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ArchiveControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ArchiveControllerTest.java index 2bde51e9c..5a45c020f 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ArchiveControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ArchiveControllerTest.java @@ -17,6 +17,11 @@ import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; import io.grpc.Status; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.nio.charset.StandardCharsets; import java.time.Clock; import java.time.Duration; @@ -31,11 +36,6 @@ import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.stream.IntStream; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.BeforeEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallLinkControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallLinkControllerTest.java index fe0a65c77..3e3498af3 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallLinkControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallLinkControllerTest.java @@ -13,8 +13,8 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerTest.java index 1a91349c4..cbc1c234c 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerTest.java @@ -16,13 +16,13 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Optional; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2Test.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2Test.java index 55f5d93ea..8e359401a 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2Test.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CallRoutingControllerV2Test.java @@ -5,9 +5,24 @@ package org.whispersystems.textsecuregcm.controllers; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; + import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.Optional; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -28,18 +43,6 @@ import org.whispersystems.textsecuregcm.storage.DynamicConfigurationManager; import org.whispersystems.textsecuregcm.tests.util.AuthHelper; import org.whispersystems.textsecuregcm.util.SystemMapper; import org.whispersystems.textsecuregcm.util.TestRemoteAddressFilterProvider; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Optional; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.*; @ExtendWith(DropwizardExtensionsSupport.class) class CallRoutingControllerV2Test { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CertificateControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CertificateControllerTest.java index 036b55b02..a75f3f242 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CertificateControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/CertificateControllerTest.java @@ -13,6 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.time.Clock; import java.time.Duration; @@ -21,7 +22,6 @@ import java.time.ZoneId; import java.time.temporal.ChronoUnit; import java.util.Base64; import java.util.stream.Stream; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.Test; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java index ce38cc2d1..f99010465 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java @@ -20,11 +20,11 @@ import com.google.common.net.HttpHeaders; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.time.Duration; import java.util.Optional; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DeviceControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DeviceControllerTest.java index ddb691dc5..635fbd1cb 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DeviceControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DeviceControllerTest.java @@ -26,6 +26,9 @@ import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; import io.lettuce.core.cluster.api.async.RedisAdvancedClusterAsyncCommands; import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -39,9 +42,6 @@ import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.stream.IntStream; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.RandomStringUtils; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DonationControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DonationControllerTest.java index 1e5ebeb62..5b79ba553 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DonationControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/DonationControllerTest.java @@ -15,15 +15,15 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.time.Clock; import java.time.Instant; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyControllerTest.java index d34b94464..88c3ff9e1 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyControllerTest.java @@ -29,6 +29,10 @@ import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; import io.grpc.Status; import io.grpc.StatusRuntimeException; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.Response; import java.io.UncheckedIOException; import java.time.Duration; import java.util.Collections; @@ -39,10 +43,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.stream.Stream; import javax.annotation.Nullable; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -53,11 +53,11 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.ArgumentCaptor; +import org.signal.keytransparency.client.CondensedTreeSearchResponse; import org.signal.keytransparency.client.E164SearchRequest; import org.signal.keytransparency.client.FullTreeHead; import org.signal.keytransparency.client.SearchProof; import org.signal.keytransparency.client.SearchResponse; -import org.signal.keytransparency.client.CondensedTreeSearchResponse; import org.signal.keytransparency.client.UpdateValue; import org.signal.libsignal.protocol.IdentityKey; import org.signal.libsignal.protocol.ecc.Curve; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeysControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeysControllerTest.java index 1e24923f2..ff43c19b4 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeysControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/KeysControllerTest.java @@ -25,6 +25,10 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -38,10 +42,6 @@ import java.util.OptionalInt; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.AfterEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/MessageControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/MessageControllerTest.java index 7b648ac98..e75986856 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/MessageControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/MessageControllerTest.java @@ -38,6 +38,11 @@ import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; import io.lettuce.core.cluster.api.sync.RedisAdvancedClusterCommands; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.ByteBuffer; @@ -61,11 +66,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.hamcrest.Matcher; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/PaymentsControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/PaymentsControllerTest.java index 06cf13770..739fcf154 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/PaymentsControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/PaymentsControllerTest.java @@ -13,11 +13,11 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; import java.math.BigDecimal; import java.util.List; import java.util.Map; import java.util.Optional; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java index 667612f61..b2aebaffb 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProfileControllerTest.java @@ -24,6 +24,12 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -41,12 +47,6 @@ import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executors; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; import org.assertj.core.api.Condition; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProvisioningControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProvisioningControllerTest.java index a16ce21d8..e4b98509b 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProvisioningControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ProvisioningControllerTest.java @@ -17,13 +17,12 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.Base64; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import org.apache.commons.lang3.RandomStringUtils; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java index e0c32033f..fcdbb6740 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RegistrationControllerTest.java @@ -18,6 +18,11 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.google.i18n.phonenumbers.PhoneNumberUtil; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.Response; import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -34,11 +39,6 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; import java.util.stream.Stream; import javax.annotation.Nullable; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; import org.apache.http.HttpStatus; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigControllerTest.java index 623d79959..6baab2041 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/RemoteConfigControllerTest.java @@ -16,6 +16,7 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.time.Instant; @@ -26,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; -import javax.ws.rs.core.Response; import org.assertj.core.api.Assertions; import org.assertj.core.api.InstanceOfAssertFactory; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureStorageControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureStorageControllerTest.java index d8f78458f..b450b5f42 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureStorageControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureStorageControllerTest.java @@ -12,7 +12,7 @@ import static org.whispersystems.textsecuregcm.util.MockUtils.randomSecretBytes; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java index 0bd8ecbf9..67c98f3ce 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery2ControllerTest.java @@ -11,6 +11,9 @@ import static org.whispersystems.textsecuregcm.util.MockUtils.randomSecretBytes; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; +import java.util.Map; +import java.util.stream.Collectors; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.extension.ExtendWith; import org.whispersystems.textsecuregcm.auth.ExternalServiceCredentialsGenerator; @@ -20,9 +23,6 @@ import org.whispersystems.textsecuregcm.storage.AccountsManager; import org.whispersystems.textsecuregcm.tests.util.AuthHelper; import org.whispersystems.textsecuregcm.util.MutableClock; import org.whispersystems.textsecuregcm.util.SystemMapper; -import javax.ws.rs.core.Response; -import java.util.Map; -import java.util.stream.Collectors; @ExtendWith(DropwizardExtensionsSupport.class) public class SecureValueRecovery2ControllerTest extends SecureValueRecoveryControllerBaseTest { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3ControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3ControllerTest.java index 6377f5c57..d7d1f79e1 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3ControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecovery3ControllerTest.java @@ -20,6 +20,9 @@ import static org.whispersystems.textsecuregcm.util.MockUtils.randomSecretBytes; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.Base64; import java.util.Collections; import java.util.Map; @@ -29,9 +32,6 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nullable; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecoveryControllerBaseTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecoveryControllerBaseTest.java index e80f30c7e..3a6e6cfed 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecoveryControllerBaseTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SecureValueRecoveryControllerBaseTest.java @@ -8,15 +8,15 @@ package org.whispersystems.textsecuregcm.controllers; import static org.junit.jupiter.api.Assertions.assertEquals; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.UUID; import java.util.concurrent.TimeUnit; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/StickerControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/StickerControllerTest.java index 57d636911..a91620681 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/StickerControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/StickerControllerTest.java @@ -14,8 +14,8 @@ import static org.mockito.Mockito.when; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.core.Response; import java.util.Base64; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SubscriptionControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SubscriptionControllerTest.java index 512a3b356..9eacb652f 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SubscriptionControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/SubscriptionControllerTest.java @@ -26,6 +26,8 @@ import com.stripe.model.PaymentIntent; import io.dropwizard.auth.AuthValueFactoryProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.Response; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.Clock; @@ -43,8 +45,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.function.Predicate; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Response; import org.assertj.core.api.InstanceOfAssertFactories; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/VerificationControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/VerificationControllerTest.java index dcbd56c9b..e182086e2 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/VerificationControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/VerificationControllerTest.java @@ -27,6 +27,9 @@ import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; import io.grpc.Status; import io.grpc.StatusRuntimeException; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Clock; @@ -39,9 +42,6 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.stream.Stream; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.Response; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.glassfish.jersey.server.ServerProperties; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilterTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilterTest.java index 031ef882e..152ab62e7 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilterTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/ExternalRequestFilterTest.java @@ -19,16 +19,16 @@ import io.grpc.Server; import io.grpc.Status; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.inprocess.InProcessServerBuilder; +import jakarta.servlet.DispatcherType; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.core.Response; import java.net.InetAddress; import java.util.Collections; import java.util.EnumSet; import java.util.Set; import java.util.concurrent.TimeUnit; -import javax.servlet.DispatcherType; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.client.Client; -import javax.ws.rs.core.Response; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterIntegrationTest.java index 1f8adf0d4..96ae5283f 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterIntegrationTest.java @@ -13,6 +13,12 @@ import io.dropwizard.core.Configuration; import io.dropwizard.core.setup.Environment; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; +import jakarta.servlet.DispatcherType; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; import java.io.IOException; import java.net.InetAddress; import java.net.URI; @@ -29,12 +35,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import javax.security.auth.Subject; -import javax.servlet.DispatcherType; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.client.Client; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; import org.eclipse.jetty.util.HostPort; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketListener; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterTest.java index fcde77eb1..278c6da96 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteAddressFilterTest.java @@ -10,10 +10,10 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import javax.servlet.FilterChain; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java index 77382640a..12a08dbdd 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RemoteDeprecationFilterTest.java @@ -22,14 +22,14 @@ import io.grpc.Server; import io.grpc.StatusRuntimeException; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.inprocess.InProcessServerBuilder; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.EnumMap; import java.util.Set; import java.util.stream.Stream; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -104,7 +104,7 @@ class RemoteDeprecationFilterTest { return new RemoteDeprecationFilter(dynamicConfigurationManager); } - + @ParameterizedTest @MethodSource void testFilter(final String userAgent, final boolean expectDeprecation) throws IOException, ServletException { @@ -180,5 +180,5 @@ class RemoteDeprecationFilterTest { Arguments.of("Signal-Desktop/8.0.0-beta.1", false), Arguments.of("Signal-iOS/8.0.0-beta.2", false)); } - + } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilterTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilterTest.java index 32038cc8d..98ad8ea06 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilterTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/RequestStatisticsFilterTest.java @@ -8,7 +8,7 @@ package org.whispersystems.textsecuregcm.filters; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import javax.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestContext; import org.junit.jupiter.api.Test; import org.whispersystems.textsecuregcm.metrics.TrafficSource; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilterTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilterTest.java index 33f9f276a..85e60dfe4 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilterTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/filters/TimestampResponseFilterTest.java @@ -12,12 +12,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import javax.servlet.FilterChain; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.core.MultivaluedMap; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.core.MultivaluedMap; import org.junit.jupiter.api.Test; import org.whispersystems.textsecuregcm.util.HeaderUtils; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitedByIpTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitedByIpTest.java index 5c30b7f08..90664448f 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitedByIpTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitedByIpTest.java @@ -15,10 +15,10 @@ import static org.mockito.Mockito.when; import com.google.common.net.HttpHeaders; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; import java.time.Duration; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.Response; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitersTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitersTest.java index dd819d8c1..a5732e64e 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitersTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/limits/RateLimitersTest.java @@ -12,12 +12,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.time.Duration; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import org.junit.jupiter.api.Test; import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicConfiguration; import org.whispersystems.textsecuregcm.configuration.dynamic.DynamicRateLimitPolicy; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapperTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapperTest.java index 1219e1924..87c0e2aa0 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapperTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/mappers/GrpcStatusRuntimeExceptionMapperTest.java @@ -12,12 +12,12 @@ import io.dropwizard.jersey.errors.ErrorMessage; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; import io.grpc.Status; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.stream.Stream; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.BeforeEach; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapperTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapperTest.java index c307f30bc..d5b668399 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapperTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/mappers/IOExceptionMapperTest.java @@ -7,10 +7,10 @@ package org.whispersystems.textsecuregcm.mappers; import static org.junit.jupiter.api.Assertions.assertEquals; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.util.concurrent.TimeoutException; import java.util.stream.Stream; -import javax.ws.rs.core.Response; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListenerIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListenerIntegrationTest.java index f3ad98db1..d261144db 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListenerIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsHttpChannelListenerIntegrationTest.java @@ -26,6 +26,20 @@ import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; +import jakarta.annotation.Priority; +import jakarta.servlet.DispatcherType; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.InternalServerErrorException; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.net.URI; import java.security.Principal; @@ -38,21 +52,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Priority; import javax.security.auth.Subject; -import javax.servlet.DispatcherType; -import javax.ws.rs.GET; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Priorities; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.client.Client; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.Request; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsRequestEventListenerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsRequestEventListenerTest.java index f93bd08b9..9ba5a76bb 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsRequestEventListenerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/metrics/MetricsRequestEventListenerTest.java @@ -22,9 +22,10 @@ import io.dropwizard.jersey.jackson.JacksonMessageBodyProvider; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; import java.io.IOException; import java.nio.ByteBuffer; -import java.security.Principal; import java.time.Duration; import java.util.Collections; import java.util.HashSet; @@ -33,8 +34,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; -import javax.ws.rs.GET; -import javax.ws.rs.Path; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.UpgradeRequest; @@ -52,9 +51,7 @@ import org.mockito.ArgumentCaptor; import org.whispersystems.textsecuregcm.filters.RemoteAddressFilter; import org.whispersystems.textsecuregcm.storage.ClientReleaseManager; import org.whispersystems.textsecuregcm.tests.util.TestPrincipal; -import org.whispersystems.websocket.ReusableAuth; import org.whispersystems.websocket.WebSocketResourceProvider; -import org.whispersystems.websocket.auth.WebSocketAuthenticator; import org.whispersystems.websocket.auth.WebsocketAuthValueFactoryProvider; import org.whispersystems.websocket.logging.WebsocketRequestLog; import org.whispersystems.websocket.messages.protobuf.ProtobufWebSocketMessageFactory; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/DynamoDbExtension.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/DynamoDbExtension.java index 42c3c88f1..8079fc358 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/DynamoDbExtension.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/DynamoDbExtension.java @@ -148,7 +148,8 @@ public class DynamoDbExtension implements BeforeEachCallback, AfterEachCallback try (ServerSocket serverSocket = new ServerSocket(0)) { port = serverSocket.getLocalPort(); } - server = ServerRunner.createServerFromCommandLineArgs(new String[]{"-inMemory", "-port", String.valueOf(port)}); + server = ServerRunner.createServerFromCommandLineArgs( + new String[]{"-disableTelemetry", "-inMemory", "-port", String.valueOf(port)}); server.start(); } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java index be9dcb51d..14d564d8c 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java @@ -9,10 +9,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import jakarta.ws.rs.ClientErrorException; import java.time.Duration; import java.time.Instant; import java.util.concurrent.CompletableFuture; -import javax.ws.rs.ClientErrorException; import org.assertj.core.api.Condition; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/SubscriptionsTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/SubscriptionsTest.java index 646625731..ca6773fc1 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/SubscriptionsTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/SubscriptionsTest.java @@ -6,12 +6,12 @@ package org.whispersystems.textsecuregcm.storage; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Fail.fail; import static org.whispersystems.textsecuregcm.storage.Subscriptions.GetResult.Type.FOUND; import static org.whispersystems.textsecuregcm.storage.Subscriptions.GetResult.Type.NOT_STORED; import static org.whispersystems.textsecuregcm.storage.Subscriptions.GetResult.Type.PASSWORD_MISMATCH; +import jakarta.ws.rs.ClientErrorException; import java.security.SecureRandom; import java.time.Duration; import java.time.Instant; @@ -21,7 +21,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.function.Consumer; import javax.annotation.Nonnull; -import javax.ws.rs.ClientErrorException; import org.assertj.core.api.Condition; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -31,7 +30,6 @@ import org.whispersystems.textsecuregcm.storage.Subscriptions.GetResult; import org.whispersystems.textsecuregcm.storage.Subscriptions.Record; import org.whispersystems.textsecuregcm.subscriptions.PaymentProvider; import org.whispersystems.textsecuregcm.subscriptions.ProcessorCustomer; -import org.whispersystems.textsecuregcm.util.CompletableFutureTestUtil; import org.whispersystems.textsecuregcm.util.TestRandomUtil; class SubscriptionsTest { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClientTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClientTest.java index 131eee029..693c2f750 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClientTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/subscriptions/BraintreeGraphqlClientTest.java @@ -15,6 +15,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import com.braintree.graphql.clientoperation.CreatePayPalOneTimePaymentMutation; +import jakarta.ws.rs.ServiceUnavailableException; import java.math.BigDecimal; import java.net.http.HttpHeaders; import java.net.http.HttpResponse; @@ -23,7 +24,6 @@ import java.util.Optional; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import javax.ws.rs.ServiceUnavailableException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.whispersystems.textsecuregcm.http.FaultTolerantHttpClient; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/util/E164Test.java b/service/src/test/java/org/whispersystems/textsecuregcm/util/E164Test.java index ba8d388f3..467e33723 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/util/E164Test.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/util/E164Test.java @@ -8,12 +8,12 @@ package org.whispersystems.textsecuregcm.util; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; import java.lang.reflect.Method; import java.util.Optional; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; import org.junit.jupiter.api.Test; public class E164Test { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilIntegrationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilIntegrationTest.java index 0722ca99c..7ba0fd2af 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilIntegrationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilIntegrationTest.java @@ -13,15 +13,15 @@ import io.dropwizard.core.Configuration; import io.dropwizard.core.setup.Environment; import io.dropwizard.testing.junit5.DropwizardAppExtension; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.core.Context; import java.net.InetAddress; import java.util.Arrays; import java.util.Set; import java.util.stream.Collectors; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.client.Client; -import javax.ws.rs.core.Context; import org.eclipse.jetty.util.HostPort; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilTest.java index cde298cd6..e540f8f83 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/util/HttpServletRequestUtilTest.java @@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/util/TestRemoteAddressFilterProvider.java b/service/src/test/java/org/whispersystems/textsecuregcm/util/TestRemoteAddressFilterProvider.java index 61ca1cd0e..9896808e0 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/util/TestRemoteAddressFilterProvider.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/util/TestRemoteAddressFilterProvider.java @@ -5,17 +5,18 @@ package org.whispersystems.textsecuregcm.util; -import org.whispersystems.textsecuregcm.filters.RemoteAddressFilter; -import javax.annotation.Priority; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; import java.io.IOException; +import org.whispersystems.textsecuregcm.filters.RemoteAddressFilter; /** * Adds the request property set by {@link RemoteAddressFilter} for test scenarios that depend on it, but do not have * access to a full {@code HttpServletRequest} pipline */ -@Priority(Integer.MIN_VALUE) // highest priority, since other filters might depend on it +@Priority(Priorities.AUTHENTICATION - 1) // highest priority, since other filters might depend on it public class TestRemoteAddressFilterProvider implements ContainerRequestFilter { private final String ip; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/util/VirtualExecutorServiceProviderTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/util/VirtualExecutorServiceProviderTest.java index 34cf890dd..2f848d4ab 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/util/VirtualExecutorServiceProviderTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/util/VirtualExecutorServiceProviderTest.java @@ -5,19 +5,19 @@ package org.whispersystems.textsecuregcm.util; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; import java.security.Principal; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ManagedAsync; import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; - @ExtendWith(DropwizardExtensionsSupport.class) class VirtualExecutorServiceProviderTest { diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapperTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapperTest.java index 58e52ca34..79168d475 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapperTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/util/logging/LoggingUnhandledExceptionMapperTest.java @@ -21,9 +21,12 @@ import io.dropwizard.jersey.DropwizardResourceConfig; import io.dropwizard.jersey.jackson.JacksonMessageBodyProvider; import io.dropwizard.testing.junit5.DropwizardExtensionsSupport; import io.dropwizard.testing.junit5.ResourceExtension; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.core.Response; import java.io.IOException; import java.nio.ByteBuffer; -import java.security.Principal; import java.time.Duration; import java.util.LinkedList; import java.util.List; @@ -36,10 +39,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.stream.Stream; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.Response; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.UpgradeRequest; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProvider.java b/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProvider.java index 00f08da26..e1e9e71ba 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProvider.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProvider.java @@ -7,6 +7,8 @@ package org.whispersystems.websocket; import com.google.common.annotations.VisibleForTesting; import com.google.common.net.HttpHeaders; import com.google.protobuf.UninitializedMessageException; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -22,8 +24,6 @@ import java.util.Optional; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.WebSocketListener; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java b/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java index d8a60d381..3858565fd 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketResourceProviderFactory.java @@ -7,11 +7,11 @@ package org.whispersystems.websocket; import static java.util.Optional.ofNullable; import io.dropwizard.jersey.jackson.JacksonMessageBodyProvider; +import jakarta.ws.rs.InternalServerErrorException; import java.io.IOException; import java.security.Principal; import java.util.Map; import java.util.Optional; -import javax.ws.rs.InternalServerErrorException; import org.apache.commons.lang3.StringUtils; import org.eclipse.jetty.websocket.server.JettyServerUpgradeRequest; import org.eclipse.jetty.websocket.server.JettyServerUpgradeResponse; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketSecurityContext.java b/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketSecurityContext.java index f079cf2fa..e1f63b731 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketSecurityContext.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/WebSocketSecurityContext.java @@ -4,12 +4,11 @@ */ package org.whispersystems.websocket; +import jakarta.ws.rs.core.SecurityContext; +import java.security.Principal; import org.whispersystems.websocket.session.ContextPrincipal; import org.whispersystems.websocket.session.WebSocketSessionContext; -import javax.ws.rs.core.SecurityContext; -import java.security.Principal; - public class WebSocketSecurityContext implements SecurityContext { private final ContextPrincipal principal; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/auth/WebsocketAuthValueFactoryProvider.java b/websocket-resources/src/main/java/org/whispersystems/websocket/auth/WebsocketAuthValueFactoryProvider.java index 776e20ac5..d7bfaf657 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/auth/WebsocketAuthValueFactoryProvider.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/auth/WebsocketAuthValueFactoryProvider.java @@ -5,14 +5,14 @@ package org.whispersystems.websocket.auth; import io.dropwizard.auth.Auth; +import jakarta.inject.Inject; +import jakarta.inject.Singleton; +import jakarta.ws.rs.WebApplicationException; import java.lang.reflect.ParameterizedType; import java.security.Principal; import java.util.Optional; import java.util.function.Function; import javax.annotation.Nullable; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.ws.rs.WebApplicationException; import org.glassfish.jersey.internal.inject.AbstractBinder; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.inject.AbstractValueParamProvider; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/configuration/WebSocketConfiguration.java b/websocket-resources/src/main/java/org/whispersystems/websocket/configuration/WebSocketConfiguration.java index fb8c8a957..b2c86ab96 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/configuration/WebSocketConfiguration.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/configuration/WebSocketConfiguration.java @@ -5,10 +5,10 @@ package org.whispersystems.websocket.configuration; import com.fasterxml.jackson.annotation.JsonProperty; -import javax.validation.Valid; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import org.whispersystems.websocket.logging.WebsocketRequestLoggerFactory; public class WebSocketConfiguration { diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketEvent.java b/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketEvent.java index 29cd5b098..2463fafff 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketEvent.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketEvent.java @@ -5,12 +5,11 @@ package org.whispersystems.websocket.logging; import ch.qos.logback.core.spi.DeferredProcessingAware; +import jakarta.ws.rs.core.MultivaluedMap; +import java.util.List; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ContainerResponse; -import javax.ws.rs.core.MultivaluedMap; -import java.util.List; - public class WebsocketEvent implements DeferredProcessingAware { public static final int SENTINEL = -1; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketRequestLoggerFactory.java b/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketRequestLoggerFactory.java index b8a17f823..0938e8404 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketRequestLoggerFactory.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/logging/WebsocketRequestLoggerFactory.java @@ -4,23 +4,21 @@ */ package org.whispersystems.websocket.logging; -import com.google.common.annotations.VisibleForTesting; -import org.slf4j.LoggerFactory; -import org.whispersystems.websocket.logging.layout.WebsocketEventLayoutFactory; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.Collections; -import java.util.List; - import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.LoggerContext; +import com.google.common.annotations.VisibleForTesting; import io.dropwizard.logging.common.AppenderFactory; import io.dropwizard.logging.common.ConsoleAppenderFactory; import io.dropwizard.logging.common.async.AsyncAppenderFactory; import io.dropwizard.logging.common.filter.LevelFilterFactory; import io.dropwizard.logging.common.filter.NullLevelFilterFactory; import io.dropwizard.logging.common.layout.LayoutFactory; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import java.util.Collections; +import java.util.List; +import org.slf4j.LoggerFactory; +import org.whispersystems.websocket.logging.layout.WebsocketEventLayoutFactory; public class WebsocketRequestLoggerFactory { diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContainerRequestValueFactory.java b/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContainerRequestValueFactory.java index b57ad4ed1..942297c00 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContainerRequestValueFactory.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContainerRequestValueFactory.java @@ -4,11 +4,10 @@ */ package org.whispersystems.websocket.session; +import jakarta.ws.rs.core.SecurityContext; import org.glassfish.jersey.server.ContainerRequest; import org.whispersystems.websocket.WebSocketSecurityContext; -import javax.ws.rs.core.SecurityContext; - public class WebSocketSessionContainerRequestValueFactory { private final ContainerRequest request; diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContextValueFactoryProvider.java b/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContextValueFactoryProvider.java index 511434524..cec4f0774 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContextValueFactoryProvider.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/session/WebSocketSessionContextValueFactoryProvider.java @@ -4,6 +4,10 @@ */ package org.whispersystems.websocket.session; +import jakarta.inject.Inject; +import jakarta.inject.Singleton; +import java.util.function.Function; +import javax.annotation.Nullable; import org.glassfish.jersey.internal.inject.AbstractBinder; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.internal.inject.AbstractValueParamProvider; @@ -11,11 +15,6 @@ import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractor import org.glassfish.jersey.server.model.Parameter; import org.glassfish.jersey.server.spi.internal.ValueParamProvider; -import javax.annotation.Nullable; -import javax.inject.Inject; -import javax.inject.Singleton; -import java.util.function.Function; - @Singleton public class WebSocketSessionContextValueFactoryProvider extends AbstractValueParamProvider { diff --git a/websocket-resources/src/main/java/org/whispersystems/websocket/setup/WebSocketEnvironment.java b/websocket-resources/src/main/java/org/whispersystems/websocket/setup/WebSocketEnvironment.java index f344a493d..7d5d79f88 100644 --- a/websocket-resources/src/main/java/org/whispersystems/websocket/setup/WebSocketEnvironment.java +++ b/websocket-resources/src/main/java/org/whispersystems/websocket/setup/WebSocketEnvironment.java @@ -5,8 +5,10 @@ package org.whispersystems.websocket.setup; import com.fasterxml.jackson.databind.ObjectMapper; -import io.dropwizard.jersey.DropwizardResourceConfig; import io.dropwizard.core.setup.Environment; +import io.dropwizard.jersey.DropwizardResourceConfig; +import jakarta.validation.Validator; +import java.security.Principal; import java.time.Duration; import org.glassfish.jersey.server.ResourceConfig; import org.whispersystems.websocket.auth.WebSocketAuthenticator; @@ -15,9 +17,6 @@ import org.whispersystems.websocket.logging.WebsocketRequestLog; import org.whispersystems.websocket.messages.WebSocketMessageFactory; import org.whispersystems.websocket.messages.protobuf.ProtobufWebSocketMessageFactory; -import javax.validation.Validator; -import java.security.Principal; - public class WebSocketEnvironment { private final ResourceConfig jerseyConfig; diff --git a/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderFactoryTest.java b/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderFactoryTest.java index c11f3ace2..0a2140984 100644 --- a/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderFactoryTest.java +++ b/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderFactoryTest.java @@ -7,7 +7,6 @@ package org.whispersystems.websocket; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -15,11 +14,10 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import io.dropwizard.jersey.DropwizardResourceConfig; +import jakarta.servlet.http.HttpServletRequest; import java.io.IOException; import java.security.Principal; -import java.util.Optional; import javax.security.auth.Subject; -import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.server.JettyServerUpgradeRequest; import org.eclipse.jetty.websocket.server.JettyServerUpgradeResponse; diff --git a/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderTest.java b/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderTest.java index 42250d29b..e4a8f5b9a 100644 --- a/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderTest.java +++ b/websocket-resources/src/test/java/org/whispersystems/websocket/WebSocketResourceProviderTest.java @@ -22,6 +22,21 @@ import com.google.protobuf.ByteString; import io.dropwizard.auth.Auth; import io.dropwizard.jersey.DropwizardResourceConfig; import io.dropwizard.jersey.jackson.JacksonMessageBodyProvider; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotEmpty; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedHashMap; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import java.io.OutputStream; import java.nio.ByteBuffer; import java.security.Principal; @@ -32,21 +47,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import javax.validation.Valid; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; import org.eclipse.jetty.websocket.api.CloseStatus; import org.eclipse.jetty.websocket.api.RemoteEndpoint; import org.eclipse.jetty.websocket.api.Session; diff --git a/websocket-resources/src/test/java/org/whispersystems/websocket/logging/WebSocketRequestLogTest.java b/websocket-resources/src/test/java/org/whispersystems/websocket/logging/WebSocketRequestLogTest.java index cb8ed8590..1a38968f6 100644 --- a/websocket-resources/src/test/java/org/whispersystems/websocket/logging/WebSocketRequestLogTest.java +++ b/websocket-resources/src/test/java/org/whispersystems/websocket/logging/WebSocketRequestLogTest.java @@ -12,13 +12,13 @@ import ch.qos.logback.core.OutputStreamAppender; import ch.qos.logback.core.spi.DeferredProcessingAware; import com.google.common.net.HttpHeaders; import io.dropwizard.logging.common.AbstractOutputStreamAppenderFactory; +import jakarta.ws.rs.core.Response; import java.io.ByteArrayOutputStream; import java.net.URI; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; -import javax.ws.rs.core.Response; import org.glassfish.jersey.internal.MapPropertiesDelegate; import org.glassfish.jersey.server.ContainerRequest; import org.glassfish.jersey.server.ContainerResponse;