From 04fd34fd2241503b170c2d8d0062a2bf60875d3c Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Thu, 2 Jul 2026 00:52:21 -0500 Subject: [PATCH] fix: register persisted enums for native-image reflection (#1695) Registers persisted enums (and Cognito's VerificationCode) for reflection so the native image can deserialize persisted state on restart. Covers cognito, eks, elasticache, eventbridge, memorydb, pipes, and rds. --- .../floci/services/cognito/verification/VerificationCode.java | 3 +++ .../hectorvent/floci/services/eks/model/ClusterStatus.java | 3 +++ .../hectorvent/floci/services/elasticache/model/AuthMode.java | 3 +++ .../floci/services/elasticache/model/CacheClusterStatus.java | 3 +++ .../services/elasticache/model/ReplicationGroupStatus.java | 3 +++ .../floci/services/eventbridge/model/ArchiveState.java | 3 +++ .../floci/services/eventbridge/model/ReplayState.java | 3 +++ .../hectorvent/floci/services/eventbridge/model/RuleState.java | 3 +++ .../hectorvent/floci/services/memorydb/model/AuthMode.java | 3 +++ .../floci/services/memorydb/model/ClusterStatus.java | 3 +++ .../hectorvent/floci/services/pipes/model/DesiredState.java | 3 +++ .../hectorvent/floci/services/pipes/model/PipeState.java | 3 +++ .../hectorvent/floci/services/rds/model/DatabaseEngine.java | 3 +++ .../hectorvent/floci/services/rds/model/DbInstanceStatus.java | 3 +++ 14 files changed, 42 insertions(+) diff --git a/src/main/java/io/github/hectorvent/floci/services/cognito/verification/VerificationCode.java b/src/main/java/io/github/hectorvent/floci/services/cognito/verification/VerificationCode.java index 6353e3a9b0..4e4a8134f0 100644 --- a/src/main/java/io/github/hectorvent/floci/services/cognito/verification/VerificationCode.java +++ b/src/main/java/io/github/hectorvent/floci/services/cognito/verification/VerificationCode.java @@ -2,6 +2,7 @@ package io.github.hectorvent.floci.services.cognito.verification; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import io.quarkus.runtime.annotations.RegisterForReflection; import java.time.Instant; @@ -10,8 +11,10 @@ import java.time.Instant; * password reset, MFA SMS, attribute verification). The actual code is hashed * with a per-code salt so dumps and storage snapshots cannot reveal valid codes. */ +@RegisterForReflection public final class VerificationCode { + @RegisterForReflection public enum Purpose { SIGNUP_CONFIRMATION, PASSWORD_RESET, diff --git a/src/main/java/io/github/hectorvent/floci/services/eks/model/ClusterStatus.java b/src/main/java/io/github/hectorvent/floci/services/eks/model/ClusterStatus.java index 027f9c7a9c..653c22b9e0 100644 --- a/src/main/java/io/github/hectorvent/floci/services/eks/model/ClusterStatus.java +++ b/src/main/java/io/github/hectorvent/floci/services/eks/model/ClusterStatus.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.eks.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum ClusterStatus { CREATING, ACTIVE, DELETING, FAILED, UPDATING, DEGRADED } diff --git a/src/main/java/io/github/hectorvent/floci/services/elasticache/model/AuthMode.java b/src/main/java/io/github/hectorvent/floci/services/elasticache/model/AuthMode.java index 332c0082d9..f7bb0f657a 100644 --- a/src/main/java/io/github/hectorvent/floci/services/elasticache/model/AuthMode.java +++ b/src/main/java/io/github/hectorvent/floci/services/elasticache/model/AuthMode.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.elasticache.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum AuthMode { IAM, PASSWORD, NO_AUTH } diff --git a/src/main/java/io/github/hectorvent/floci/services/elasticache/model/CacheClusterStatus.java b/src/main/java/io/github/hectorvent/floci/services/elasticache/model/CacheClusterStatus.java index b417ac75d5..80db4647eb 100644 --- a/src/main/java/io/github/hectorvent/floci/services/elasticache/model/CacheClusterStatus.java +++ b/src/main/java/io/github/hectorvent/floci/services/elasticache/model/CacheClusterStatus.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.elasticache.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum CacheClusterStatus { AVAILABLE, CREATING, DELETING } diff --git a/src/main/java/io/github/hectorvent/floci/services/elasticache/model/ReplicationGroupStatus.java b/src/main/java/io/github/hectorvent/floci/services/elasticache/model/ReplicationGroupStatus.java index da9491aea3..bd59857129 100644 --- a/src/main/java/io/github/hectorvent/floci/services/elasticache/model/ReplicationGroupStatus.java +++ b/src/main/java/io/github/hectorvent/floci/services/elasticache/model/ReplicationGroupStatus.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.elasticache.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum ReplicationGroupStatus { CREATING, AVAILABLE, DELETING } diff --git a/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ArchiveState.java b/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ArchiveState.java index 367c921abe..a74e3c4545 100644 --- a/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ArchiveState.java +++ b/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ArchiveState.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.eventbridge.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum ArchiveState { ENABLED, DISABLED, CREATING, UPDATING, DELETING } diff --git a/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ReplayState.java b/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ReplayState.java index e7ad579d4e..499ed7a55a 100644 --- a/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ReplayState.java +++ b/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/ReplayState.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.eventbridge.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum ReplayState { STARTING, RUNNING, CANCELLING, COMPLETED, CANCELLED, FAILED } diff --git a/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/RuleState.java b/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/RuleState.java index cc57a4c0fc..a5d71d07dd 100644 --- a/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/RuleState.java +++ b/src/main/java/io/github/hectorvent/floci/services/eventbridge/model/RuleState.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.eventbridge.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum RuleState { ENABLED, DISABLED diff --git a/src/main/java/io/github/hectorvent/floci/services/memorydb/model/AuthMode.java b/src/main/java/io/github/hectorvent/floci/services/memorydb/model/AuthMode.java index 1d8e47e0c3..e74933c19e 100644 --- a/src/main/java/io/github/hectorvent/floci/services/memorydb/model/AuthMode.java +++ b/src/main/java/io/github/hectorvent/floci/services/memorydb/model/AuthMode.java @@ -1,5 +1,7 @@ package io.github.hectorvent.floci.services.memorydb.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + /** * Authentication type of a MemoryDB {@link User}. Mirrors the {@code Type} field of the * real API's {@code AuthenticationMode}/{@code Authentication} structures, whose wire @@ -8,6 +10,7 @@ package io.github.hectorvent.floci.services.memorydb.model; *

A cluster does not carry an auth mode of its own — it references an ACL, and the * effective authentication is determined by the auth modes of the users in that ACL. */ +@RegisterForReflection public enum AuthMode { PASSWORD("password"), IAM("iam"), diff --git a/src/main/java/io/github/hectorvent/floci/services/memorydb/model/ClusterStatus.java b/src/main/java/io/github/hectorvent/floci/services/memorydb/model/ClusterStatus.java index 0c5f1e0d49..376b7a6eb6 100644 --- a/src/main/java/io/github/hectorvent/floci/services/memorydb/model/ClusterStatus.java +++ b/src/main/java/io/github/hectorvent/floci/services/memorydb/model/ClusterStatus.java @@ -1,9 +1,12 @@ package io.github.hectorvent.floci.services.memorydb.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + /** * MemoryDB cluster lifecycle states. The wire value is lowercase * (e.g. {@code available}) to match the real AWS MemoryDB API. */ +@RegisterForReflection public enum ClusterStatus { CREATING("creating"), AVAILABLE("available"), diff --git a/src/main/java/io/github/hectorvent/floci/services/pipes/model/DesiredState.java b/src/main/java/io/github/hectorvent/floci/services/pipes/model/DesiredState.java index ed731e00a4..129effdc3a 100644 --- a/src/main/java/io/github/hectorvent/floci/services/pipes/model/DesiredState.java +++ b/src/main/java/io/github/hectorvent/floci/services/pipes/model/DesiredState.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.pipes.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum DesiredState { RUNNING, STOPPED diff --git a/src/main/java/io/github/hectorvent/floci/services/pipes/model/PipeState.java b/src/main/java/io/github/hectorvent/floci/services/pipes/model/PipeState.java index 42cf7e5d7b..cadfce12a3 100644 --- a/src/main/java/io/github/hectorvent/floci/services/pipes/model/PipeState.java +++ b/src/main/java/io/github/hectorvent/floci/services/pipes/model/PipeState.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.pipes.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum PipeState { RUNNING, STOPPED, diff --git a/src/main/java/io/github/hectorvent/floci/services/rds/model/DatabaseEngine.java b/src/main/java/io/github/hectorvent/floci/services/rds/model/DatabaseEngine.java index 161d729279..20244d264a 100644 --- a/src/main/java/io/github/hectorvent/floci/services/rds/model/DatabaseEngine.java +++ b/src/main/java/io/github/hectorvent/floci/services/rds/model/DatabaseEngine.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.rds.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum DatabaseEngine { POSTGRES, MYSQL, MARIADB; diff --git a/src/main/java/io/github/hectorvent/floci/services/rds/model/DbInstanceStatus.java b/src/main/java/io/github/hectorvent/floci/services/rds/model/DbInstanceStatus.java index 131eb8978b..597804b462 100644 --- a/src/main/java/io/github/hectorvent/floci/services/rds/model/DbInstanceStatus.java +++ b/src/main/java/io/github/hectorvent/floci/services/rds/model/DbInstanceStatus.java @@ -1,5 +1,8 @@ package io.github.hectorvent.floci.services.rds.model; +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection public enum DbInstanceStatus { CREATING, AVAILABLE, DELETING, REBOOTING, MODIFYING }