mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(ecr): support image scanning configuration updates (#4928)
* fix(ecr): support image scanning configuration updates * fix(ecr): validate scanning configuration booleans * fix(ecr): accept null scan-on-push values * docs(ecr): list the image scanning configuration actions Add PutImageScanningConfiguration and BatchGetRepositoryScanningConfiguration to the Supported Actions table. The table is not generated, so the docs check does not catch a missing row.
This commit is contained in:
1 parent
0260a42549
commit
543f01618f
5 files changed
+125
-11
No files matched your search
@@ -163,6 +163,57 @@ class EcrIntegrationTest {
|
||||
|
||||
@Test
|
||||
@Order(8)
|
||||
void putImageScanningConfiguration() {
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "PutImageScanningConfiguration")
|
||||
.contentType(CT)
|
||||
.body("""
|
||||
{
|
||||
"repositoryName": "%s",
|
||||
"imageScanningConfiguration": { "scanOnPush": true }
|
||||
}
|
||||
""".formatted(REPO))
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("registryId", not(emptyString()))
|
||||
.body("repositoryName", equalTo(REPO))
|
||||
.body("imageScanningConfiguration.scanOnPush", equalTo(true));
|
||||
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "PutImageScanningConfiguration")
|
||||
.contentType(CT)
|
||||
.body("""
|
||||
{
|
||||
"repositoryName": "%s",
|
||||
"imageScanningConfiguration": { "scanOnPush": "yes" }
|
||||
}
|
||||
""".formatted(REPO))
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body("__type", equalTo("InvalidParameterException"));
|
||||
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "PutImageScanningConfiguration")
|
||||
.contentType(CT)
|
||||
.body("""
|
||||
{
|
||||
"repositoryName": "%s",
|
||||
"imageScanningConfiguration": { "scanOnPush": null }
|
||||
}
|
||||
""".formatted(REPO))
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("imageScanningConfiguration.scanOnPush", equalTo(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
void batchGetRepositoryScanningConfiguration() {
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "BatchGetRepositoryScanningConfiguration")
|
||||
@@ -183,7 +234,7 @@ class EcrIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
@Order(10)
|
||||
void deleteRepositoryForce() {
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "DeleteRepository")
|
||||
@@ -216,7 +267,7 @@ class EcrIntegrationTest {
|
||||
* call rather than the emulator's configured default.
|
||||
*/
|
||||
@Test
|
||||
@Order(10)
|
||||
@Order(11)
|
||||
void getAuthorizationToken_nonDefaultRegionRequest_returnsProxyEndpointForThatRegion() {
|
||||
String repository = "floci-it/region-scoped";
|
||||
String repositoryUri = given()
|
||||
@@ -264,7 +315,7 @@ class EcrIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
@Order(12)
|
||||
void createPullThroughCacheRule() {
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "CreatePullThroughCacheRule")
|
||||
@@ -306,7 +357,7 @@ class EcrIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
@Order(13)
|
||||
void updateAndValidatePullThroughCacheRule() {
|
||||
String updatedCredential =
|
||||
"arn:aws:secretsmanager:us-east-1:000000000000:secret:ecr-pullthroughcache/updated";
|
||||
@@ -353,7 +404,7 @@ class EcrIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(13)
|
||||
@Order(14)
|
||||
void describePullThroughCacheRulesFiltersAndPaginates() {
|
||||
String nextToken = given()
|
||||
.header("X-Amz-Target", PREFIX + "DescribePullThroughCacheRules")
|
||||
@@ -396,7 +447,7 @@ class EcrIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(14)
|
||||
@Order(15)
|
||||
void createPullThroughCacheRuleDuplicateFails() {
|
||||
given()
|
||||
.header("X-Amz-Target", PREFIX + "CreatePullThroughCacheRule")
|
||||
@@ -425,7 +476,7 @@ class EcrIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(15)
|
||||
@Order(16)
|
||||
void deletePullThroughCacheRules() {
|
||||
for (String prefix : new String[] {CACHE_PREFIX, SECOND_CACHE_PREFIX}) {
|
||||
given()
|
||||
|
||||
Reference in new issue
Block a user