Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public enum TenantSecurityErrorCodes {
KMS_UNREACHABLE(208, "Request to KMS failed because KMS was unreachable."),
KMS_THROTTLED(209, "Request to KMS failed because KMS throttled the Tenant Security Proxy."),
KMS_ACCOUNT_ISSUE(210, "Request to KMS failed because of an issue with the KMS account."),
// map to SecurityEventException
KMS_ROLE_ASSUMPTION_MISCONFIGURED(212,
"Request to KMS failed because the tenant IAM role configuration was misconfigured."),
// map to SecurityEventException
SECURITY_EVENT_REJECTED(301, "Tenant Security Proxy could not accept the security event"),

// map to TscException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ public void exceptionFromErrorResponseTspServiceException() throws Exception {
TenantSecurityException fooException = foo.toTenantSecurityException(staticHttpCode);
assertKmsException(staticMsg, staticHttpCode, fooException,
TenantSecurityErrorCodes.KMS_ACCOUNT_ISSUE);
ErrorResponse kmsRoleMisconfiguredError =
new ErrorResponse(
TenantSecurityErrorCodes.KMS_ROLE_ASSUMPTION_MISCONFIGURED.getCode(), staticMsg);

TenantSecurityException kmsRoleMisconfiguredException =
kmsRoleMisconfiguredError.toTenantSecurityException(staticHttpCode);

assertKmsException(
staticMsg,
staticHttpCode,
kmsRoleMisconfiguredException,
TenantSecurityErrorCodes.KMS_ROLE_ASSUMPTION_MISCONFIGURED);

ErrorResponse kmsUnreachableError =
new ErrorResponse(TenantSecurityErrorCodes.KMS_UNREACHABLE.getCode(), staticMsg);
Expand Down