mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(rds): accept SessionPinningFilters on non-MySQL DB proxies (#8606)
This commit is contained in:
1 parent
5f77b841a2
commit
bda82cc98d
3 files changed
+39
-12
No files matched your search
@@ -9369,6 +9369,35 @@ class RdsServiceTest {
|
||||
assertEquals(1, retry.getTargets().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void postgresqlProxyAcceptsSessionPinningFilters() {
|
||||
// AWS documents the filter as effective only on MySQL, not as rejected elsewhere.
|
||||
when(config.services().rds().mock()).thenReturn(true);
|
||||
rdsService.createDbCluster("cluster1", "aurora-postgresql", "16.3",
|
||||
"admin", "secret", "app", false, null);
|
||||
rdsService.createDbProxy("pg-proxy", "POSTGRESQL", true, false,
|
||||
PROXY_ROLE_ARN, PROXY_SUBNET_IDS, List.of(), PROXY_AUTH, Map.of());
|
||||
|
||||
rdsService.configureDbProxyTargetGroup("pg-proxy", "default", 80, 40, 120, null,
|
||||
List.of("EXCLUDE_VARIABLE_SETS"), "us-east-1");
|
||||
assertEquals(List.of("EXCLUDE_VARIABLE_SETS"), rdsService
|
||||
.describeDbProxyTargetGroups("pg-proxy").iterator().next()
|
||||
.getSessionPinningFilters());
|
||||
|
||||
DbProxyTargetGroup reconciled = rdsService.reconcileDbProxyTargetGroup(
|
||||
"pg-proxy", "default", List.of("cluster1"), List.of(),
|
||||
80, 40, 120, null, List.of("EXCLUDE_VARIABLE_SETS"), "us-east-1");
|
||||
assertEquals(List.of("EXCLUDE_VARIABLE_SETS"), reconciled.getSessionPinningFilters());
|
||||
|
||||
AwsException invalid = assertThrows(AwsException.class, () ->
|
||||
rdsService.configureDbProxyTargetGroup("pg-proxy", "default", 80, 40, 120,
|
||||
null, List.of("INCLUDE_ALL"), "us-east-1"));
|
||||
assertEquals("InvalidParameterValue", invalid.getErrorCode());
|
||||
assertEquals(List.of("EXCLUDE_VARIABLE_SETS"), rdsService
|
||||
.describeDbProxyTargetGroups("pg-proxy").iterator().next()
|
||||
.getSessionPinningFilters());
|
||||
}
|
||||
|
||||
@Test
|
||||
void targetGroupReconciliationValidatesBeforeMutation() {
|
||||
when(config.services().rds().mock()).thenReturn(true);
|
||||
@@ -9382,7 +9411,7 @@ class RdsServiceTest {
|
||||
AwsException invalid = assertThrows(AwsException.class, () ->
|
||||
rdsService.reconcileDbProxyTargetGroup(
|
||||
"app-proxy", "default", List.of("cluster1"), List.of(),
|
||||
80, 40, 120, null, List.of("EXCLUDE_VARIABLE_SETS"), "us-east-1"));
|
||||
80, 40, 120, null, List.of("INCLUDE_ALL"), "us-east-1"));
|
||||
|
||||
assertEquals("InvalidParameterValue", invalid.getErrorCode());
|
||||
DbProxyTargetGroup after = rdsService.describeDbProxyTargetGroups("app-proxy")
|
||||
|
||||
Reference in new issue
Block a user