From c2030e5859b3e052111f9d1ea3da954d3d38dda7 Mon Sep 17 00:00:00 2001 From: Weimin Yu Date: Thu, 9 Jan 2025 15:01:32 -0500 Subject: [PATCH] Fix keyring in BEAM pipeline (#2632) SecretManager based keyring not included in keyring bindings, resulting in runtime failure. We should simply keyring bindings. There is no use case for multiple implementations. See b/388835696. --- .../google/registry/persistence/PersistenceModule.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/google/registry/persistence/PersistenceModule.java b/core/src/main/java/google/registry/persistence/PersistenceModule.java index 37fefa39f..b6f2144b6 100644 --- a/core/src/main/java/google/registry/persistence/PersistenceModule.java +++ b/core/src/main/java/google/registry/persistence/PersistenceModule.java @@ -36,6 +36,7 @@ import dagger.Provides; import google.registry.config.RegistryConfig.Config; import google.registry.keyring.KeyringModule; import google.registry.keyring.api.DummyKeyringModule; +import google.registry.keyring.secretmanager.SecretManagerKeyringModule; import google.registry.persistence.transaction.CloudSqlCredentialSupplier; import google.registry.persistence.transaction.JpaTransactionManager; import google.registry.persistence.transaction.JpaTransactionManagerImpl; @@ -66,7 +67,14 @@ import javax.inject.Singleton; import org.hibernate.cfg.Environment; /** Dagger module class for the persistence layer. */ -@Module(includes = {KeyringModule.class, SecretManagerModule.class, DummyKeyringModule.class}) +// TODO(b/388835696): Use SecreteManagerKeyring in all environments and drop the `includes` below. +@Module( + includes = { + KeyringModule.class, + SecretManagerModule.class, + DummyKeyringModule.class, + SecretManagerKeyringModule.class + }) public abstract class PersistenceModule { // This name must be the same as the one defined in persistence.xml.