mirror of
https://github.com/floci-io/floci.git
synced 2026-11-29 00:21:51 -05:00
Retained flat-name parameters still exposed the pre-fix ARN stored on disk. Normalize only the exact legacy SSM resource suffix when reading the ARN, retaining its stored partition, region and account. All metadata consumers and serialized responses then use the canonical resource without overwriting the parameter or incrementing its version. Cover retained persistent JSON, version and label reads, metadata and history preservation, all eight partitions, canonical flush/reload, unrelated ARN preservation, and AWS SDK exact-resource IAM policy consumption. Malformed policy ARNs remain denied. Validation: 298 focused SSM and partition tests passed; Checkstyle reports zero violations; docs-check and partition-check passed. Fixes #7698
This commit is contained in:
1 parent
068c96eb2e
commit
99f9a49ebe
4 files changed
+218
-1
No files matched your search
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.floci.aws.core.common.AwsArnUtils;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
@@ -103,7 +104,17 @@ public class Parameter {
|
||||
public String getDescription() { return description; }
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public String getArn() { return arn; }
|
||||
public String getArn() {
|
||||
// Retained flat-name records written before the ARN fix lack the resource separator.
|
||||
if (name != null && !name.startsWith("/") && AwsArnUtils.isArnFor(arn, "ssm")) {
|
||||
AwsArnUtils.Arn stored = AwsArnUtils.parse(arn);
|
||||
if (stored.resource().equals("parameter" + name)) {
|
||||
return new AwsArnUtils.Arn(stored.partition(), stored.service(), stored.region(),
|
||||
stored.accountId(), "parameter/" + name).toString();
|
||||
}
|
||||
}
|
||||
return arn;
|
||||
}
|
||||
public void setArn(String arn) { this.arn = arn; }
|
||||
|
||||
public String getDataType() { return dataType; }
|
||||
|
||||
Reference in new issue
Block a user