diff --git a/local-environment/application.yml b/local-environment/application.yml index e69d34a2..b850596d 100644 --- a/local-environment/application.yml +++ b/local-environment/application.yml @@ -141,4 +141,4 @@ spring: password: postgres config: activate: - on-profile: default \ No newline at end of file + on-profile: database \ No newline at end of file diff --git a/src/main/kotlin/com/vauthenticator/server/account/AccountConfig.kt b/src/main/kotlin/com/vauthenticator/server/account/AccountConfig.kt index 6bb6b0d0..a8e18a28 100644 --- a/src/main/kotlin/com/vauthenticator/server/account/AccountConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/account/AccountConfig.kt @@ -56,7 +56,7 @@ class AccountConfig { @Bean("accountRepository") - @Profile("aws") + @Profile("database") fun jdbcAccountRepository( jdbcTemplate: JdbcTemplate ) = JdbcAccountRepository(jdbcTemplate) @@ -68,7 +68,7 @@ class AccountConfig { havingValue = "false", matchIfMissing = true ) - @Profile("!aws") + @Profile("dynamo") fun dynamoDbAccountRepository( mapper: ObjectMapper, dynamoDbClient: DynamoDbClient, @@ -85,7 +85,7 @@ class AccountConfig { havingValue = "true", matchIfMissing = false ) - @Profile("!aws") + @Profile("dynamo") fun cachedDynamoDbAccountRepository( mapper: ObjectMapper, dynamoDbClient: DynamoDbClient, @@ -106,7 +106,7 @@ class AccountConfig { havingValue = "true", matchIfMissing = false ) - @Profile("!aws") + @Profile("dynamo") fun accountCacheOperation( redisTemplate: RedisTemplate<*, *>, @Value("\${vauthenticator.dynamo-db.account.cache.ttl}") ttl: Duration, diff --git a/src/main/kotlin/com/vauthenticator/server/config/AuthorizationServerConfig.kt b/src/main/kotlin/com/vauthenticator/server/config/AuthorizationServerConfig.kt index 61f3dd62..64517074 100644 --- a/src/main/kotlin/com/vauthenticator/server/config/AuthorizationServerConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/config/AuthorizationServerConfig.kt @@ -98,14 +98,14 @@ class AuthorizationServerConfig { } @Bean("oAuth2AuthorizationService") - @Profile("!aws") + @Profile("!database") fun redisOAuth2AuthorizationService(redisTemplate: RedisTemplate): OAuth2AuthorizationService { return RedisOAuth2AuthorizationService(redisTemplate) } @Bean("oAuth2AuthorizationService") - @Profile("aws") + @Profile("database") fun jdbcOAuth2AuthorizationService( jdbcTemplate : JdbcTemplate, registeredClientRepository : RegisteredClientRepository diff --git a/src/main/kotlin/com/vauthenticator/server/keys/KeyConfig.kt b/src/main/kotlin/com/vauthenticator/server/keys/KeyConfig.kt index d32bc435..d02d1e91 100644 --- a/src/main/kotlin/com/vauthenticator/server/keys/KeyConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/keys/KeyConfig.kt @@ -22,11 +22,11 @@ import java.util.* @Configuration(proxyBeanMethods = false) class KeyConfig { - @Profile("aws") + @Profile("kms") @Bean("keyGenerator") fun kmsKeyGenerator(kmsClient: KmsClient): KeyGenerator = KmsKeyGenerator(kmsClient) - @Profile("!aws") + @Profile("!kms") @Bean("keyGenerator") fun bouncyCastleKeyGenerator(kmsClient: KmsClient): KeyGenerator = BouncyCastleKeyGenerator( KeyCryptographicOperations( @@ -34,11 +34,11 @@ class KeyConfig { ) ) - @Profile("aws") + @Profile("kms") @Bean("keyDecrypter") fun kmsKeyDecrypter(kmsClient: KmsClient): KeyDecrypter = KmsKeyDecrypter(kmsClient) - @Profile("!aws") + @Profile("!kms") @Bean("keyDecrypter") fun bouncyCastleKeyDecrypter(): KeyDecrypter = BouncyCastleKeyDecrypter( KeyCryptographicOperations( @@ -47,7 +47,7 @@ class KeyConfig { ) @Bean("keyStorage") - @Profile("aws") + @Profile("dynamo") fun dynamoDbKeyStorage( clock: Clock, dynamoDbClient: DynamoDbClient, @@ -56,7 +56,7 @@ class KeyConfig { ) = DynamoDbKeyStorage(clock, dynamoDbClient, signatureTableName, mfaTableName) @Bean("keyStorage") - @Profile("!aws") + @Profile("database") fun jdbcKeyStorage(jdbcTemplate: JdbcTemplate, clock: Clock) = JdbcKeyStorage(jdbcTemplate, clock) @Bean("keyRepository") diff --git a/src/main/kotlin/com/vauthenticator/server/keys/adapter/local/KeyInitJob.kt b/src/main/kotlin/com/vauthenticator/server/keys/adapter/local/KeyInitJob.kt index 90c5f9c4..dd7f6459 100644 --- a/src/main/kotlin/com/vauthenticator/server/keys/adapter/local/KeyInitJob.kt +++ b/src/main/kotlin/com/vauthenticator/server/keys/adapter/local/KeyInitJob.kt @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Profile import org.springframework.stereotype.Service @Service -@Profile("!aws") +@Profile("!kms") class KeyInitJob(private val keyRepository: KeyRepository) : ApplicationRunner { override fun run(args: ApplicationArguments?) { diff --git a/src/main/kotlin/com/vauthenticator/server/mfa/MfaConfig.kt b/src/main/kotlin/com/vauthenticator/server/mfa/MfaConfig.kt index 70b0aa77..b7f8d048 100644 --- a/src/main/kotlin/com/vauthenticator/server/mfa/MfaConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/mfa/MfaConfig.kt @@ -35,7 +35,7 @@ import java.util.* class MfaConfig { @Bean("mfaAccountMethodsRepository") - @Profile("!aws") + @Profile("dynamo") fun dynamoDbMfaAccountMethodsRepository( keyRepository: KeyRepository, dynamoDbClient: DynamoDbClient, @@ -52,7 +52,7 @@ class MfaConfig { ) { MfaDeviceId(UUID.randomUUID().toString()) } @Bean("mfaAccountMethodsRepository") - @Profile("aws") + @Profile("database") fun jdbcMfaAccountMethodsRepository( keyRepository: KeyRepository, jdbcTemplate: JdbcTemplate, diff --git a/src/main/kotlin/com/vauthenticator/server/oauth2/clientapp/ClientApplicationConfig.kt b/src/main/kotlin/com/vauthenticator/server/oauth2/clientapp/ClientApplicationConfig.kt index a55e5215..6ecdfda8 100644 --- a/src/main/kotlin/com/vauthenticator/server/oauth2/clientapp/ClientApplicationConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/oauth2/clientapp/ClientApplicationConfig.kt @@ -29,7 +29,7 @@ class ClientApplicationConfig { @Bean("clientApplicationRepository") - @Profile("aws") + @Profile("database") fun jdbcClientApplicationRepository(jdbcTemplate: JdbcTemplate, objectMapper: ObjectMapper) : ClientApplicationRepository = JdbcClientApplicationRepository(jdbcTemplate, objectMapper) @@ -39,7 +39,7 @@ class ClientApplicationConfig { havingValue = "false", matchIfMissing = true ) - @Profile("!aws") + @Profile("dynamo") fun dynamoDbClientApplicationRepository( dynamoDbClient: DynamoDbClient, @Value("\${vauthenticator.dynamo-db.client-application.table-name}") clientAppTableName: String @@ -51,7 +51,7 @@ class ClientApplicationConfig { havingValue = "true", matchIfMissing = false ) - @Profile("!aws") + @Profile("dynamo") fun cachedClientApplicationRepository( dynamoDbClient: DynamoDbClient, clientApplicationCacheOperation: CacheOperation, @@ -70,7 +70,7 @@ class ClientApplicationConfig { havingValue = "true", matchIfMissing = false ) - @Profile("!aws") + @Profile("dynamo") fun clientApplicationCacheOperation( redisTemplate: RedisTemplate<*, *>, @Value("\${vauthenticator.dynamo-db.client-application.cache.ttl}") ttl: Duration, diff --git a/src/main/kotlin/com/vauthenticator/server/role/PermissionConfig.kt b/src/main/kotlin/com/vauthenticator/server/role/PermissionConfig.kt index d3461e45..d6780781 100644 --- a/src/main/kotlin/com/vauthenticator/server/role/PermissionConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/role/PermissionConfig.kt @@ -23,7 +23,7 @@ import java.time.Duration class PermissionConfig { @Bean("roleRepository") - @Profile("aws") + @Profile("database") fun jdbcRoleRepository( jdbcTemplate: JdbcTemplate, @Value("\${vauthenticator.dynamo-db.role.protected-from-delete}") protectedRoleFromDeletion: List @@ -35,7 +35,7 @@ class PermissionConfig { havingValue = "false", matchIfMissing = true ) - @Profile("!aws") + @Profile("dynamo") fun dynamoDbRoleRepository( dynamoDbClient: DynamoDbClient, @Value("\${vauthenticator.dynamo-db.role.table-name}") roleTableName: String, @@ -49,7 +49,7 @@ class PermissionConfig { havingValue = "true", matchIfMissing = false ) - @Profile("!aws") + @Profile("dynamo") fun cachedDynamoDbRoleRepository( mapper: ObjectMapper, roleCacheOperation: CacheOperation, @@ -68,7 +68,7 @@ class PermissionConfig { havingValue = "true", matchIfMissing = false ) - @Profile("!aws") + @Profile("dynamo") fun roleCacheOperation( redisTemplate: RedisTemplate<*, *>, @Value("\${vauthenticator.dynamo-db.role.cache.ttl}") ttl: Duration, diff --git a/src/main/kotlin/com/vauthenticator/server/ticket/TicketConfig.kt b/src/main/kotlin/com/vauthenticator/server/ticket/TicketConfig.kt index 916ab68d..3e501db3 100644 --- a/src/main/kotlin/com/vauthenticator/server/ticket/TicketConfig.kt +++ b/src/main/kotlin/com/vauthenticator/server/ticket/TicketConfig.kt @@ -20,7 +20,7 @@ import java.util.* class TicketConfig { @Bean("ticketRepository") - @Profile("!aws") + @Profile("dynamo") fun dynamoDbTicketRepository( @Value("\${vauthenticator.dynamo-db.ticket.table-name}") tableName: String, dynamoDbClient: DynamoDbClient @@ -28,7 +28,7 @@ class TicketConfig { @Bean("ticketRepository") - @Profile("aws") + @Profile("database") fun jdbCTicketRepository( jdbcTemplate: JdbcTemplate, objectMapper: ObjectMapper