mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(kms): handle RotateKeyOnDemand rotation limit (#1042)
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
This commit is contained in:
1 parent
5d3f6e9c8c
commit
650cc2280c
3 files changed
+27
No files matched your search
@@ -1027,6 +1027,22 @@ class KmsServiceTest {
|
||||
assertEquals(400, ex.getHttpStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rotateKeyOnDemandLimitExceededThrows() {
|
||||
KmsKey key = kmsService.createKey(null, REGION);
|
||||
|
||||
for (int i = 0; i < 25; i++) {
|
||||
kmsService.rotateKeyOnDemand(key.getKeyId(), REGION);
|
||||
}
|
||||
|
||||
AwsException ex = assertThrows(AwsException.class, () ->
|
||||
kmsService.rotateKeyOnDemand(key.getKeyId(), REGION));
|
||||
|
||||
assertEquals("LimitExceededException", ex.getErrorCode());
|
||||
assertEquals(400, ex.getHttpStatus());
|
||||
assertEquals(25, kmsService.describeKey(key.getKeyId(), REGION).getOnDemandRotationCount());
|
||||
}
|
||||
|
||||
// ── Issue #497 — HMAC key specs ─────────────────────────────────────────
|
||||
|
||||
@ParameterizedTest
|
||||
|
||||
Reference in new issue
Block a user