mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
chore(deps): bump botocore to 1.44.9 (#9223)
Moves the pin from 1.43.118 to 1.44.9 and regenerates the data derived from it. 1.44.9 adds the me-west-1 and sa-west-1 regions, whose optIn and s3WebsiteDashForm flags come from aws-cdk's aws-entities.ts rather than botocore, so partitions.json is generated with that file; no existing region's flags change. AwsPartitionsTest, AwsRegionsTest and Ec2DescribeRegionsIntegrationTest count 36 commercial regions, 19 of them opt-in. The IAM tables aws-data-check-botocore checks are regenerated with it. The passed-role and tag-on-create tables no longer park any operation as missing from the pinned botocore, and the passed-role generator's four MEMBER_NOT_IN_BOTOCORE entries come out, as the reason asks, now that EventBridge's event sources and WAF v2's web ACLs have the member naming their role. The DynamoDB and IAM condition key tables are regenerated too. test_regen_iam_tag_on_create pinned network-firewall:CreateFirewallPolicyV2 as an operation botocore lacks; it now checks the tags its request names. with_parent_ids reads a made resource's parent id from "the one top-level ARN member named after that type", but request_members keys a member inside a structure or a list by its whole path, so the path == member test also took RAM's new permissionTemplateParameters[].permissionArn and filled the resource share CreateResourceShare makes with a permission ARN. It now takes a top-level member alone, which changes that one operation and no other. Four request members 1.44.9 models were accepted and dropped, as they were before it, when Floci read them as unknown: - ECR keeps each replication rule's deleteReplication and returns it from PutReplicationConfiguration and DescribeRegistry. - Lambda MicroVMs keep the kmsKeyIdentifier an image's create or update names on each version it builds, and the one RunMicrovm names on the MicroVM, and return them where the model has the member. - STS's GetWebIdentityToken refuses Scope unless SubjectMode is OriginIdentity with exactly one audience, and refuses OriginIdentity, which reads the calling session's trusted identity propagation context, as AWS does a session without one: no Floci session carries one. Both answer ValidationError with the reference's own sentence. LambdaMicrovmImageModeledConstraintsIntegrationTest's invalid cases follow the model: X86_64 is an architecture now, and an image takes up to 100 environment variables.
This commit is contained in:
1 parent
942cace935
commit
e394329a8b
57 files changed
+1900
-323
No files matched your search
@@ -698,8 +698,12 @@ public class EcrJsonHandler {
|
||||
d.path("region").asText(null), d.path("registryId").asText(null)));
|
||||
}
|
||||
}
|
||||
RegistrySettings.DeleteReplication deletion = rule.has("deleteReplication")
|
||||
? new RegistrySettings.DeleteReplication(rule.path("deleteReplication").path("enabled").asBoolean())
|
||||
: null;
|
||||
rules.add(new RegistrySettings.ReplicationRule(destinations,
|
||||
rule.has("repositoryFilters") ? parseRepositoryFilters(rule.path("repositoryFilters")) : null));
|
||||
rule.has("repositoryFilters") ? parseRepositoryFilters(rule.path("repositoryFilters")) : null,
|
||||
deletion));
|
||||
}
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("replicationConfiguration",
|
||||
@@ -775,6 +779,9 @@ public class EcrJsonHandler {
|
||||
if (rule.repositoryFilters() != null) {
|
||||
n.set("repositoryFilters", buildRepositoryFilters(rule.repositoryFilters()));
|
||||
}
|
||||
if (rule.deleteReplication() != null) {
|
||||
n.putObject("deleteReplication").put("enabled", rule.deleteReplication().enabled());
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,14 @@ public class RegistrySettings {
|
||||
@RegisterForReflection
|
||||
public record ReplicationDestination(String region, String registryId) {}
|
||||
|
||||
/** One replication rule: where to copy, and which repositories. */
|
||||
/** Whether a replication rule replicates image deletions and tag removals as well. */
|
||||
@RegisterForReflection
|
||||
public record ReplicationRule(List<ReplicationDestination> destinations, List<RepositoryFilter> repositoryFilters) {}
|
||||
public record DeleteReplication(boolean enabled) {}
|
||||
|
||||
/** One replication rule: where to copy, which repositories, and whether deletions follow. */
|
||||
@RegisterForReflection
|
||||
public record ReplicationRule(List<ReplicationDestination> destinations, List<RepositoryFilter> repositoryFilters,
|
||||
DeleteReplication deleteReplication) {}
|
||||
|
||||
/** One scanning rule: how often, and which repositories. */
|
||||
@RegisterForReflection
|
||||
|
||||
@@ -1188,6 +1188,16 @@ public class StsQueryHandler {
|
||||
* gone does not get one that speaks for the account. An unknown long-term key keeps the
|
||||
* stand-in, which is what {@code GetCallerIdentity} answers it.
|
||||
*/
|
||||
/**
|
||||
* The refusals the GetWebIdentityToken reference states for its two subject members, in its own
|
||||
* sentences: AWS's answer is a validation error, and no recording gives its text.
|
||||
*/
|
||||
private static final String SCOPE_NEEDS_ORIGIN_IDENTITY = "You can specify Scope only when SubjectMode is"
|
||||
+ " OriginIdentity and you request exactly one audience.";
|
||||
private static final String ORIGIN_IDENTITY_NEEDS_CONTEXT = "To use OriginIdentity, the trusted identity"
|
||||
+ " propagation context of the calling session must contain the aws:OriginIdentity/Subject key and"
|
||||
+ " either the aws:OriginIdentity/Issuer key or the aws:OriginIdentity/FederatedProviderArn key.";
|
||||
|
||||
private Response handleGetWebIdentityToken(MultivaluedMap<String, String> params) {
|
||||
if (arrivedOnTheGlobalEndpoint()) {
|
||||
return AwsQueryResponse.error("ValidationError", "The global endpoint is not supported"
|
||||
@@ -1203,6 +1213,10 @@ public class StsQueryHandler {
|
||||
if (validation != null) {
|
||||
return validation;
|
||||
}
|
||||
boolean originIdentity = "OriginIdentity".equals(params.getFirst("SubjectMode"));
|
||||
if (params.getFirst("Scope") != null && (!originIdentity || audiences(params).size() != 1)) {
|
||||
return AwsQueryResponse.error("ValidationError", SCOPE_NEEDS_ORIGIN_IDENTITY, AwsNamespaces.STS, 400);
|
||||
}
|
||||
|
||||
String accessKeyId = callerAccessKeyId();
|
||||
Optional<Instant> sessionEnds = accessKeyId == null
|
||||
@@ -1212,6 +1226,11 @@ public class StsQueryHandler {
|
||||
return AwsQueryResponse.error("ExpiredTokenException",
|
||||
IamEnforcementFilter.EXPIRED_TOKEN, AwsNamespaces.STS, 403);
|
||||
}
|
||||
if (originIdentity) {
|
||||
// The mode reads the aws:OriginIdentity/Subject key of the calling session's trusted identity
|
||||
// propagation context, and no session Floci hands out carries one.
|
||||
return AwsQueryResponse.error("ValidationError", ORIGIN_IDENTITY_NEEDS_CONTEXT, AwsNamespaces.STS, 400);
|
||||
}
|
||||
|
||||
Optional<OutboundWebIdentityFederation> federation =
|
||||
iamService.findEnabledOutboundWebIdentityFederation();
|
||||
|
||||
@@ -96,7 +96,7 @@ public class LambdaMicrovmsController {
|
||||
text(request, "buildRoleArn"),
|
||||
codeArtifact.isMissingNode() ? null : text(codeArtifact, "uri"),
|
||||
text(request, "description"), text(request, "baseImageVersion"), runtimeSettings(request),
|
||||
mapMember(request, "tags"));
|
||||
mapMember(request, "tags"), text(request, "kmsKeyIdentifier"));
|
||||
return Response.status(201).entity(imageNode(image, ImageShape.CREATE)).build();
|
||||
}
|
||||
|
||||
@@ -135,7 +135,8 @@ public class LambdaMicrovmsController {
|
||||
MicrovmImage image = service.updateImage(region, imageIdentifier,
|
||||
text(request, "baseImageArn"), text(request, "buildRoleArn"),
|
||||
updArtifact.isMissingNode() ? null : text(updArtifact, "uri"),
|
||||
text(request, "description"), text(request, "baseImageVersion"), runtimeSettings(request));
|
||||
text(request, "description"), text(request, "baseImageVersion"), runtimeSettings(request),
|
||||
text(request, "kmsKeyIdentifier"));
|
||||
return Response.ok(imageNode(image, ImageShape.UPDATE, activeBefore)).build();
|
||||
}
|
||||
|
||||
@@ -382,6 +383,7 @@ public class LambdaMicrovmsController {
|
||||
node.put("buildRoleArn", image.buildRoleArn);
|
||||
node.putObject("codeArtifact").put("uri", image.codeArtifactUri);
|
||||
node.put("imageVersion", image.versions.get(image.versions.size() - 1).imageVersion);
|
||||
putKmsKey(node, image.kmsKeyIdentifier);
|
||||
// Neither is settable — not by the request, not by the
|
||||
// CloudFormation resource type. The service fills them in.
|
||||
node.putArray("resources").addObject().put("minimumMemoryInMiB", DEFAULT_MEMORY_MIB);
|
||||
@@ -414,6 +416,7 @@ public class LambdaMicrovmsController {
|
||||
node.put("baseImageVersion", buildSpec.baseImageVersion());
|
||||
node.put("buildRoleArn", buildSpec.buildRoleArn());
|
||||
node.putObject("codeArtifact").put("uri", buildSpec.codeArtifactUri());
|
||||
putKmsKey(node, buildSpec.kmsKeyIdentifier());
|
||||
// A version's description is its own and nothing sets it. It stays null
|
||||
// even once the parent image has one, which is why it cannot simply be
|
||||
// read off the image.
|
||||
@@ -535,7 +538,15 @@ public class LambdaMicrovmsController {
|
||||
listMember(request, "ingressNetworkConnectors"), listMember(request, "egressNetworkConnectors"),
|
||||
integerMember(request, "maximumDurationInSeconds"),
|
||||
idle.hasNonNull("autoResumeEnabled") ? idle.get("autoResumeEnabled").booleanValue() : null,
|
||||
integerMember(idle, "maxIdleDurationSeconds"), integerMember(idle, "suspendedDurationSeconds"));
|
||||
integerMember(idle, "maxIdleDurationSeconds"), integerMember(idle, "suspendedDurationSeconds"),
|
||||
text(request, "kmsKeyIdentifier"));
|
||||
}
|
||||
|
||||
/** The customer managed key a request named, as it named it; a resource with an AWS owned key has none. */
|
||||
private static void putKmsKey(ObjectNode node, String kmsKeyIdentifier) {
|
||||
if (kmsKeyIdentifier != null) {
|
||||
node.put("kmsKeyIdentifier", kmsKeyIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
private static Integer integerMember(JsonNode request, String name) {
|
||||
@@ -571,6 +582,7 @@ public class LambdaMicrovmsController {
|
||||
putConnectors(node.putArray("ingressNetworkConnectors"), settings.ingressNetworkConnectors(), region,
|
||||
"HTTP_INGRESS");
|
||||
node.put("executionRoleArn", settings.executionRoleArn());
|
||||
putKmsKey(node, settings.kmsKeyIdentifier());
|
||||
if (settings.autoResumeEnabled() == null) {
|
||||
node.putNull("idlePolicy");
|
||||
} else {
|
||||
|
||||
@@ -131,9 +131,12 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
}
|
||||
|
||||
@RegisterForReflection
|
||||
public record BuildSpec(String baseImageArn, String baseImageVersion, String buildRoleArn, String codeArtifactUri) {
|
||||
/** What a version was built from, its KMS key among them: the key encrypts that version's contents. */
|
||||
public record BuildSpec(String baseImageArn, String baseImageVersion, String buildRoleArn, String codeArtifactUri,
|
||||
String kmsKeyIdentifier) {
|
||||
static BuildSpec from(MicrovmImage image) {
|
||||
return new BuildSpec(image.baseImageArn, image.baseImageVersion, image.buildRoleArn, image.codeArtifactUri);
|
||||
return new BuildSpec(image.baseImageArn, image.baseImageVersion, image.buildRoleArn, image.codeArtifactUri,
|
||||
image.kmsKeyIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +150,8 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
public String baseImageVersion;
|
||||
public String buildRoleArn;
|
||||
public String codeArtifactUri;
|
||||
/** The customer managed key the image's versions are built with; null for an AWS owned key. */
|
||||
public String kmsKeyIdentifier;
|
||||
public String latestActiveImageVersion;
|
||||
public RuntimeSettings runtimeSettings = RuntimeSettings.defaults();
|
||||
public Instant createdAt;
|
||||
@@ -186,6 +191,14 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
public MicrovmImage createImage(String region, String accountId, String name,
|
||||
String baseImageArn, String buildRoleArn, String codeArtifactUri, String description,
|
||||
String baseImageVersion, RuntimeSettings runtimeSettings, Map<String, String> tags) {
|
||||
return createImage(region, accountId, name, baseImageArn, buildRoleArn, codeArtifactUri, description,
|
||||
baseImageVersion, runtimeSettings, tags, null);
|
||||
}
|
||||
|
||||
public MicrovmImage createImage(String region, String accountId, String name,
|
||||
String baseImageArn, String buildRoleArn, String codeArtifactUri, String description,
|
||||
String baseImageVersion, RuntimeSettings runtimeSettings, Map<String, String> tags,
|
||||
String kmsKeyIdentifier) {
|
||||
if (name == null || !NAME_PATTERN.matcher(name).matches()) {
|
||||
throw new AwsException("ValidationException",
|
||||
"name must match [a-zA-Z0-9-_]{1,64}", 400);
|
||||
@@ -215,6 +228,7 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
}
|
||||
image.buildRoleArn = buildRoleArn;
|
||||
image.codeArtifactUri = codeArtifactUri;
|
||||
image.kmsKeyIdentifier = kmsKeyIdentifier;
|
||||
image.createdAt = Instant.now();
|
||||
image.updatedAt = image.createdAt;
|
||||
addVersion(image);
|
||||
@@ -290,6 +304,13 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
public MicrovmImage updateImage(String region, String name, String baseImageArn,
|
||||
String buildRoleArn, String codeArtifactUri, String description,
|
||||
String baseImageVersion, RuntimeSettings runtimeSettings) {
|
||||
return updateImage(region, name, baseImageArn, buildRoleArn, codeArtifactUri, description, baseImageVersion,
|
||||
runtimeSettings, null);
|
||||
}
|
||||
|
||||
public MicrovmImage updateImage(String region, String name, String baseImageArn,
|
||||
String buildRoleArn, String codeArtifactUri, String description,
|
||||
String baseImageVersion, RuntimeSettings runtimeSettings, String kmsKeyIdentifier) {
|
||||
MicrovmImage image = getImage(region, name);
|
||||
if (baseImageArn == null || buildRoleArn == null || codeArtifactUri == null) {
|
||||
// Recorded live: the PUT is a full replace, not a patch.
|
||||
@@ -302,6 +323,8 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
image.description = description;
|
||||
image.baseImageVersion = baseImageVersion != null ? baseImageVersion : "1.0";
|
||||
image.runtimeSettings = runtimeSettings;
|
||||
// A full replace like the rest: a request without a key builds the next version with an AWS owned key.
|
||||
image.kmsKeyIdentifier = kmsKeyIdentifier;
|
||||
// A full-replace update rebuilds: it mints a new version and walks the
|
||||
// image to UPDATED rather than back to CREATED. Recorded live, and a
|
||||
// consumer polling for UPDATED after a PUT never converges without it.
|
||||
@@ -400,7 +423,7 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
public record RunSettings(String imageVersion, String executionRoleArn, List<String> ingressNetworkConnectors,
|
||||
List<String> egressNetworkConnectors, Integer maximumDurationInSeconds,
|
||||
Boolean autoResumeEnabled, Integer maxIdleDurationSeconds,
|
||||
Integer suspendedDurationSeconds) {
|
||||
Integer suspendedDurationSeconds, String kmsKeyIdentifier) {
|
||||
public RunSettings {
|
||||
ingressNetworkConnectors = ingressNetworkConnectors == null ? List.of() : List.copyOf(ingressNetworkConnectors);
|
||||
egressNetworkConnectors = egressNetworkConnectors == null ? List.of() : List.copyOf(egressNetworkConnectors);
|
||||
@@ -408,7 +431,7 @@ public class LambdaMicrovmsService implements ResourceProvider {
|
||||
}
|
||||
|
||||
public static RunSettings defaults() {
|
||||
return new RunSettings(null, null, null, null, null, null, null, null);
|
||||
return new RunSettings(null, null, null, null, null, null, null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user