mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(redshift): read ARNs with '!' in a secret name or ':' in an IAM path (#7112)
This commit is contained in:
1 parent
d2f0455cd9
commit
bc237ae980
4 files changed
+25
-2
No files matched your search
+13
@@ -144,6 +144,19 @@ class RedshiftDestinationValidatorTest {
|
||||
assertTrue(messageOf(dest).contains("secretsManagerConfiguration.secretARN"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void secretArnAcceptsEveryCharacterTheModelAllows() throws Exception {
|
||||
RedshiftDestination dest = valid();
|
||||
dest.setUsername(null);
|
||||
dest.setPassword(null);
|
||||
RedshiftDestination.SecretsManagerConfiguration secrets = new RedshiftDestination.SecretsManagerConfiguration();
|
||||
secrets.setEnabled(true);
|
||||
secrets.setSecretArn("arn:aws:secretsmanager:us-east-1:000000000000:secret:team/db!creds-AbCdEf");
|
||||
dest.setSecretsManagerConfiguration(secrets);
|
||||
|
||||
assertDoesNotThrow(() -> RedshiftDestinationValidator.validateConfiguration(dest, SHAPE));
|
||||
}
|
||||
|
||||
@Test
|
||||
void invalidBackupModeAndDisablingBackupAreRejected() throws Exception {
|
||||
RedshiftDestination dest = valid();
|
||||
|
||||
+9
@@ -42,6 +42,15 @@ class RedshiftIamDbUserResolverTest {
|
||||
assertEquals("IAM:alice", resolver.resolveDbUser("auth"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void userPathContainingAColonStillYieldsTheUserName() {
|
||||
when(accountResolver.extractAccessKeyId("auth")).thenReturn("AKIA123");
|
||||
when(iamService.resolveCallerArn("AKIA123"))
|
||||
.thenReturn(Optional.of("arn:aws:iam::000000000000:user/team:x/alice"));
|
||||
|
||||
assertEquals("IAM:alice", resolver.resolveDbUser("auth"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void mapsAssumedRoleArnToIamrPrefix() {
|
||||
when(accountResolver.extractAccessKeyId("auth")).thenReturn("ASIA123");
|
||||
|
||||
Reference in new issue
Block a user