mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(kms): normalize alias targetKeyId to plain key ID on createAlias (#1648)
Closes #1647
This commit is contained in:
1 parent
ed81f2b124
commit
d8c09754d5
2 files changed
+12
-3
No files matched your search
@@ -576,12 +576,12 @@ public class KmsService {
|
||||
if (!aliasName.startsWith("alias/")) {
|
||||
throw new AwsException("InvalidAliasNameException", "Alias name must begin with 'alias/'", 400);
|
||||
}
|
||||
resolveKey(targetKeyId, region); // Validate key exists
|
||||
KmsKey key = resolveKey(targetKeyId, region); // Validate key exists and normalize to plain key ID
|
||||
|
||||
String aliasArn = regionResolver.buildArn("kms", region, aliasName);
|
||||
KmsAlias alias = new KmsAlias(aliasName, aliasArn, targetKeyId);
|
||||
KmsAlias alias = new KmsAlias(aliasName, aliasArn, key.getKeyId());
|
||||
aliasStore.put(region + "::" + aliasName, alias);
|
||||
LOG.infov("Created KMS alias: {0} -> {1}", aliasName, targetKeyId);
|
||||
LOG.infov("Created KMS alias: {0} -> {1}", aliasName, key.getKeyId());
|
||||
}
|
||||
|
||||
public void deleteAlias(String aliasName, String region) {
|
||||
|
||||
Reference in new issue
Block a user