feat(iam): check Amazon SES by its generated routes and request resources (#9504)

SES v2 was checked by 118 hand-written rules in IamActionRegistry, one
per route of the model, and no SES request, v1 or v2, was checked on
the resource it names: the ses namespace waited in the table of request
resources' NOT_COVERED, as the generator refused it while its REST
clients had no vendored routes to tell their requests apart.

Vendors the sesv2 and pinpoint-email models' routes under the ses
credential scope, so each v2 request is checked as its operation's
action by the route botocore gives it, and removes the hand rules. The
ses namespace joins the table of request resources, 231 operations over
the ses, sesv2, pinpoint-email and mailmanager clients: an identity, a
configuration set, a template or a contact list by the member naming it,
an ARN member by the ARN it holds, as the Service Reference gives their
formats; an operation naming none of its action's types stays on "*".
Floci mints the same identity/<name> and configuration-set/<name> ARNs.

SES v1 and v2 share the operation names of the table, and the generator
merged the rows of clients that share an endpoint prefix, holding that a
request cannot tell them apart: a v2 SendEmail was read for v1's
SourceArn, so a grant on one identity sent from another by adding one.
Every row of the table now names the APIs it is read for, each a
protocol botocore gives a client of the operation with its API version
(SourceArn is query/2010-12-01), and the reader reads a request for the
rows of its own API alone: a Query request's by the Version its handler
dispatches it by, its form's on a POST and never its URL's, a REST
request's by the version of the model whose route it matched, never by
a member a caller adds. A request whose API neither gives, or
one no row names, is read for every row, as before. 68 rows are read
for some of their operation's APIs only, over SES, Elastic Load
Balancing's classic and v2 APIs, EventBridge, Lambda and Bedrock.

botocore now gives ListConfigurationSets and ListEmailIdentities as
POST /v2/email/list-configuration-sets and POST /v2/email/list-identities.
The GET /v2/email/configuration-sets and GET /v2/email/identities routes
an SDK built before that still sends stay served and match no route of
the model, so they are not checked. The hand-kept copy of the SES v2
model's routes the registry test read is removed: the route coverage
test checks every vendored route.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-26 10:08:17 -04:00
1 parent 63df4c12ee
commit 5c1e8b8110
17 files changed
+6302 -5697

No files matched your search

+16 -4
View File
@@ -2580,7 +2580,7 @@ AWS Data Exports, AWS Pricing Calculator, Cost Explorer, CloudTrail, Global Acce
Timestream for InfluxDB, Amazon Redshift, the Amazon Redshift Data API, AWS Payment Cryptography, AWS DataSync, Amazon EMR,
Amazon Rekognition, IAM Identity Center, Amazon Inspector, Amazon Macie, AWS Fault Injection Service, AWS Resource
Access Manager, CloudWatch Observability Access Manager, AWS Resource Explorer, AWS Account Management, AWS Control
Catalog, Amazon OpenSearch Service, IAM Access Analyzer, AWS Security Hub, Amazon GuardDuty, Lambda, AWS Glue, Amazon SQS, Amazon SNS, Amazon Kinesis Data Streams, Amazon EventBridge Pipes, Aurora DSQL, STS, Amazon EKS, AWS Resource Groups, Amazon CloudWatch Logs, Amazon CloudWatch, Amazon Comprehend, AWS Config, AWS DMS, Amazon ElastiCache, AWS Identity Store, Amazon MemoryDB, Amazon Route 53 Resolver, Amazon SageMaker, Amazon Transcribe, AWS Transfer Family and Amazon EFS they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each
Catalog, Amazon OpenSearch Service, IAM Access Analyzer, AWS Security Hub, Amazon GuardDuty, Lambda, AWS Glue, Amazon SQS, Amazon SNS, Amazon Kinesis Data Streams, Amazon EventBridge Pipes, Aurora DSQL, STS, Amazon EKS, AWS Resource Groups, Amazon CloudWatch Logs, Amazon CloudWatch, Amazon Comprehend, AWS Config, AWS DMS, Amazon ElastiCache, AWS Identity Store, Amazon MemoryDB, Amazon Route 53 Resolver, Amazon SageMaker, Amazon Transcribe, AWS Transfer Family, Amazon EFS and Amazon SES they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each
operation's action, the resource types that action acts on with their ARN formats, and the request
members that name them: a member holding a resource's ARN, which counts when it matches the format
of a type the action acts on, or members filling the variables of a type's format. Nothing in it is
@@ -2692,7 +2692,14 @@ AWS does not document which resource a request naming a session is authorized on
target is Floci's inference: a session runs on the cluster or workgroup named by the statement that
opened it.
EventBridge V2's requests are read beside EventBridge's, each checked on the resources the API serving
it names (an EventBridge V2 `PutEvents` on the bus its `EventBusArn` names). A
it names (an EventBridge V2 `PutEvents` on the bus its `EventBusArn` names). Every row of the table names
the APIs it is read for (`apis`), each a protocol botocore gives a client of the operation with its API
version, and a request is read for the rows of its own API: a Query request's by the `Version` it names,
a REST request's by the version of the model whose route it matched. So clients that share an operation
and an endpoint are told apart by the request itself, never by a member a caller adds: an SES v2
`SendEmail` is not read for SES v1's `SourceArn`, nor an Elastic Load Balancing v2 request for a classic
one's members. A request whose API neither gives, a JSON or CBOR request among them, is read for every
row, as one no row names is. A
state machine's version or alias
(`stateMachine:<name>:<qualifier>`) is checked on the state machine's ARN, as Step Functions
authorizes it, so a grant or a deny on `stateMachine:<name>` covers its versions and aliases, and
@@ -2733,7 +2740,7 @@ serves, and OAM's on `/tags/<arn>` whether the ARN's slash is encoded or not. A
tags needs `oam:TagResource` on the sink it names, where the operation is checked, since it acts on no
link.
The REST routes mapped to an action are those of S3, Lambda, API Gateway, SES v2, RDS Data,
The REST routes mapped to an action are those of S3, Lambda, API Gateway, RDS Data,
Kinesis, EKS, EventBridge Scheduler, EventBridge Pipes and Aurora DSQL. In EKS that is every route,
including those Floci does not serve yet, each checked as the action of its own name, except an
access entry's access policy routes: Floci takes the entry's principal as the rest of the path, so a
@@ -2887,7 +2894,12 @@ Formation and Amazon Inspector is one AWS authorizes on no resource type, as is
account's members, `member/*`, as nothing botocore or the Service Reference says names the member it makes by its
`account.accountId`, and needs `macie2:TagResource` when it carries tags. Amazon EFS's routes are checked on the
resources the table of request resources reads: a file system by its id, and a mount target's operations and the tag
calls on the file system or access point EFS answers their `MountTargetId` or `ResourceId` reaches. API Gateway's
calls on the file system or access point EFS answers their `MountTargetId` or `ResourceId` reaches. Amazon SES v2's
and Amazon Pinpoint Email's routes are checked by their routes, on the resources the table reads, as SES v1's Query
requests are by their `Action`. Two `GET` routes an SDK built before botocore moved `ListConfigurationSets` and
`ListEmailIdentities` to `POST /v2/email/list-configuration-sets` and `POST /v2/email/list-identities` still sends,
`GET /v2/email/configuration-sets` and `GET /v2/email/identities`, are served but match no route of the model, so
they are not checked. API Gateway's
routes are checked by their routes alone too, on the path Floci builds the ARN from, and the authorized
actions list the operations AWS checks as the action their HTTP method names (above). A route whose action AWS checks on a
resource Floci neither builds nor reads would not be checked, since checked on `*` a grant scoped to
+13 -8
View File
@@ -570,14 +570,19 @@ See the [AWS receipt-rule resource reference](https://docs.aws.amazon.com/AWSClo
### IAM enforcement
With `FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true`, every SES v2 operation is authorized as the `ses:`
action AWS's service reference lists for it, which is always `ses:<Operation>`, in the `ses` namespace
v1 and v2 share. The v1 Query API resolves the same way from its `Action`. Both are evaluated with
resource `*`, so a policy that limits `ses:` actions to an identity, configuration set or template ARN
does not grant them yet. The other actions the service reference lists for some operations are not
checked: `ses:TagResource` for the create operations, and `iam:PassRole` (with `iam:PassedToService`
`ses.amazonaws.com`) for creating or updating an event destination. A v2 `SendEmail` is authorized as
`ses:SendEmail` whatever its content: `ses:SendRawEmail` is a v1 action.
With `FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true`, every SES operation is authorized as the `ses:`
action AWS's Service Reference lists for it, in the `ses` namespace v1 and v2 share: a v2 request by the
route botocore's model gives its operation, a v1 request by its `Action`. Each is checked on the resources
the generated table of request resources reads from the request, as for every namespace that table reads:
an identity by its name (`identity/<name>`), a configuration set, a template or a contact list by theirs,
an ARN member by the ARN it holds; an operation naming none of the types its action acts on is checked on
`*`. A create that carries tags also needs `ses:TagResource`, and an event destination or a receipt rule
that names a role `iam:PassRole` for it. A v2 `SendEmail` is authorized as `ses:SendEmail` whatever its
content: `ses:SendRawEmail` is a v1 action. v1 and v2 share the operation in that table, and a request is read
for its own API's members alone: a v1 `SendEmail` names its identity by its `SourceArn`, a v2 one by its
`FromEmailAddressIdentityArn`, and neither is read for the other's. `ListConfigurationSets` and `ListEmailIdentities` are
`POST /v2/email/list-configuration-sets` and `POST /v2/email/list-identities` in the model; the `GET` routes
an SDK built before that still sends are served but match no route of the model, so they are not checked.
SES publishes to an SNS topic as `ses.amazonaws.com`, so the topic's policy decides whether it may,
whatever the sender's own SNS permissions: an event destination's events with the configuration set's
@@ -75,6 +75,8 @@ final class RequestResourceMembers {
private static final Pattern APPENDED_ID = Pattern.compile("[/:]\\$\\{\\w+}");
/** A word of a child type's own and one id, which its format appends to its parent's whole resource. */
private static final Pattern NESTED_ID = Pattern.compile("[/:][A-Za-z][A-Za-z0-9-]*[/:]\\$\\{\\w+}");
/** An API a row is read for: a protocol botocore gives a client and its API version ({@code query/2010-12-01}). */
private static final Pattern API = Pattern.compile("[a-z0-9-]+/\\d{4}-\\d{2}-\\d{2}");
/** The keys a resource found by members does not take: it is read no other way. */
private static final List<String> FOUND_ONLY = List.of("arnOf", "fixed");
/** The keys of a resource read from a member holding its ARN. */
@@ -262,14 +264,35 @@ final class RequestResourceMembers {
* {@code renames} is the resource the member it names gives, as its service holds it, with the name and the path
* the request gives each in place of its own (UpdateUser's {@code UserName}, renamed {@code NewUserName}, moved
* {@code NewPath}). A {@code signer} resource is the user whose access key signs the request, which its service
* gives, {@code when} the request leaves out the members that would name another.
* gives, {@code when} the request leaves out the members that would name another. Each resource names the
* {@code apis} it is read for, each a protocol botocore gives a client of the operation with its API version
* ({@code query/2010-12-01}): one some of the operation's clients read applies to the requests of their APIs alone
* (SES v1's {@code SourceArn}, which no v2 request has); none for every request.
*/
record Resource(List<String> types, Member arn, Map<String, Member> fill, Map<String, List<String>> when,
Map<String, List<String>> unless, Map<String, String> arnOf, Member account,
Map<String, String> fixed, boolean made, List<Member> find, String endpoint, Member through,
boolean byDefault, Map<String, String> whenDefault, Map<String, String> unlessDefault,
Map<String, String> defaults, boolean partialArn, Member statement, String verb,
Map<String, String> names, Member path, Member renames, boolean signer) {
Map<String, String> names, Member path, Member renames, boolean signer, List<String> apis) {
Resource(List<String> types, Member arn, Map<String, Member> fill, Map<String, List<String>> when,
Map<String, List<String>> unless, Map<String, String> arnOf, Member account,
Map<String, String> fixed, boolean made, List<Member> find, String endpoint, Member through,
boolean byDefault, Map<String, String> whenDefault, Map<String, String> unlessDefault,
Map<String, String> defaults, boolean partialArn, Member statement, String verb,
Map<String, String> names, Member path, Member renames, boolean signer) {
this(types, arn, fill, when, unless, arnOf, account, fixed, made, find, endpoint, through, byDefault,
whenDefault, unlessDefault, defaults, partialArn, statement, verb, names, path, renames, signer,
List.of());
}
/** This resource, read for those APIs alone. */
Resource withApis(List<String> read) {
return new Resource(types, arn, fill, when, unless, arnOf, account, fixed, made, find, endpoint, through,
byDefault, whenDefault, unlessDefault, defaults, partialArn, statement, verb, names, path, renames,
signer, List.copyOf(read));
}
Resource(List<String> types, Member arn, Map<String, Member> fill, Map<String, List<String>> when,
Map<String, List<String>> unless, Map<String, String> arnOf, Member account,
@@ -531,7 +554,7 @@ final class RequestResourceMembers {
throw new IllegalStateException(RESOURCE_NAME + " checks a resource of " + operation.getKey()
+ " as " + action + ", none of the actions it records for the operation");
}
(action == null ? resources : byAction.get(action)).add(resource(operation.getKey(),
(action == null ? resources : byAction.get(action)).add(readRow(operation.getKey(),
action == null ? resource : ((ObjectNode) resource.deepCopy()).without("action"),
formats.getOrDefault(namespace, Map.of())));
}
@@ -783,6 +806,21 @@ final class RequestResourceMembers {
return Set.copyOf(list.valueStream().map(JsonNode::asText).toList());
}
/** A row of the resources an operation reads, with the APIs it names it is read for ({@code apis}), if any. */
private static Resource readRow(String operation, JsonNode row, Map<String, ArnFormat> formats) {
if (!row.has("apis")) {
return resource(operation, row, formats);
}
JsonNode apis = row.path("apis");
if (!apis.isArray() || apis.isEmpty()
|| !apis.valueStream().allMatch(api -> api.isTextual() && API.matcher(api.asText()).matches())) {
throw new IllegalStateException(RESOURCE_NAME + " reads a resource of " + operation + " for " + apis
+ ", which is no list of protocols with their API versions");
}
return resource(operation, ((ObjectNode) row.deepCopy()).without("apis"), formats)
.withApis(apis.valueStream().map(JsonNode::asText).toList());
}
private static Resource resource(String operation, JsonNode resource, Map<String, ArnFormat> formats) {
if (resource.has("made") && !(resource.path("made").isBoolean() && resource.path("made").booleanValue())) {
throw new IllegalStateException(RESOURCE_NAME + " marks a resource of " + operation + " made by "
@@ -190,7 +190,7 @@ public final class RequestResources {
}
// An operation the table does not read, an unread one among them, names nothing from it.
List<RequestResourceMembers.Resource> resources = !readable(table, operation) ? null
: served(table.operations().get(operation), ctx);
: served(operation, table.operations().get(operation), ctx);
if (resources == null) {
return List.of();
}
@@ -251,7 +251,7 @@ public final class RequestResources {
JsonNode body = sent.isEmpty() ? located(table, operation, PassedRoles.jsonBody(ctx), ctx, labels) : null;
Map<String, String> form = ec2Query(table, operation, located(table, operation, sent, ctx, labels));
Map<String, List<RequestResourceMembers.Resource>> served = new LinkedHashMap<>();
actions.forEach((action, resources) -> served.put(action, served(resources, ctx)));
actions.forEach((action, resources) -> served.put(action, served(operation, resources, ctx)));
return targets(operation, served, formats(table, operation), form, body, partition, region, accountId, stored);
}
@@ -570,7 +570,7 @@ public final class RequestResources {
public static List<String> created(String operation, String tagging, ContainerRequestContext ctx, String partition,
String region, String accountId, Map<String, String> labels) {
RequestResourceMembers.Table table = RequestResourceMembers.table();
return created(table, operation, tagging, resources -> served(resources, ctx),
return created(table, operation, tagging, resources -> served(operation, resources, ctx),
() -> ec2Query(table, operation,
located(table, operation, IamConditionContextResolver.formParameters(ctx), ctx, labels)),
() -> IamConditionContextResolver.formParameters(ctx).isEmpty()
@@ -723,6 +723,72 @@ public final class RequestResources {
* and never from the request's members, which a caller could add to a request of the other API. A request no
* service is known to serve keeps them all, which can only check it on more.
*/
/**
* The resources that apply to a request of the operation: those of the service serving it
* ({@link #served(List, ContainerRequestContext)}), and of them, where the request's API is known and some resource
* names it, those read for it ({@code apis}), so a request of one API is never read for a member only another
* API's request has (SES v1's {@code SourceArn} in an SES v2 request). The API is the one the request reached the
* service by, never a member a caller could add: the {@code Version} a Query request's handler dispatches it by,
* its form's on a POST, or the version of the vendored model whose route a REST request matched. A request whose API neither gives,
* or one no resource names, keeps them all.
*/
private static List<RequestResourceMembers.Resource> served(String operation,
List<RequestResourceMembers.Resource> resources,
ContainerRequestContext ctx) {
List<RequestResourceMembers.Resource> served = served(resources, ctx);
Api api = served == null ? null : requestApi(operation, ctx);
if (api == null || served.stream().noneMatch(resource -> resource.apis().stream().anyMatch(api::reads))) {
return served;
}
return served.stream().filter(resource -> resource.apis().isEmpty()
|| resource.apis().stream().anyMatch(api::reads)).toList();
}
/** A request's API: its protocol's family and the API version it names. */
private record Api(String family, String version) {
/** Whether a resource read for {@code api}, a protocol and its API version, is read for this one. */
boolean reads(String api) {
int slash = api.indexOf('/');
return slash > 0 && family(api.substring(0, slash)).equals(family)
&& api.substring(slash + 1).equals(version);
}
/** A protocol botocore gives a model, as the family a request's wire protocol is one of. */
static String family(String protocol) {
return switch (protocol) {
case "query", "ec2" -> "query";
case "rest-json", "rest-xml" -> "rest";
default -> protocol;
};
}
}
/** The API a request of the operation reached its service by, null where its wire protocol does not give one. */
private static Api requestApi(String operation, ContainerRequestContext ctx) {
if (!(ctx.getProperty(AwsProtocolClaimFilter.CLAIM_PROPERTY) instanceof ProtocolClaim claim)
|| claim.protocol() == null) {
return null;
}
String version = switch (claim.protocol()) {
case AWS_QUERY -> queryVersion(ctx);
case REST -> IamActionRegistry.routeMembers(operation, ctx).apiVersion();
default -> null;
};
if (version == null) {
return null;
}
return new Api(claim.protocol() == WireProtocol.AWS_QUERY ? "query" : "rest", version);
}
/**
* The {@code Version} a Query request's handler dispatches it by, read as {@link AwsQueryController} reads it: a
* POST's from its form alone, never its URL, and a GET's from its query string, each its first value.
*/
private static String queryVersion(ContainerRequestContext ctx) {
return IamConditionContextResolver.formParameters(ctx).get("Version");
}
private static List<RequestResourceMembers.Resource> served(List<RequestResourceMembers.Resource> resources,
ContainerRequestContext ctx) {
String endpoint = ctx.getProperty(AwsProtocolClaimFilter.CLAIM_PROPERTY) instanceof ProtocolClaim claim
@@ -370,134 +370,6 @@ public class IamActionRegistry {
rule("eks", "POST", "^/tags(/.+)?$", "eks:TagResource"),
rule("eks", "DELETE", "^/tags(/.+)?$", "eks:UntagResource"),
// ── SES v2 ─────────────────────────────────────────────────────────────
// SES v1 is a Query API and resolves from its Action like any other; v2 is REST-JSON under
// /v2/email, so every operation needs its own rule. One rule per operation in the SES v2
// model, each mapped to the IAM action AWS's service reference lists for it: always
// ses:<Operation>, in the ses namespace SES v2 shares with v1. SendEmail has no entry there;
// the Service Authorization Reference's SES v2 page defines ses:SendEmail as v2's only send
// action whatever the content (ses:SendRawEmail belongs to v1), so it takes its name too.
// ListConfigurationSets and ListEmailIdentities keep their GET routes next to the POST ones
// the model moved them to, since older SDKs, and Floci's own routes, still use them.
rule("ses", "GET", "^/v2/email/account/?$", "ses:GetAccount"),
rule("ses", "PUT", "^/v2/email/account/dedicated-ips/warmup/?$", "ses:PutAccountDedicatedIpWarmupAttributes"),
rule("ses", "POST", "^/v2/email/account/details/?$", "ses:PutAccountDetails"),
rule("ses", "PUT", "^/v2/email/account/pricing-attributes/?$", "ses:PutAccountPricingAttributes"),
rule("ses", "PUT", "^/v2/email/account/sending/?$", "ses:PutAccountSendingAttributes"),
rule("ses", "PUT", "^/v2/email/account/suppression/?$", "ses:PutAccountSuppressionAttributes"),
rule("ses", "PUT", "^/v2/email/account/vdm/?$", "ses:PutAccountVdmAttributes"),
rule("ses", "GET", "^/v2/email/configuration-sets/?$", "ses:ListConfigurationSets"),
rule("ses", "POST", "^/v2/email/configuration-sets/?$", "ses:CreateConfigurationSet"),
rule("ses", "DELETE","^/v2/email/configuration-sets/[^/]+/?$", "ses:DeleteConfigurationSet"),
rule("ses", "GET", "^/v2/email/configuration-sets/[^/]+/?$", "ses:GetConfigurationSet"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/archiving-options/?$", "ses:PutConfigurationSetArchivingOptions"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/delivery-options/?$", "ses:PutConfigurationSetDeliveryOptions"),
rule("ses", "GET", "^/v2/email/configuration-sets/[^/]+/event-destinations/?$", "ses:GetConfigurationSetEventDestinations"),
rule("ses", "POST", "^/v2/email/configuration-sets/[^/]+/event-destinations/?$", "ses:CreateConfigurationSetEventDestination"),
rule("ses", "DELETE","^/v2/email/configuration-sets/[^/]+/event-destinations/[^/]+/?$", "ses:DeleteConfigurationSetEventDestination"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/event-destinations/[^/]+/?$", "ses:UpdateConfigurationSetEventDestination"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/reputation-options/?$", "ses:PutConfigurationSetReputationOptions"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/sending/?$", "ses:PutConfigurationSetSendingOptions"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/suppression-options/?$", "ses:PutConfigurationSetSuppressionOptions"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/tracking-options/?$", "ses:PutConfigurationSetTrackingOptions"),
rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/vdm-options/?$", "ses:PutConfigurationSetVdmOptions"),
rule("ses", "GET", "^/v2/email/contact-lists/?$", "ses:ListContactLists"),
rule("ses", "POST", "^/v2/email/contact-lists/?$", "ses:CreateContactList"),
rule("ses", "DELETE","^/v2/email/contact-lists/[^/]+/?$", "ses:DeleteContactList"),
rule("ses", "GET", "^/v2/email/contact-lists/[^/]+/?$", "ses:GetContactList"),
rule("ses", "PUT", "^/v2/email/contact-lists/[^/]+/?$", "ses:UpdateContactList"),
rule("ses", "POST", "^/v2/email/contact-lists/[^/]+/contacts/?$", "ses:CreateContact"),
rule("ses", "POST", "^/v2/email/contact-lists/[^/]+/contacts/list/?$", "ses:ListContacts"),
rule("ses", "DELETE","^/v2/email/contact-lists/[^/]+/contacts/[^/]+/?$", "ses:DeleteContact"),
rule("ses", "GET", "^/v2/email/contact-lists/[^/]+/contacts/[^/]+/?$", "ses:GetContact"),
rule("ses", "PUT", "^/v2/email/contact-lists/[^/]+/contacts/[^/]+/?$", "ses:UpdateContact"),
rule("ses", "GET", "^/v2/email/custom-verification-email-templates/?$", "ses:ListCustomVerificationEmailTemplates"),
rule("ses", "POST", "^/v2/email/custom-verification-email-templates/?$", "ses:CreateCustomVerificationEmailTemplate"),
rule("ses", "DELETE","^/v2/email/custom-verification-email-templates/[^/]+/?$", "ses:DeleteCustomVerificationEmailTemplate"),
rule("ses", "GET", "^/v2/email/custom-verification-email-templates/[^/]+/?$", "ses:GetCustomVerificationEmailTemplate"),
rule("ses", "PUT", "^/v2/email/custom-verification-email-templates/[^/]+/?$", "ses:UpdateCustomVerificationEmailTemplate"),
rule("ses", "GET", "^/v2/email/dedicated-ip-pools/?$", "ses:ListDedicatedIpPools"),
rule("ses", "POST", "^/v2/email/dedicated-ip-pools/?$", "ses:CreateDedicatedIpPool"),
rule("ses", "DELETE","^/v2/email/dedicated-ip-pools/[^/]+/?$", "ses:DeleteDedicatedIpPool"),
rule("ses", "GET", "^/v2/email/dedicated-ip-pools/[^/]+/?$", "ses:GetDedicatedIpPool"),
rule("ses", "PUT", "^/v2/email/dedicated-ip-pools/[^/]+/scaling/?$", "ses:PutDedicatedIpPoolScalingAttributes"),
rule("ses", "GET", "^/v2/email/dedicated-ips/?$", "ses:GetDedicatedIps"),
rule("ses", "GET", "^/v2/email/dedicated-ips/[^/]+/?$", "ses:GetDedicatedIp"),
rule("ses", "PUT", "^/v2/email/dedicated-ips/[^/]+/pool/?$", "ses:PutDedicatedIpInPool"),
rule("ses", "PUT", "^/v2/email/dedicated-ips/[^/]+/warmup/?$", "ses:PutDedicatedIpWarmupAttributes"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/?$", "ses:GetDeliverabilityDashboardOptions"),
rule("ses", "PUT", "^/v2/email/deliverability-dashboard/?$", "ses:PutDeliverabilityDashboardOption"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/blacklist-report/?$", "ses:GetBlacklistReports"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/campaigns/[^/]+/?$", "ses:GetDomainDeliverabilityCampaign"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/domains/[^/]+/campaigns/?$", "ses:ListDomainDeliverabilityCampaigns"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/statistics-report/[^/]+/?$", "ses:GetDomainStatisticsReport"),
rule("ses", "POST", "^/v2/email/deliverability-dashboard/test/?$", "ses:CreateDeliverabilityTestReport"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/test-reports/?$", "ses:ListDeliverabilityTestReports"),
rule("ses", "GET", "^/v2/email/deliverability-dashboard/test-reports/[^/]+/?$", "ses:GetDeliverabilityTestReport"),
rule("ses", "POST", "^/v2/email/email-address-insights/?$", "ses:GetEmailAddressInsights"),
rule("ses", "POST", "^/v2/email/export-jobs/?$", "ses:CreateExportJob"),
rule("ses", "GET", "^/v2/email/export-jobs/[^/]+/?$", "ses:GetExportJob"),
rule("ses", "PUT", "^/v2/email/export-jobs/[^/]+/cancel/?$", "ses:CancelExportJob"),
rule("ses", "GET", "^/v2/email/identities/?$", "ses:ListEmailIdentities"),
rule("ses", "POST", "^/v2/email/identities/?$", "ses:CreateEmailIdentity"),
rule("ses", "DELETE","^/v2/email/identities/[^/]+/?$", "ses:DeleteEmailIdentity"),
rule("ses", "GET", "^/v2/email/identities/[^/]+/?$", "ses:GetEmailIdentity"),
rule("ses", "PUT", "^/v2/email/identities/[^/]+/configuration-set/?$", "ses:PutEmailIdentityConfigurationSetAttributes"),
rule("ses", "PUT", "^/v2/email/identities/[^/]+/dkim/?$", "ses:PutEmailIdentityDkimAttributes"),
rule("ses", "PUT", "^/v2/email/identities/[^/]+/dkim/signing/?$", "ses:PutEmailIdentityDkimSigningAttributes"),
rule("ses", "PUT", "^/v2/email/identities/[^/]+/feedback/?$", "ses:PutEmailIdentityFeedbackAttributes"),
rule("ses", "PUT", "^/v2/email/identities/[^/]+/mail-from/?$", "ses:PutEmailIdentityMailFromAttributes"),
rule("ses", "GET", "^/v2/email/identities/[^/]+/policies/?$", "ses:GetEmailIdentityPolicies"),
rule("ses", "DELETE","^/v2/email/identities/[^/]+/policies/[^/]+/?$", "ses:DeleteEmailIdentityPolicy"),
rule("ses", "POST", "^/v2/email/identities/[^/]+/policies/[^/]+/?$", "ses:CreateEmailIdentityPolicy"),
rule("ses", "PUT", "^/v2/email/identities/[^/]+/policies/[^/]+/?$", "ses:UpdateEmailIdentityPolicy"),
rule("ses", "POST", "^/v2/email/identity/certificates/?$", "ses:AssociateEmailIdentityCertificate"),
rule("ses", "POST", "^/v2/email/identity/certificates/delete/?$", "ses:DisassociateEmailIdentityCertificate"),
rule("ses", "POST", "^/v2/email/identity/certificates/list/?$", "ses:ListEmailIdentityCertificates"),
rule("ses", "POST", "^/v2/email/import-jobs/?$", "ses:CreateImportJob"),
rule("ses", "POST", "^/v2/email/import-jobs/list/?$", "ses:ListImportJobs"),
rule("ses", "GET", "^/v2/email/import-jobs/[^/]+/?$", "ses:GetImportJob"),
rule("ses", "GET", "^/v2/email/insights/[^/]+/?$", "ses:GetMessageInsights"),
rule("ses", "POST", "^/v2/email/list-configuration-sets/?$", "ses:ListConfigurationSets"),
rule("ses", "POST", "^/v2/email/list-export-jobs/?$", "ses:ListExportJobs"),
rule("ses", "POST", "^/v2/email/list-identities/?$", "ses:ListEmailIdentities"),
rule("ses", "POST", "^/v2/email/metrics/batch/?$", "ses:BatchGetMetricData"),
rule("ses", "GET", "^/v2/email/multi-region-endpoints/?$", "ses:ListMultiRegionEndpoints"),
rule("ses", "POST", "^/v2/email/multi-region-endpoints/?$", "ses:CreateMultiRegionEndpoint"),
rule("ses", "DELETE","^/v2/email/multi-region-endpoints/[^/]+/?$", "ses:DeleteMultiRegionEndpoint"),
rule("ses", "GET", "^/v2/email/multi-region-endpoints/[^/]+/?$", "ses:GetMultiRegionEndpoint"),
rule("ses", "POST", "^/v2/email/outbound-bulk-emails/?$", "ses:SendBulkEmail"),
rule("ses", "POST", "^/v2/email/outbound-custom-verification-emails/?$", "ses:SendCustomVerificationEmail"),
rule("ses", "POST", "^/v2/email/outbound-emails/?$", "ses:SendEmail"),
rule("ses", "POST", "^/v2/email/reputation/entities/?$", "ses:ListReputationEntities"),
rule("ses", "GET", "^/v2/email/reputation/entities/[^/]+/[^/]+/?$", "ses:GetReputationEntity"),
rule("ses", "PUT", "^/v2/email/reputation/entities/[^/]+/[^/]+/customer-managed-status/?$","ses:UpdateReputationEntityCustomerManagedStatus"),
rule("ses", "PUT", "^/v2/email/reputation/entities/[^/]+/[^/]+/policy/?$", "ses:UpdateReputationEntityPolicy"),
rule("ses", "POST", "^/v2/email/resources/tenants/list/?$", "ses:ListResourceTenants"),
rule("ses", "GET", "^/v2/email/suppression/addresses/?$", "ses:ListSuppressedDestinations"),
rule("ses", "PUT", "^/v2/email/suppression/addresses/?$", "ses:PutSuppressedDestination"),
rule("ses", "DELETE","^/v2/email/suppression/addresses/[^/]+/?$", "ses:DeleteSuppressedDestination"),
rule("ses", "GET", "^/v2/email/suppression/addresses/[^/]+/?$", "ses:GetSuppressedDestination"),
rule("ses", "DELETE","^/v2/email/tags/?$", "ses:UntagResource"),
rule("ses", "GET", "^/v2/email/tags/?$", "ses:ListTagsForResource"),
rule("ses", "POST", "^/v2/email/tags/?$", "ses:TagResource"),
rule("ses", "GET", "^/v2/email/templates/?$", "ses:ListEmailTemplates"),
rule("ses", "POST", "^/v2/email/templates/?$", "ses:CreateEmailTemplate"),
rule("ses", "DELETE","^/v2/email/templates/[^/]+/?$", "ses:DeleteEmailTemplate"),
rule("ses", "GET", "^/v2/email/templates/[^/]+/?$", "ses:GetEmailTemplate"),
rule("ses", "PUT", "^/v2/email/templates/[^/]+/?$", "ses:UpdateEmailTemplate"),
rule("ses", "POST", "^/v2/email/templates/[^/]+/render/?$", "ses:TestRenderEmailTemplate"),
rule("ses", "POST", "^/v2/email/tenant/suppression/?$", "ses:PutTenantSuppressionAttributes"),
rule("ses", "POST", "^/v2/email/tenants/?$", "ses:CreateTenant"),
rule("ses", "POST", "^/v2/email/tenants/delete/?$", "ses:DeleteTenant"),
rule("ses", "POST", "^/v2/email/tenants/get/?$", "ses:GetTenant"),
rule("ses", "POST", "^/v2/email/tenants/list/?$", "ses:ListTenants"),
rule("ses", "POST", "^/v2/email/tenants/resources/?$", "ses:CreateTenantResourceAssociation"),
rule("ses", "POST", "^/v2/email/tenants/resources/delete/?$", "ses:DeleteTenantResourceAssociation"),
rule("ses", "POST", "^/v2/email/tenants/resources/list/?$", "ses:ListTenantResources"),
rule("ses", "POST", "^/v2/email/update-configuration-sets/?$", "ses:UpdateConfigurationSet"),
rule("ses", "POST", "^/v2/email/vdm/recommendations/?$", "ses:ListRecommendations"),
// ── Resource Groups ─────────────────────────────────────────────────────
rule("resource-groups", "POST", "^/_rg/groups/?$", "resource-groups:CreateGroup"),
rule("resource-groups", "POST", "^/_rg/get-group/?$", "resource-groups:GetGroup"),
@@ -709,10 +581,11 @@ public class IamActionRegistry {
/**
* The vendored route a request of an operation matched: the member locations of a generated alternative route
* ({@code located}; absent entries keep the operation's model locations) and the botocore model whose route it is
* ({@code model}), which tells apart the clients of an operation several serve.
* ({@code model}), which tells apart the clients of an operation several serve, with that model's API version
* ({@code apiVersion}), which the rows of the generated table read for its API alone name.
*/
public record RouteMembers(Map<String, String> located, String model) {
static final RouteMembers NONE = new RouteMembers(Map.of(), null);
public record RouteMembers(Map<String, String> located, String model, String apiVersion) {
static final RouteMembers NONE = new RouteMembers(Map.of(), null, null);
}
/**
@@ -742,7 +615,9 @@ public class IamActionRegistry {
withoutInternalPrefix(ctx, routedPath(ctx)), ctx.getUriInfo().getQueryParameters(),
movedUnderPrefix(ctx), ctx.getHeaders())
.filter(match -> match.operation().equals(operation.substring(separator + 1)))
.map(match -> new RouteMembers(match.located(), match.model())).orElse(RouteMembers.NONE);
.map(match -> new RouteMembers(match.located(), match.model(),
IamRestRoutes.vendored().apiVersion(match.model())))
.orElse(RouteMembers.NONE);
}
/**
@@ -171,12 +171,20 @@ final class IamRestRoutes {
private final Map<String, Integer> accessDeniedStatuses;
/** The credential scopes a documented model routes. */
private final Set<String> documentedScopes;
/** Each botocore model's API version, by model. */
private final Map<String, String> apiVersions;
private IamRestRoutes(Map<String, Map<String, List<Route>>> routes, Map<String, Integer> accessDeniedStatuses,
Set<String> documentedScopes) {
Set<String> documentedScopes, Map<String, String> apiVersions) {
this.routes = routes;
this.accessDeniedStatuses = accessDeniedStatuses;
this.documentedScopes = documentedScopes;
this.apiVersions = apiVersions;
}
/** The API version of the botocore model of that name, null for a model the file does not give one. */
String apiVersion(String model) {
return model == null ? null : apiVersions.get(model);
}
/** The vendored routes. */
@@ -299,8 +307,12 @@ final class IamRestRoutes {
Map<String, Map<String, List<Route>>> routes = new HashMap<>();
Map<String, Integer> denialStatuses = new HashMap<>();
Set<String> documentedScopes = new HashSet<>();
Map<String, String> apiVersions = new HashMap<>();
models.properties().forEach(model -> {
String scope = model.getValue().path("credentialScope").asText("");
if (model.getValue().path("apiVersion").isTextual()) {
apiVersions.put(model.getKey(), model.getValue().path("apiVersion").asText());
}
JsonNode operations = model.getValue().path("operations");
if (scope.isEmpty() || !operations.isObject() || operations.isEmpty()) {
throw new IllegalStateException(RESOURCE_NAME + " gives model " + model.getKey()
@@ -375,7 +387,8 @@ final class IamRestRoutes {
byMethod.forEach((method, list) -> methods.put(method, List.copyOf(list)));
copied.put(scope, Map.copyOf(methods));
});
return new IamRestRoutes(Map.copyOf(copied), Map.copyOf(denialStatuses), Set.copyOf(documentedScopes));
return new IamRestRoutes(Map.copyOf(copied), Map.copyOf(denialStatuses), Set.copyOf(documentedScopes),
Map.copyOf(apiVersions));
}
/** The strings of a JSON array, none when it is missing. */
@@ -1298,6 +1298,103 @@
"ListStandardsControlAssociations",
"UpdateSecurityControl"
],
"ses": [
"ApplyTrackingConfigurationOverrides",
"CloneReceiptRuleSet",
"CreateConfigurationSetTrackingOptions",
"CreateExportJob",
"CreateImportJob",
"CreateMultiRegionEndpoint",
"CreateReceiptFilter",
"CreateReceiptRule",
"CreateReceiptRuleSet",
"CreateTemplate",
"DeleteConfigurationSetTrackingOptions",
"DeleteIdentity",
"DeleteIdentityPolicy",
"DeleteReceiptFilter",
"DeleteReceiptRule",
"DeleteReceiptRuleSet",
"DeleteTemplate",
"DeleteVerifiedEmailAddress",
"DescribeActiveReceiptRuleSet",
"DescribeConfigurationSet",
"DescribeReceiptRule",
"DescribeReceiptRuleSet",
"GetAccount",
"GetAccountSendingEnabled",
"GetBlacklistReports",
"GetDedicatedIp",
"GetDeliverabilityDashboardOptions",
"GetDomainDeliverabilityCampaign",
"GetEmailAddressInsights",
"GetIdentityDkimAttributes",
"GetIdentityMailFromDomainAttributes",
"GetIdentityNotificationAttributes",
"GetIdentityPolicies",
"GetIdentityVerificationAttributes",
"GetMessageInsights",
"GetSendQuota",
"GetSendStatistics",
"GetTemplate",
"ListAddonInstances",
"ListAddonSubscriptions",
"ListAddressLists",
"ListArchiveExports",
"ListArchiveSearches",
"ListArchives",
"ListConfigurationSets",
"ListContactLists",
"ListCustomVerificationEmailTemplates",
"ListDedicatedIpPools",
"ListDeliverabilityTestReports",
"ListDomainDeliverabilityCampaigns",
"ListEmailIdentities",
"ListEmailTemplates",
"ListExportJobs",
"ListIdentities",
"ListIdentityPolicies",
"ListImportJobs",
"ListIngressPoints",
"ListMultiRegionEndpoints",
"ListReceiptFilters",
"ListReceiptRuleSets",
"ListRelays",
"ListRuleSets",
"ListTemplates",
"ListTenants",
"ListTrafficPolicies",
"ListVerifiedEmailAddresses",
"PutAccountDedicatedIpWarmupAttributes",
"PutAccountDeliveryAttributes",
"PutAccountDetails",
"PutAccountPricingAttributes",
"PutAccountSendingAttributes",
"PutAccountSuppressionAttributes",
"PutAccountVdmAttributes",
"PutDedicatedIpWarmupAttributes",
"PutDeliverabilityDashboardOption",
"PutIdentityPolicy",
"ReorderReceiptRuleSet",
"SetActiveReceiptRuleSet",
"SetIdentityDkimEnabled",
"SetIdentityFeedbackForwardingEnabled",
"SetIdentityHeadersInNotificationsEnabled",
"SetIdentityMailFromDomain",
"SetIdentityNotificationTopic",
"SetReceiptRulePosition",
"TestRenderTemplate",
"UpdateAccountSendingEnabled",
"UpdateConfigurationSetReputationMetricsEnabled",
"UpdateConfigurationSetSendingEnabled",
"UpdateConfigurationSetTrackingOptions",
"UpdateReceiptRule",
"UpdateTemplate",
"VerifyDomainDkim",
"VerifyDomainIdentity",
"VerifyEmailAddress",
"VerifyEmailIdentity"
],
"signer": [
"GetSigningPlatform",
"ListSigningJobs",
File diff suppressed because it is too large. Load diff
+171
View File
@@ -1856,6 +1856,54 @@
"VerifyPinData": {"method": "POST", "requestUri": "/pindata/verify"}
}
},
"pinpoint-email": {
"credentialScope": "ses",
"apiVersion": "2018-07-26",
"operations": {
"CreateConfigurationSet": {"method": "POST", "requestUri": "/v1/email/configuration-sets"},
"CreateConfigurationSetEventDestination": {"method": "POST", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations"},
"CreateDedicatedIpPool": {"method": "POST", "requestUri": "/v1/email/dedicated-ip-pools"},
"CreateDeliverabilityTestReport": {"method": "POST", "requestUri": "/v1/email/deliverability-dashboard/test"},
"CreateEmailIdentity": {"method": "POST", "requestUri": "/v1/email/identities"},
"DeleteConfigurationSet": {"method": "DELETE", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}"},
"DeleteConfigurationSetEventDestination": {"method": "DELETE", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"},
"DeleteDedicatedIpPool": {"method": "DELETE", "requestUri": "/v1/email/dedicated-ip-pools/{PoolName}"},
"DeleteEmailIdentity": {"method": "DELETE", "requestUri": "/v1/email/identities/{EmailIdentity}"},
"GetAccount": {"method": "GET", "requestUri": "/v1/email/account"},
"GetBlacklistReports": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard/blacklist-report"},
"GetConfigurationSet": {"method": "GET", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}"},
"GetConfigurationSetEventDestinations": {"method": "GET", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations"},
"GetDedicatedIp": {"method": "GET", "requestUri": "/v1/email/dedicated-ips/{IP}"},
"GetDedicatedIps": {"method": "GET", "requestUri": "/v1/email/dedicated-ips"},
"GetDeliverabilityDashboardOptions": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard"},
"GetDeliverabilityTestReport": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard/test-reports/{ReportId}"},
"GetDomainDeliverabilityCampaign": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard/campaigns/{CampaignId}"},
"GetDomainStatisticsReport": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard/statistics-report/{Domain}"},
"GetEmailIdentity": {"method": "GET", "requestUri": "/v1/email/identities/{EmailIdentity}"},
"ListConfigurationSets": {"method": "GET", "requestUri": "/v1/email/configuration-sets"},
"ListDedicatedIpPools": {"method": "GET", "requestUri": "/v1/email/dedicated-ip-pools"},
"ListDeliverabilityTestReports": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard/test-reports"},
"ListDomainDeliverabilityCampaigns": {"method": "GET", "requestUri": "/v1/email/deliverability-dashboard/domains/{SubscribedDomain}/campaigns"},
"ListEmailIdentities": {"method": "GET", "requestUri": "/v1/email/identities"},
"ListTagsForResource": {"method": "GET", "requestUri": "/v1/email/tags"},
"PutAccountDedicatedIpWarmupAttributes": {"method": "PUT", "requestUri": "/v1/email/account/dedicated-ips/warmup"},
"PutAccountSendingAttributes": {"method": "PUT", "requestUri": "/v1/email/account/sending"},
"PutConfigurationSetDeliveryOptions": {"method": "PUT", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/delivery-options"},
"PutConfigurationSetReputationOptions": {"method": "PUT", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/reputation-options"},
"PutConfigurationSetSendingOptions": {"method": "PUT", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/sending"},
"PutConfigurationSetTrackingOptions": {"method": "PUT", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/tracking-options"},
"PutDedicatedIpInPool": {"method": "PUT", "requestUri": "/v1/email/dedicated-ips/{IP}/pool"},
"PutDedicatedIpWarmupAttributes": {"method": "PUT", "requestUri": "/v1/email/dedicated-ips/{IP}/warmup"},
"PutDeliverabilityDashboardOption": {"method": "PUT", "requestUri": "/v1/email/deliverability-dashboard"},
"PutEmailIdentityDkimAttributes": {"method": "PUT", "requestUri": "/v1/email/identities/{EmailIdentity}/dkim"},
"PutEmailIdentityFeedbackAttributes": {"method": "PUT", "requestUri": "/v1/email/identities/{EmailIdentity}/feedback"},
"PutEmailIdentityMailFromAttributes": {"method": "PUT", "requestUri": "/v1/email/identities/{EmailIdentity}/mail-from"},
"SendEmail": {"method": "POST", "requestUri": "/v1/email/outbound-emails"},
"TagResource": {"method": "POST", "requestUri": "/v1/email/tags"},
"UntagResource": {"method": "DELETE", "requestUri": "/v1/email/tags"},
"UpdateConfigurationSetEventDestination": {"method": "PUT", "requestUri": "/v1/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"}
}
},
"pipes": {
"credentialScope": "pipes",
"apiVersion": "2015-10-07",
@@ -2846,6 +2894,129 @@
"UpdateStandardsControl": {"method": "PATCH", "requestUri": "/standards/control/{StandardsControlArn+}"}
}
},
"sesv2": {
"credentialScope": "ses",
"apiVersion": "2019-09-27",
"operations": {
"AssociateEmailIdentityCertificate": {"method": "POST", "requestUri": "/v2/email/identity/certificates"},
"BatchGetMetricData": {"method": "POST", "requestUri": "/v2/email/metrics/batch"},
"CancelExportJob": {"method": "PUT", "requestUri": "/v2/email/export-jobs/{JobId}/cancel"},
"CreateConfigurationSet": {"method": "POST", "requestUri": "/v2/email/configuration-sets"},
"CreateConfigurationSetEventDestination": {"method": "POST", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations"},
"CreateContact": {"method": "POST", "requestUri": "/v2/email/contact-lists/{ContactListName}/contacts"},
"CreateContactList": {"method": "POST", "requestUri": "/v2/email/contact-lists"},
"CreateCustomVerificationEmailTemplate": {"method": "POST", "requestUri": "/v2/email/custom-verification-email-templates"},
"CreateDedicatedIpPool": {"method": "POST", "requestUri": "/v2/email/dedicated-ip-pools"},
"CreateDeliverabilityTestReport": {"method": "POST", "requestUri": "/v2/email/deliverability-dashboard/test"},
"CreateEmailIdentity": {"method": "POST", "requestUri": "/v2/email/identities"},
"CreateEmailIdentityPolicy": {"method": "POST", "requestUri": "/v2/email/identities/{EmailIdentity}/policies/{PolicyName}"},
"CreateEmailTemplate": {"method": "POST", "requestUri": "/v2/email/templates"},
"CreateExportJob": {"method": "POST", "requestUri": "/v2/email/export-jobs"},
"CreateImportJob": {"method": "POST", "requestUri": "/v2/email/import-jobs"},
"CreateMultiRegionEndpoint": {"method": "POST", "requestUri": "/v2/email/multi-region-endpoints"},
"CreateTenant": {"method": "POST", "requestUri": "/v2/email/tenants"},
"CreateTenantResourceAssociation": {"method": "POST", "requestUri": "/v2/email/tenants/resources"},
"DeleteConfigurationSet": {"method": "DELETE", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}"},
"DeleteConfigurationSetEventDestination": {"method": "DELETE", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"},
"DeleteContact": {"method": "DELETE", "requestUri": "/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}"},
"DeleteContactList": {"method": "DELETE", "requestUri": "/v2/email/contact-lists/{ContactListName}"},
"DeleteCustomVerificationEmailTemplate": {"method": "DELETE", "requestUri": "/v2/email/custom-verification-email-templates/{TemplateName}"},
"DeleteDedicatedIpPool": {"method": "DELETE", "requestUri": "/v2/email/dedicated-ip-pools/{PoolName}"},
"DeleteEmailIdentity": {"method": "DELETE", "requestUri": "/v2/email/identities/{EmailIdentity}"},
"DeleteEmailIdentityPolicy": {"method": "DELETE", "requestUri": "/v2/email/identities/{EmailIdentity}/policies/{PolicyName}"},
"DeleteEmailTemplate": {"method": "DELETE", "requestUri": "/v2/email/templates/{TemplateName}"},
"DeleteMultiRegionEndpoint": {"method": "DELETE", "requestUri": "/v2/email/multi-region-endpoints/{EndpointName}"},
"DeleteSuppressedDestination": {"method": "DELETE", "requestUri": "/v2/email/suppression/addresses/{EmailAddress}"},
"DeleteTenant": {"method": "POST", "requestUri": "/v2/email/tenants/delete"},
"DeleteTenantResourceAssociation": {"method": "POST", "requestUri": "/v2/email/tenants/resources/delete"},
"DisassociateEmailIdentityCertificate": {"method": "POST", "requestUri": "/v2/email/identity/certificates/delete"},
"GetAccount": {"method": "GET", "requestUri": "/v2/email/account"},
"GetBlacklistReports": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard/blacklist-report"},
"GetConfigurationSet": {"method": "GET", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}"},
"GetConfigurationSetEventDestinations": {"method": "GET", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations"},
"GetContact": {"method": "GET", "requestUri": "/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}"},
"GetContactList": {"method": "GET", "requestUri": "/v2/email/contact-lists/{ContactListName}"},
"GetCustomVerificationEmailTemplate": {"method": "GET", "requestUri": "/v2/email/custom-verification-email-templates/{TemplateName}"},
"GetDedicatedIp": {"method": "GET", "requestUri": "/v2/email/dedicated-ips/{IP}"},
"GetDedicatedIpPool": {"method": "GET", "requestUri": "/v2/email/dedicated-ip-pools/{PoolName}"},
"GetDedicatedIps": {"method": "GET", "requestUri": "/v2/email/dedicated-ips"},
"GetDeliverabilityDashboardOptions": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard"},
"GetDeliverabilityTestReport": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard/test-reports/{ReportId}"},
"GetDomainDeliverabilityCampaign": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard/campaigns/{CampaignId}"},
"GetDomainStatisticsReport": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard/statistics-report/{Domain}"},
"GetEmailAddressInsights": {"method": "POST", "requestUri": "/v2/email/email-address-insights/"},
"GetEmailIdentity": {"method": "GET", "requestUri": "/v2/email/identities/{EmailIdentity}"},
"GetEmailIdentityPolicies": {"method": "GET", "requestUri": "/v2/email/identities/{EmailIdentity}/policies"},
"GetEmailTemplate": {"method": "GET", "requestUri": "/v2/email/templates/{TemplateName}"},
"GetExportJob": {"method": "GET", "requestUri": "/v2/email/export-jobs/{JobId}"},
"GetImportJob": {"method": "GET", "requestUri": "/v2/email/import-jobs/{JobId}"},
"GetMessageInsights": {"method": "GET", "requestUri": "/v2/email/insights/{MessageId}/"},
"GetMultiRegionEndpoint": {"method": "GET", "requestUri": "/v2/email/multi-region-endpoints/{EndpointName}"},
"GetReputationEntity": {"method": "GET", "requestUri": "/v2/email/reputation/entities/{ReputationEntityType}/{ReputationEntityReference}"},
"GetSuppressedDestination": {"method": "GET", "requestUri": "/v2/email/suppression/addresses/{EmailAddress}"},
"GetTenant": {"method": "POST", "requestUri": "/v2/email/tenants/get"},
"ListConfigurationSets": {"method": "POST", "requestUri": "/v2/email/list-configuration-sets"},
"ListContactLists": {"method": "GET", "requestUri": "/v2/email/contact-lists"},
"ListContacts": {"method": "POST", "requestUri": "/v2/email/contact-lists/{ContactListName}/contacts/list"},
"ListCustomVerificationEmailTemplates": {"method": "GET", "requestUri": "/v2/email/custom-verification-email-templates"},
"ListDedicatedIpPools": {"method": "GET", "requestUri": "/v2/email/dedicated-ip-pools"},
"ListDeliverabilityTestReports": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard/test-reports"},
"ListDomainDeliverabilityCampaigns": {"method": "GET", "requestUri": "/v2/email/deliverability-dashboard/domains/{SubscribedDomain}/campaigns"},
"ListEmailIdentities": {"method": "POST", "requestUri": "/v2/email/list-identities"},
"ListEmailIdentityCertificates": {"method": "POST", "requestUri": "/v2/email/identity/certificates/list"},
"ListEmailTemplates": {"method": "GET", "requestUri": "/v2/email/templates"},
"ListExportJobs": {"method": "POST", "requestUri": "/v2/email/list-export-jobs"},
"ListImportJobs": {"method": "POST", "requestUri": "/v2/email/import-jobs/list"},
"ListMultiRegionEndpoints": {"method": "GET", "requestUri": "/v2/email/multi-region-endpoints"},
"ListRecommendations": {"method": "POST", "requestUri": "/v2/email/vdm/recommendations"},
"ListReputationEntities": {"method": "POST", "requestUri": "/v2/email/reputation/entities"},
"ListResourceTenants": {"method": "POST", "requestUri": "/v2/email/resources/tenants/list"},
"ListSuppressedDestinations": {"method": "GET", "requestUri": "/v2/email/suppression/addresses"},
"ListTagsForResource": {"method": "GET", "requestUri": "/v2/email/tags"},
"ListTenantResources": {"method": "POST", "requestUri": "/v2/email/tenants/resources/list"},
"ListTenants": {"method": "POST", "requestUri": "/v2/email/tenants/list"},
"PutAccountDedicatedIpWarmupAttributes": {"method": "PUT", "requestUri": "/v2/email/account/dedicated-ips/warmup"},
"PutAccountDeliveryAttributes": {"method": "POST", "requestUri": "/v2/email/account/delivery"},
"PutAccountDetails": {"method": "POST", "requestUri": "/v2/email/account/details"},
"PutAccountPricingAttributes": {"method": "PUT", "requestUri": "/v2/email/account/pricing-attributes"},
"PutAccountSendingAttributes": {"method": "PUT", "requestUri": "/v2/email/account/sending"},
"PutAccountSuppressionAttributes": {"method": "PUT", "requestUri": "/v2/email/account/suppression"},
"PutAccountVdmAttributes": {"method": "PUT", "requestUri": "/v2/email/account/vdm"},
"PutConfigurationSetArchivingOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/archiving-options"},
"PutConfigurationSetDeliveryOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/delivery-options"},
"PutConfigurationSetReputationOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/reputation-options"},
"PutConfigurationSetSendingOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/sending"},
"PutConfigurationSetSuppressionOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/suppression-options"},
"PutConfigurationSetTrackingOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/tracking-options"},
"PutConfigurationSetVdmOptions": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/vdm-options"},
"PutDedicatedIpInPool": {"method": "PUT", "requestUri": "/v2/email/dedicated-ips/{IP}/pool"},
"PutDedicatedIpPoolScalingAttributes": {"method": "PUT", "requestUri": "/v2/email/dedicated-ip-pools/{PoolName}/scaling"},
"PutDedicatedIpWarmupAttributes": {"method": "PUT", "requestUri": "/v2/email/dedicated-ips/{IP}/warmup"},
"PutDeliverabilityDashboardOption": {"method": "PUT", "requestUri": "/v2/email/deliverability-dashboard"},
"PutEmailIdentityConfigurationSetAttributes": {"method": "PUT", "requestUri": "/v2/email/identities/{EmailIdentity}/configuration-set"},
"PutEmailIdentityDkimAttributes": {"method": "PUT", "requestUri": "/v2/email/identities/{EmailIdentity}/dkim"},
"PutEmailIdentityDkimSigningAttributes": {"method": "PUT", "requestUri": "/v2/email/identities/{EmailIdentity}/dkim/signing"},
"PutEmailIdentityFeedbackAttributes": {"method": "PUT", "requestUri": "/v2/email/identities/{EmailIdentity}/feedback"},
"PutEmailIdentityMailFromAttributes": {"method": "PUT", "requestUri": "/v2/email/identities/{EmailIdentity}/mail-from"},
"PutSuppressedDestination": {"method": "PUT", "requestUri": "/v2/email/suppression/addresses"},
"PutTenantSuppressionAttributes": {"method": "POST", "requestUri": "/v2/email/tenant/suppression"},
"SendBulkEmail": {"method": "POST", "requestUri": "/v2/email/outbound-bulk-emails"},
"SendCustomVerificationEmail": {"method": "POST", "requestUri": "/v2/email/outbound-custom-verification-emails"},
"SendEmail": {"method": "POST", "requestUri": "/v2/email/outbound-emails"},
"TagResource": {"method": "POST", "requestUri": "/v2/email/tags"},
"TestRenderEmailTemplate": {"method": "POST", "requestUri": "/v2/email/templates/{TemplateName}/render"},
"UntagResource": {"method": "DELETE", "requestUri": "/v2/email/tags"},
"UpdateConfigurationSet": {"method": "POST", "requestUri": "/v2/email/update-configuration-sets"},
"UpdateConfigurationSetEventDestination": {"method": "PUT", "requestUri": "/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}"},
"UpdateContact": {"method": "PUT", "requestUri": "/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}"},
"UpdateContactList": {"method": "PUT", "requestUri": "/v2/email/contact-lists/{ContactListName}"},
"UpdateCustomVerificationEmailTemplate": {"method": "PUT", "requestUri": "/v2/email/custom-verification-email-templates/{TemplateName}"},
"UpdateEmailIdentityPolicy": {"method": "PUT", "requestUri": "/v2/email/identities/{EmailIdentity}/policies/{PolicyName}"},
"UpdateEmailTemplate": {"method": "PUT", "requestUri": "/v2/email/templates/{TemplateName}"},
"UpdateReputationEntityCustomerManagedStatus": {"method": "PUT", "requestUri": "/v2/email/reputation/entities/{ReputationEntityType}/{ReputationEntityReference}/customer-managed-status"},
"UpdateReputationEntityPolicy": {"method": "PUT", "requestUri": "/v2/email/reputation/entities/{ReputationEntityType}/{ReputationEntityReference}/policy"}
}
},
"signer": {
"credentialScope": "signer",
"apiVersion": "2017-08-25",
@@ -318,7 +318,7 @@ class RequestResourceMembersTest {
null, Map.of(), false, List.of(), null, new Member("SessionId", false));
for (String operation : List.of("ExecuteStatement", "BatchExecuteStatement")) {
assertEquals(session, RequestResourceMembers.table().operations().get("redshift-data:" + operation)
.getLast(), operation);
.getLast().withApis(List.of()), operation);
}
assertTrue(RequestResourceMembers.table().operations().get("redshift-data:ListSessions").isEmpty());
String formats = "\"arnFormats\":{\"a\":{\"cluster\":\"arn:${Partition}:a:${Region}:${Account}:cluster:${Name}\","
@@ -936,6 +936,34 @@ class RequestResourceMembersTest {
}
/** The request as the service of the endpoint prefix serves it; as no known service when there is none. */
/**
* A request is read for the members of its own API alone: SES v1's and v2's {@code SendEmail} share the operation,
* and a Query request naming {@code 2010-12-01} is read for v1's {@code SourceArn}, never v2's
* {@code FromEmailAddressIdentityArn}, whatever its form carries; one whose API is not known is read for both.
*/
@Test
void aRequestIsReadForTheMembersOfItsOwnApi() {
String a = "arn:aws:ses:us-east-1:000000000000:identity/a@example.com";
String b = "arn:aws:ses:us-east-1:000000000000:identity/b@example.com";
String body = "Action=SendEmail&Version=2010-12-01&SourceArn=" + encoded(a) + "&FromEmailAddressIdentityArn="
+ encoded(b);
ContainerRequestContext query = form(body);
ServiceDescriptor ses = new ServiceDescriptor("ses", "ses", true, true, null, null, 0L, null,
ServiceProtocol.QUERY, Set.of(ServiceProtocol.QUERY), Set.of(), Set.of(), Set.of(), Set.of(), Set.of());
when(query.getProperty(AwsProtocolClaimFilter.CLAIM_PROPERTY))
.thenReturn(new ProtocolClaim(WireProtocol.AWS_QUERY, ses, "SendEmail", null));
assertEquals(List.of(a), RequestResources.of("ses:SendEmail", query, "aws", "us-east-1", "000000000000"));
assertEquals(Set.of(a, b), Set.copyOf(RequestResources.of("ses:SendEmail", form(body), "aws", "us-east-1",
"000000000000")));
// A Query version no row is read for names nothing apart: the request is read for every row.
ContainerRequestContext other = form(body.replace("2010-12-01", "2011-01-01"));
when(other.getProperty(AwsProtocolClaimFilter.CLAIM_PROPERTY))
.thenReturn(new ProtocolClaim(WireProtocol.AWS_QUERY, ses, "SendEmail", null));
assertEquals(Set.of(a, b), Set.copyOf(RequestResources.of("ses:SendEmail", other, "aws", "us-east-1",
"000000000000")));
}
static ContainerRequestContext servedBy(ContainerRequestContext request, String endpoint) {
if (endpoint != null) {
ServiceDescriptor service = new ServiceDescriptor(endpoint, endpoint, true, true, null, null, 0L, null,
@@ -14,7 +14,6 @@ import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveContainerRequestCo
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;
import org.junit.jupiter.params.provider.CsvSource;
import org.mockito.Mockito;
@@ -477,22 +476,15 @@ class IamActionRegistryTest {
}
/**
* The table is generated from the SES v2 model and AWS's service reference, not from the rule
* table, so it checks the rules rather than restating them: each operation's path has to
* resolve to the action AWS lists for it, and to no other operation's.
* SES v2 is routed by its vendored model, every route checked as its operation's action by the route coverage
* test: a route names its whole path, not one below it. {@code ListConfigurationSets} is
* {@code POST /v2/email/list-configuration-sets} there; the {@code GET /v2/email/configuration-sets} an SDK built
* before the model moved it still sends matches no route, so it is not checked.
*/
@ParameterizedTest(name = "{0}")
@CsvFileSource(resources = "/iam/sesv2-operation-actions.csv")
void resolvesEverySesV2OperationToItsAction(String operation, String method, String path, String action) {
assertEquals(action, registry.resolve("ses",
mockCtx(method, path, new MultivaluedHashMap<>(), MediaType.APPLICATION_JSON_TYPE, "{}")));
}
@Test
void sesV2RulesMatchTheWholePath() {
// A rule for /v2/email/configuration-sets must not also claim a path below it.
void sesV2IsRoutedByItsModelsWholePaths() {
assertEquals("ses:ListConfigurationSets", registry.resolve("ses",
mockCtx("GET", "/v2/email/configuration-sets", new MultivaluedHashMap<>(),
mockCtx("POST", "/v2/email/list-configuration-sets", new MultivaluedHashMap<>(),
MediaType.APPLICATION_JSON_TYPE, "{}")));
assertEquals("ses:GetConfigurationSetEventDestinations", registry.resolve("ses",
mockCtx("GET", "/v2/email/configuration-sets/my-set/event-destinations/", new MultivaluedHashMap<>(),
@@ -500,6 +492,9 @@ class IamActionRegistryTest {
assertNull(registry.resolve("ses",
mockCtx("GET", "/v2/email/configuration-sets/my-set/unknown", new MultivaluedHashMap<>(),
MediaType.APPLICATION_JSON_TYPE, "{}")));
assertNull(registry.resolve("ses",
mockCtx("GET", "/v2/email/configuration-sets", new MultivaluedHashMap<>(),
MediaType.APPLICATION_JSON_TYPE, "{}")));
}
@Test
@@ -160,6 +160,25 @@ class IamRequestResourceEnforcementIntegrationTest {
refused(configureHealthCheck(user, otherLoadBalancer), "elasticloadbalancing:ConfigureHealthCheck");
}
/**
* A Query request's API is the {@code Version} its handler dispatches it by, its form's on a POST: one naming the
* v2 version only in its URL runs as the classic API, so it is checked on the classic load balancer its
* {@code LoadBalancerName} names, and a grant on a v2 load balancer's ARN does not delete that one.
*/
@Test
void aQueryRequestsApiIsTheVersionItsFormNames() {
String name = classicLoadBalancer("data");
String v2 = ELB + "loadbalancer/app/res-v2/0123456789abcdef";
User user = user("res-elb-version");
user.policy(allowOn("elasticloadbalancing:DeleteLoadBalancer", v2));
refused(user.query("elasticloadbalancing", "DeleteLoadBalancer").queryParam("Version", "2015-12-01")
.formParam("LoadBalancerName", name).formParam("LoadBalancerArn", v2).post("/").then(),
"elasticloadbalancing:DeleteLoadBalancer");
admin("elasticloadbalancing").formParam("Action", "DescribeLoadBalancers").formParam("Version", "2012-06-01")
.formParam("LoadBalancerNames.member.1", name).post("/").then().statusCode(200)
.body(containsString(name));
}
/** An IP target group an administrator creates, deleted after the test; its ARN. */
private String elbTargetGroup() {
String arn = admin("elasticloadbalancing").formParam("Action", "CreateTargetGroup")
@@ -242,8 +261,9 @@ class IamRequestResourceEnforcementIntegrationTest {
/**
* A v2 {@code CreateLoadBalancer} of a {@code Type} outside the enum names no v2 load balancer for IAM to check,
* and Elastic Load Balancing refuses it, as AWS does, so a grant on a classic load balancer's name does not
* create a v2 one under another.
* and a v2 request is never read for the classic API's {@code LoadBalancerName}, which only a classic request has
* (the table's rows name the API they are read for), so a grant on a classic load balancer's name does not create
* a v2 one under another: the request is checked on {@code *} and refused.
*/
@Test
void aLoadBalancerOfATypeOutsideTheEnumIsNotCreatedUnderAnotherName() {
@@ -253,8 +273,7 @@ class IamRequestResourceEnforcementIntegrationTest {
user.query("elasticloadbalancing", "CreateLoadBalancer").formParam("Version", "2015-12-01")
.formParam("Name", name).formParam("Type", "other").formParam("LoadBalancerName", "res-allowed")
.formParam("Subnets.member.1", "subnet-a").formParam("Subnets.member.2", "subnet-b").post("/").then()
.statusCode(400).body(containsString("ValidationError"))
.body(containsString("Member must satisfy enum value set: [application, network, gateway]"));
.statusCode(403).body(containsString("elasticloadbalancing:CreateLoadBalancer"));
admin("elasticloadbalancing").formParam("Action", "DescribeLoadBalancers").formParam("Version", "2015-12-01")
.post("/").then().statusCode(200).body(not(containsString(name)));
}
@@ -19,7 +19,8 @@ import static org.hamcrest.Matchers.equalTo;
/**
* With {@code iam.enforcement-enabled=true}, SES v2 calls are authorized against their {@code ses:}
* action like any other request, instead of resolving to no action and passing unchecked.
* action like any other request, instead of resolving to no action and passing unchecked, by the
* routes of the vendored SES v2 model, and on the resources the generated table reads from them.
*/
@QuarkusTest
@TestProfile(IamEnforcementProfile.class)
@@ -94,6 +95,77 @@ class SesV2IamEnforcementIntegrationTest {
.when().delete("/v2/email/suppression/addresses/a%2Fb@example.com"));
}
/**
* A v2 request is checked on the resource the generated table of request resources reads from it, as AWS checks
* it: a grant on one configuration set reaches that set and no other.
*/
@Test
void aConfigurationSetGrantReachesThatSetAlone() {
String allowed = createConfigurationSet();
String other = createConfigurationSet();
String accessKeyId = userWithPolicy("""
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ses:GetConfigurationSet",
"Resource":"arn:aws:ses:us-east-1:%s:configuration-set/%s"}]}""".formatted(ACCOUNT, allowed));
given().header("Authorization", auth(accessKeyId, "ses"))
.when().get("/v2/email/configuration-sets/" + allowed).then().statusCode(200);
assertAccessDenied(given().header("Authorization", auth(accessKeyId, "ses"))
.when().get("/v2/email/configuration-sets/" + other));
}
/** So is a v1 Query request, by the members its {@code Action}'s request names. */
@Test
void aV1RequestIsCheckedOnTheConfigurationSetItNames() {
String allowed = createConfigurationSet();
String other = createConfigurationSet();
String accessKeyId = userWithPolicy("""
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ses:DeleteConfigurationSet",
"Resource":"arn:aws:ses:us-east-1:%s:configuration-set/%s"}]}""".formatted(ACCOUNT, allowed));
deleteConfigurationSetV1(accessKeyId, other).then().statusCode(403);
deleteConfigurationSetV1(accessKeyId, allowed).then().statusCode(200);
}
/**
* A v2 send is read for v2's members alone: a {@code SourceArn}, which only SES v1's request has, names nothing in
* it, so a grant on one identity does not reach a send from another by adding one.
*/
@Test
void aV2SendIsNotReadForV1sSourceArn() {
String granted = identity();
String other = identity();
String accessKeyId = userWithPolicy("""
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ses:SendEmail",
"Resource":"arn:aws:ses:us-east-1:%s:identity/%s"}]}""".formatted(ACCOUNT, granted));
assertAccessDenied(given()
.contentType("application/json")
.header("Authorization", auth(accessKeyId, "ses"))
.body("""
{"FromEmailAddress":"%s","Destination":{"ToAddresses":["to@example.com"]},
"Content":{"Simple":{"Subject":{"Data":"s"},"Body":{"Text":{"Data":"b"}}}},
"SourceArn":"arn:aws:ses:us-east-1:%s:identity/%s"}""".formatted(other, ACCOUNT, granted))
.when().post("/v2/email/outbound-emails"));
}
private static String identity() {
String identity = "sesv2-iam-" + UUID.randomUUID().toString().substring(0, 8) + "@example.com";
given()
.contentType("application/json")
.header("Authorization", auth(ACCOUNT, "ses"))
.body("{\"EmailIdentity\":\"" + identity + "\"}")
.when().post("/v2/email/identities")
.then().statusCode(200);
return identity;
}
private static Response deleteConfigurationSetV1(String accessKeyId, String configurationSet) {
return given()
.formParam("Action", "DeleteConfigurationSet").formParam("ConfigurationSetName", configurationSet)
.header("Authorization", auth(accessKeyId, "ses"))
.when().post("/");
}
/** SES v2 API Reference, common errors: {@code AccessDeniedException}, HTTP 403. */
private static void assertAccessDenied(Response response) {
response.then().statusCode(403).body("__type", equalTo("AccessDeniedException"));
@@ -1,124 +0,0 @@
# Every SES v2 operation: a sample of its path from the SES v2 model (botocore develop at
# 9931e9741, 2026-09-29, sesv2/2019-09-27) and the IAM action AWS's service reference lists for it
# (https://servicereference.us-east-1.amazonaws.com/v1/ses/ses.json, read 2026-10-01).
# ListConfigurationSets and ListEmailIdentities also keep the GET routes earlier models gave them.
# SendEmail has no entry there; the Service Authorization Reference's SES v2 page defines
# ses:SendEmail as v2's only send action (ses:SendRawEmail belongs to v1).
GetAccount,GET,/v2/email/account,ses:GetAccount
PutAccountDedicatedIpWarmupAttributes,PUT,/v2/email/account/dedicated-ips/warmup,ses:PutAccountDedicatedIpWarmupAttributes
PutAccountDetails,POST,/v2/email/account/details,ses:PutAccountDetails
PutAccountPricingAttributes,PUT,/v2/email/account/pricing-attributes,ses:PutAccountPricingAttributes
PutAccountSendingAttributes,PUT,/v2/email/account/sending,ses:PutAccountSendingAttributes
PutAccountSuppressionAttributes,PUT,/v2/email/account/suppression,ses:PutAccountSuppressionAttributes
PutAccountVdmAttributes,PUT,/v2/email/account/vdm,ses:PutAccountVdmAttributes
ListConfigurationSets,GET,/v2/email/configuration-sets,ses:ListConfigurationSets
CreateConfigurationSet,POST,/v2/email/configuration-sets,ses:CreateConfigurationSet
DeleteConfigurationSet,DELETE,/v2/email/configuration-sets/sample-configurationsetname,ses:DeleteConfigurationSet
GetConfigurationSet,GET,/v2/email/configuration-sets/sample-configurationsetname,ses:GetConfigurationSet
PutConfigurationSetArchivingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/archiving-options,ses:PutConfigurationSetArchivingOptions
PutConfigurationSetDeliveryOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/delivery-options,ses:PutConfigurationSetDeliveryOptions
GetConfigurationSetEventDestinations,GET,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:GetConfigurationSetEventDestinations
CreateConfigurationSetEventDestination,POST,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:CreateConfigurationSetEventDestination
DeleteConfigurationSetEventDestination,DELETE,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:DeleteConfigurationSetEventDestination
UpdateConfigurationSetEventDestination,PUT,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:UpdateConfigurationSetEventDestination
PutConfigurationSetReputationOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/reputation-options,ses:PutConfigurationSetReputationOptions
PutConfigurationSetSendingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/sending,ses:PutConfigurationSetSendingOptions
PutConfigurationSetSuppressionOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/suppression-options,ses:PutConfigurationSetSuppressionOptions
PutConfigurationSetTrackingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/tracking-options,ses:PutConfigurationSetTrackingOptions
PutConfigurationSetVdmOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/vdm-options,ses:PutConfigurationSetVdmOptions
ListContactLists,GET,/v2/email/contact-lists,ses:ListContactLists
CreateContactList,POST,/v2/email/contact-lists,ses:CreateContactList
DeleteContactList,DELETE,/v2/email/contact-lists/sample-contactlistname,ses:DeleteContactList
GetContactList,GET,/v2/email/contact-lists/sample-contactlistname,ses:GetContactList
UpdateContactList,PUT,/v2/email/contact-lists/sample-contactlistname,ses:UpdateContactList
CreateContact,POST,/v2/email/contact-lists/sample-contactlistname/contacts,ses:CreateContact
ListContacts,POST,/v2/email/contact-lists/sample-contactlistname/contacts/list,ses:ListContacts
DeleteContact,DELETE,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:DeleteContact
GetContact,GET,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:GetContact
UpdateContact,PUT,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:UpdateContact
ListCustomVerificationEmailTemplates,GET,/v2/email/custom-verification-email-templates,ses:ListCustomVerificationEmailTemplates
CreateCustomVerificationEmailTemplate,POST,/v2/email/custom-verification-email-templates,ses:CreateCustomVerificationEmailTemplate
DeleteCustomVerificationEmailTemplate,DELETE,/v2/email/custom-verification-email-templates/sample-templatename,ses:DeleteCustomVerificationEmailTemplate
GetCustomVerificationEmailTemplate,GET,/v2/email/custom-verification-email-templates/sample-templatename,ses:GetCustomVerificationEmailTemplate
UpdateCustomVerificationEmailTemplate,PUT,/v2/email/custom-verification-email-templates/sample-templatename,ses:UpdateCustomVerificationEmailTemplate
ListDedicatedIpPools,GET,/v2/email/dedicated-ip-pools,ses:ListDedicatedIpPools
CreateDedicatedIpPool,POST,/v2/email/dedicated-ip-pools,ses:CreateDedicatedIpPool
DeleteDedicatedIpPool,DELETE,/v2/email/dedicated-ip-pools/sample-poolname,ses:DeleteDedicatedIpPool
GetDedicatedIpPool,GET,/v2/email/dedicated-ip-pools/sample-poolname,ses:GetDedicatedIpPool
PutDedicatedIpPoolScalingAttributes,PUT,/v2/email/dedicated-ip-pools/sample-poolname/scaling,ses:PutDedicatedIpPoolScalingAttributes
GetDedicatedIps,GET,/v2/email/dedicated-ips,ses:GetDedicatedIps
GetDedicatedIp,GET,/v2/email/dedicated-ips/sample-ip,ses:GetDedicatedIp
PutDedicatedIpInPool,PUT,/v2/email/dedicated-ips/sample-ip/pool,ses:PutDedicatedIpInPool
PutDedicatedIpWarmupAttributes,PUT,/v2/email/dedicated-ips/sample-ip/warmup,ses:PutDedicatedIpWarmupAttributes
GetDeliverabilityDashboardOptions,GET,/v2/email/deliverability-dashboard,ses:GetDeliverabilityDashboardOptions
PutDeliverabilityDashboardOption,PUT,/v2/email/deliverability-dashboard,ses:PutDeliverabilityDashboardOption
GetBlacklistReports,GET,/v2/email/deliverability-dashboard/blacklist-report,ses:GetBlacklistReports
GetDomainDeliverabilityCampaign,GET,/v2/email/deliverability-dashboard/campaigns/sample-campaignid,ses:GetDomainDeliverabilityCampaign
ListDomainDeliverabilityCampaigns,GET,/v2/email/deliverability-dashboard/domains/sample-subscribeddomain/campaigns,ses:ListDomainDeliverabilityCampaigns
GetDomainStatisticsReport,GET,/v2/email/deliverability-dashboard/statistics-report/sample-domain,ses:GetDomainStatisticsReport
CreateDeliverabilityTestReport,POST,/v2/email/deliverability-dashboard/test,ses:CreateDeliverabilityTestReport
ListDeliverabilityTestReports,GET,/v2/email/deliverability-dashboard/test-reports,ses:ListDeliverabilityTestReports
GetDeliverabilityTestReport,GET,/v2/email/deliverability-dashboard/test-reports/sample-reportid,ses:GetDeliverabilityTestReport
GetEmailAddressInsights,POST,/v2/email/email-address-insights/,ses:GetEmailAddressInsights
CreateExportJob,POST,/v2/email/export-jobs,ses:CreateExportJob
GetExportJob,GET,/v2/email/export-jobs/sample-jobid,ses:GetExportJob
CancelExportJob,PUT,/v2/email/export-jobs/sample-jobid/cancel,ses:CancelExportJob
ListEmailIdentities,GET,/v2/email/identities,ses:ListEmailIdentities
CreateEmailIdentity,POST,/v2/email/identities,ses:CreateEmailIdentity
DeleteEmailIdentity,DELETE,/v2/email/identities/sample-emailidentity,ses:DeleteEmailIdentity
GetEmailIdentity,GET,/v2/email/identities/sample-emailidentity,ses:GetEmailIdentity
PutEmailIdentityConfigurationSetAttributes,PUT,/v2/email/identities/sample-emailidentity/configuration-set,ses:PutEmailIdentityConfigurationSetAttributes
PutEmailIdentityDkimAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim,ses:PutEmailIdentityDkimAttributes
PutEmailIdentityDkimSigningAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim/signing,ses:PutEmailIdentityDkimSigningAttributes
PutEmailIdentityFeedbackAttributes,PUT,/v2/email/identities/sample-emailidentity/feedback,ses:PutEmailIdentityFeedbackAttributes
PutEmailIdentityMailFromAttributes,PUT,/v2/email/identities/sample-emailidentity/mail-from,ses:PutEmailIdentityMailFromAttributes
GetEmailIdentityPolicies,GET,/v2/email/identities/sample-emailidentity/policies,ses:GetEmailIdentityPolicies
DeleteEmailIdentityPolicy,DELETE,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:DeleteEmailIdentityPolicy
CreateEmailIdentityPolicy,POST,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:CreateEmailIdentityPolicy
UpdateEmailIdentityPolicy,PUT,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:UpdateEmailIdentityPolicy
AssociateEmailIdentityCertificate,POST,/v2/email/identity/certificates,ses:AssociateEmailIdentityCertificate
DisassociateEmailIdentityCertificate,POST,/v2/email/identity/certificates/delete,ses:DisassociateEmailIdentityCertificate
ListEmailIdentityCertificates,POST,/v2/email/identity/certificates/list,ses:ListEmailIdentityCertificates
CreateImportJob,POST,/v2/email/import-jobs,ses:CreateImportJob
ListImportJobs,POST,/v2/email/import-jobs/list,ses:ListImportJobs
GetImportJob,GET,/v2/email/import-jobs/sample-jobid,ses:GetImportJob
GetMessageInsights,GET,/v2/email/insights/sample-messageid/,ses:GetMessageInsights
ListConfigurationSets,POST,/v2/email/list-configuration-sets,ses:ListConfigurationSets
ListExportJobs,POST,/v2/email/list-export-jobs,ses:ListExportJobs
ListEmailIdentities,POST,/v2/email/list-identities,ses:ListEmailIdentities
BatchGetMetricData,POST,/v2/email/metrics/batch,ses:BatchGetMetricData
ListMultiRegionEndpoints,GET,/v2/email/multi-region-endpoints,ses:ListMultiRegionEndpoints
CreateMultiRegionEndpoint,POST,/v2/email/multi-region-endpoints,ses:CreateMultiRegionEndpoint
DeleteMultiRegionEndpoint,DELETE,/v2/email/multi-region-endpoints/sample-endpointname,ses:DeleteMultiRegionEndpoint
GetMultiRegionEndpoint,GET,/v2/email/multi-region-endpoints/sample-endpointname,ses:GetMultiRegionEndpoint
SendBulkEmail,POST,/v2/email/outbound-bulk-emails,ses:SendBulkEmail
SendCustomVerificationEmail,POST,/v2/email/outbound-custom-verification-emails,ses:SendCustomVerificationEmail
SendEmail,POST,/v2/email/outbound-emails,ses:SendEmail
ListReputationEntities,POST,/v2/email/reputation/entities,ses:ListReputationEntities
GetReputationEntity,GET,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference,ses:GetReputationEntity
UpdateReputationEntityCustomerManagedStatus,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/customer-managed-status,ses:UpdateReputationEntityCustomerManagedStatus
UpdateReputationEntityPolicy,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/policy,ses:UpdateReputationEntityPolicy
ListResourceTenants,POST,/v2/email/resources/tenants/list,ses:ListResourceTenants
ListSuppressedDestinations,GET,/v2/email/suppression/addresses,ses:ListSuppressedDestinations
PutSuppressedDestination,PUT,/v2/email/suppression/addresses,ses:PutSuppressedDestination
DeleteSuppressedDestination,DELETE,/v2/email/suppression/addresses/sample-emailaddress,ses:DeleteSuppressedDestination
GetSuppressedDestination,GET,/v2/email/suppression/addresses/sample-emailaddress,ses:GetSuppressedDestination
UntagResource,DELETE,/v2/email/tags,ses:UntagResource
ListTagsForResource,GET,/v2/email/tags,ses:ListTagsForResource
TagResource,POST,/v2/email/tags,ses:TagResource
ListEmailTemplates,GET,/v2/email/templates,ses:ListEmailTemplates
CreateEmailTemplate,POST,/v2/email/templates,ses:CreateEmailTemplate
DeleteEmailTemplate,DELETE,/v2/email/templates/sample-templatename,ses:DeleteEmailTemplate
GetEmailTemplate,GET,/v2/email/templates/sample-templatename,ses:GetEmailTemplate
UpdateEmailTemplate,PUT,/v2/email/templates/sample-templatename,ses:UpdateEmailTemplate
TestRenderEmailTemplate,POST,/v2/email/templates/sample-templatename/render,ses:TestRenderEmailTemplate
PutTenantSuppressionAttributes,POST,/v2/email/tenant/suppression,ses:PutTenantSuppressionAttributes
CreateTenant,POST,/v2/email/tenants,ses:CreateTenant
DeleteTenant,POST,/v2/email/tenants/delete,ses:DeleteTenant
GetTenant,POST,/v2/email/tenants/get,ses:GetTenant
ListTenants,POST,/v2/email/tenants/list,ses:ListTenants
CreateTenantResourceAssociation,POST,/v2/email/tenants/resources,ses:CreateTenantResourceAssociation
DeleteTenantResourceAssociation,POST,/v2/email/tenants/resources/delete,ses:DeleteTenantResourceAssociation
ListTenantResources,POST,/v2/email/tenants/resources/list,ses:ListTenantResources
UpdateConfigurationSet,POST,/v2/email/update-configuration-sets,ses:UpdateConfigurationSet
ListRecommendations,POST,/v2/email/vdm/recommendations,ses:ListRecommendations
1 # Every SES v2 operation: a sample of its path from the SES v2 model (botocore develop at
2 # 9931e9741, 2026-09-29, sesv2/2019-09-27) and the IAM action AWS's service reference lists for it
3 # (https://servicereference.us-east-1.amazonaws.com/v1/ses/ses.json, read 2026-10-01).
4 # ListConfigurationSets and ListEmailIdentities also keep the GET routes earlier models gave them.
5 # SendEmail has no entry there; the Service Authorization Reference's SES v2 page defines
6 # ses:SendEmail as v2's only send action (ses:SendRawEmail belongs to v1).
7 GetAccount,GET,/v2/email/account,ses:GetAccount
8 PutAccountDedicatedIpWarmupAttributes,PUT,/v2/email/account/dedicated-ips/warmup,ses:PutAccountDedicatedIpWarmupAttributes
9 PutAccountDetails,POST,/v2/email/account/details,ses:PutAccountDetails
10 PutAccountPricingAttributes,PUT,/v2/email/account/pricing-attributes,ses:PutAccountPricingAttributes
11 PutAccountSendingAttributes,PUT,/v2/email/account/sending,ses:PutAccountSendingAttributes
12 PutAccountSuppressionAttributes,PUT,/v2/email/account/suppression,ses:PutAccountSuppressionAttributes
13 PutAccountVdmAttributes,PUT,/v2/email/account/vdm,ses:PutAccountVdmAttributes
14 ListConfigurationSets,GET,/v2/email/configuration-sets,ses:ListConfigurationSets
15 CreateConfigurationSet,POST,/v2/email/configuration-sets,ses:CreateConfigurationSet
16 DeleteConfigurationSet,DELETE,/v2/email/configuration-sets/sample-configurationsetname,ses:DeleteConfigurationSet
17 GetConfigurationSet,GET,/v2/email/configuration-sets/sample-configurationsetname,ses:GetConfigurationSet
18 PutConfigurationSetArchivingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/archiving-options,ses:PutConfigurationSetArchivingOptions
19 PutConfigurationSetDeliveryOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/delivery-options,ses:PutConfigurationSetDeliveryOptions
20 GetConfigurationSetEventDestinations,GET,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:GetConfigurationSetEventDestinations
21 CreateConfigurationSetEventDestination,POST,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:CreateConfigurationSetEventDestination
22 DeleteConfigurationSetEventDestination,DELETE,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:DeleteConfigurationSetEventDestination
23 UpdateConfigurationSetEventDestination,PUT,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:UpdateConfigurationSetEventDestination
24 PutConfigurationSetReputationOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/reputation-options,ses:PutConfigurationSetReputationOptions
25 PutConfigurationSetSendingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/sending,ses:PutConfigurationSetSendingOptions
26 PutConfigurationSetSuppressionOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/suppression-options,ses:PutConfigurationSetSuppressionOptions
27 PutConfigurationSetTrackingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/tracking-options,ses:PutConfigurationSetTrackingOptions
28 PutConfigurationSetVdmOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/vdm-options,ses:PutConfigurationSetVdmOptions
29 ListContactLists,GET,/v2/email/contact-lists,ses:ListContactLists
30 CreateContactList,POST,/v2/email/contact-lists,ses:CreateContactList
31 DeleteContactList,DELETE,/v2/email/contact-lists/sample-contactlistname,ses:DeleteContactList
32 GetContactList,GET,/v2/email/contact-lists/sample-contactlistname,ses:GetContactList
33 UpdateContactList,PUT,/v2/email/contact-lists/sample-contactlistname,ses:UpdateContactList
34 CreateContact,POST,/v2/email/contact-lists/sample-contactlistname/contacts,ses:CreateContact
35 ListContacts,POST,/v2/email/contact-lists/sample-contactlistname/contacts/list,ses:ListContacts
36 DeleteContact,DELETE,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:DeleteContact
37 GetContact,GET,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:GetContact
38 UpdateContact,PUT,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:UpdateContact
39 ListCustomVerificationEmailTemplates,GET,/v2/email/custom-verification-email-templates,ses:ListCustomVerificationEmailTemplates
40 CreateCustomVerificationEmailTemplate,POST,/v2/email/custom-verification-email-templates,ses:CreateCustomVerificationEmailTemplate
41 DeleteCustomVerificationEmailTemplate,DELETE,/v2/email/custom-verification-email-templates/sample-templatename,ses:DeleteCustomVerificationEmailTemplate
42 GetCustomVerificationEmailTemplate,GET,/v2/email/custom-verification-email-templates/sample-templatename,ses:GetCustomVerificationEmailTemplate
43 UpdateCustomVerificationEmailTemplate,PUT,/v2/email/custom-verification-email-templates/sample-templatename,ses:UpdateCustomVerificationEmailTemplate
44 ListDedicatedIpPools,GET,/v2/email/dedicated-ip-pools,ses:ListDedicatedIpPools
45 CreateDedicatedIpPool,POST,/v2/email/dedicated-ip-pools,ses:CreateDedicatedIpPool
46 DeleteDedicatedIpPool,DELETE,/v2/email/dedicated-ip-pools/sample-poolname,ses:DeleteDedicatedIpPool
47 GetDedicatedIpPool,GET,/v2/email/dedicated-ip-pools/sample-poolname,ses:GetDedicatedIpPool
48 PutDedicatedIpPoolScalingAttributes,PUT,/v2/email/dedicated-ip-pools/sample-poolname/scaling,ses:PutDedicatedIpPoolScalingAttributes
49 GetDedicatedIps,GET,/v2/email/dedicated-ips,ses:GetDedicatedIps
50 GetDedicatedIp,GET,/v2/email/dedicated-ips/sample-ip,ses:GetDedicatedIp
51 PutDedicatedIpInPool,PUT,/v2/email/dedicated-ips/sample-ip/pool,ses:PutDedicatedIpInPool
52 PutDedicatedIpWarmupAttributes,PUT,/v2/email/dedicated-ips/sample-ip/warmup,ses:PutDedicatedIpWarmupAttributes
53 GetDeliverabilityDashboardOptions,GET,/v2/email/deliverability-dashboard,ses:GetDeliverabilityDashboardOptions
54 PutDeliverabilityDashboardOption,PUT,/v2/email/deliverability-dashboard,ses:PutDeliverabilityDashboardOption
55 GetBlacklistReports,GET,/v2/email/deliverability-dashboard/blacklist-report,ses:GetBlacklistReports
56 GetDomainDeliverabilityCampaign,GET,/v2/email/deliverability-dashboard/campaigns/sample-campaignid,ses:GetDomainDeliverabilityCampaign
57 ListDomainDeliverabilityCampaigns,GET,/v2/email/deliverability-dashboard/domains/sample-subscribeddomain/campaigns,ses:ListDomainDeliverabilityCampaigns
58 GetDomainStatisticsReport,GET,/v2/email/deliverability-dashboard/statistics-report/sample-domain,ses:GetDomainStatisticsReport
59 CreateDeliverabilityTestReport,POST,/v2/email/deliverability-dashboard/test,ses:CreateDeliverabilityTestReport
60 ListDeliverabilityTestReports,GET,/v2/email/deliverability-dashboard/test-reports,ses:ListDeliverabilityTestReports
61 GetDeliverabilityTestReport,GET,/v2/email/deliverability-dashboard/test-reports/sample-reportid,ses:GetDeliverabilityTestReport
62 GetEmailAddressInsights,POST,/v2/email/email-address-insights/,ses:GetEmailAddressInsights
63 CreateExportJob,POST,/v2/email/export-jobs,ses:CreateExportJob
64 GetExportJob,GET,/v2/email/export-jobs/sample-jobid,ses:GetExportJob
65 CancelExportJob,PUT,/v2/email/export-jobs/sample-jobid/cancel,ses:CancelExportJob
66 ListEmailIdentities,GET,/v2/email/identities,ses:ListEmailIdentities
67 CreateEmailIdentity,POST,/v2/email/identities,ses:CreateEmailIdentity
68 DeleteEmailIdentity,DELETE,/v2/email/identities/sample-emailidentity,ses:DeleteEmailIdentity
69 GetEmailIdentity,GET,/v2/email/identities/sample-emailidentity,ses:GetEmailIdentity
70 PutEmailIdentityConfigurationSetAttributes,PUT,/v2/email/identities/sample-emailidentity/configuration-set,ses:PutEmailIdentityConfigurationSetAttributes
71 PutEmailIdentityDkimAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim,ses:PutEmailIdentityDkimAttributes
72 PutEmailIdentityDkimSigningAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim/signing,ses:PutEmailIdentityDkimSigningAttributes
73 PutEmailIdentityFeedbackAttributes,PUT,/v2/email/identities/sample-emailidentity/feedback,ses:PutEmailIdentityFeedbackAttributes
74 PutEmailIdentityMailFromAttributes,PUT,/v2/email/identities/sample-emailidentity/mail-from,ses:PutEmailIdentityMailFromAttributes
75 GetEmailIdentityPolicies,GET,/v2/email/identities/sample-emailidentity/policies,ses:GetEmailIdentityPolicies
76 DeleteEmailIdentityPolicy,DELETE,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:DeleteEmailIdentityPolicy
77 CreateEmailIdentityPolicy,POST,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:CreateEmailIdentityPolicy
78 UpdateEmailIdentityPolicy,PUT,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:UpdateEmailIdentityPolicy
79 AssociateEmailIdentityCertificate,POST,/v2/email/identity/certificates,ses:AssociateEmailIdentityCertificate
80 DisassociateEmailIdentityCertificate,POST,/v2/email/identity/certificates/delete,ses:DisassociateEmailIdentityCertificate
81 ListEmailIdentityCertificates,POST,/v2/email/identity/certificates/list,ses:ListEmailIdentityCertificates
82 CreateImportJob,POST,/v2/email/import-jobs,ses:CreateImportJob
83 ListImportJobs,POST,/v2/email/import-jobs/list,ses:ListImportJobs
84 GetImportJob,GET,/v2/email/import-jobs/sample-jobid,ses:GetImportJob
85 GetMessageInsights,GET,/v2/email/insights/sample-messageid/,ses:GetMessageInsights
86 ListConfigurationSets,POST,/v2/email/list-configuration-sets,ses:ListConfigurationSets
87 ListExportJobs,POST,/v2/email/list-export-jobs,ses:ListExportJobs
88 ListEmailIdentities,POST,/v2/email/list-identities,ses:ListEmailIdentities
89 BatchGetMetricData,POST,/v2/email/metrics/batch,ses:BatchGetMetricData
90 ListMultiRegionEndpoints,GET,/v2/email/multi-region-endpoints,ses:ListMultiRegionEndpoints
91 CreateMultiRegionEndpoint,POST,/v2/email/multi-region-endpoints,ses:CreateMultiRegionEndpoint
92 DeleteMultiRegionEndpoint,DELETE,/v2/email/multi-region-endpoints/sample-endpointname,ses:DeleteMultiRegionEndpoint
93 GetMultiRegionEndpoint,GET,/v2/email/multi-region-endpoints/sample-endpointname,ses:GetMultiRegionEndpoint
94 SendBulkEmail,POST,/v2/email/outbound-bulk-emails,ses:SendBulkEmail
95 SendCustomVerificationEmail,POST,/v2/email/outbound-custom-verification-emails,ses:SendCustomVerificationEmail
96 SendEmail,POST,/v2/email/outbound-emails,ses:SendEmail
97 ListReputationEntities,POST,/v2/email/reputation/entities,ses:ListReputationEntities
98 GetReputationEntity,GET,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference,ses:GetReputationEntity
99 UpdateReputationEntityCustomerManagedStatus,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/customer-managed-status,ses:UpdateReputationEntityCustomerManagedStatus
100 UpdateReputationEntityPolicy,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/policy,ses:UpdateReputationEntityPolicy
101 ListResourceTenants,POST,/v2/email/resources/tenants/list,ses:ListResourceTenants
102 ListSuppressedDestinations,GET,/v2/email/suppression/addresses,ses:ListSuppressedDestinations
103 PutSuppressedDestination,PUT,/v2/email/suppression/addresses,ses:PutSuppressedDestination
104 DeleteSuppressedDestination,DELETE,/v2/email/suppression/addresses/sample-emailaddress,ses:DeleteSuppressedDestination
105 GetSuppressedDestination,GET,/v2/email/suppression/addresses/sample-emailaddress,ses:GetSuppressedDestination
106 UntagResource,DELETE,/v2/email/tags,ses:UntagResource
107 ListTagsForResource,GET,/v2/email/tags,ses:ListTagsForResource
108 TagResource,POST,/v2/email/tags,ses:TagResource
109 ListEmailTemplates,GET,/v2/email/templates,ses:ListEmailTemplates
110 CreateEmailTemplate,POST,/v2/email/templates,ses:CreateEmailTemplate
111 DeleteEmailTemplate,DELETE,/v2/email/templates/sample-templatename,ses:DeleteEmailTemplate
112 GetEmailTemplate,GET,/v2/email/templates/sample-templatename,ses:GetEmailTemplate
113 UpdateEmailTemplate,PUT,/v2/email/templates/sample-templatename,ses:UpdateEmailTemplate
114 TestRenderEmailTemplate,POST,/v2/email/templates/sample-templatename/render,ses:TestRenderEmailTemplate
115 PutTenantSuppressionAttributes,POST,/v2/email/tenant/suppression,ses:PutTenantSuppressionAttributes
116 CreateTenant,POST,/v2/email/tenants,ses:CreateTenant
117 DeleteTenant,POST,/v2/email/tenants/delete,ses:DeleteTenant
118 GetTenant,POST,/v2/email/tenants/get,ses:GetTenant
119 ListTenants,POST,/v2/email/tenants/list,ses:ListTenants
120 CreateTenantResourceAssociation,POST,/v2/email/tenants/resources,ses:CreateTenantResourceAssociation
121 DeleteTenantResourceAssociation,POST,/v2/email/tenants/resources/delete,ses:DeleteTenantResourceAssociation
122 ListTenantResources,POST,/v2/email/tenants/resources/list,ses:ListTenantResources
123 UpdateConfigurationSet,POST,/v2/email/update-configuration-sets,ses:UpdateConfigurationSet
124 ListRecommendations,POST,/v2/email/vdm/recommendations,ses:ListRecommendations
+57 -10
View File
@@ -155,6 +155,10 @@ Beyond the members' names, botocore's shapes and documentation say what a member
only to requests of its `endpoint` prefix (EventBridge's `events` and EventBridge V2's `eventsv2`), or to every
request where they share one; a client takes the type its ARN patterns name of two it names by the same members,
a versioned twin (`event-busv2`) for one they do not;
- every row names the APIs it is read for (`apis`), each a protocol botocore gives a client of the operation with
its API version: one only some of the clients read names theirs, so clients sharing an endpoint prefix are still
told apart by the API a request reached them by (SES v1's `SourceArn` is `query/2010-12-01`, which no SES v2
request is), and every other row names every client's;
- a variable no member fills is `fixed` to the one value of an enum named after it that the operation's name gives
(CodePipeline's `CreateCustomActionType` makes an action type whose `ActionOwner` is `Custom`);
- a type named only by an optional member documented as holding what the operation is about ("the cluster to which
@@ -373,7 +377,7 @@ NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "a
"rekognition", "resource-explorer-2", "route53", "s3tables", "s3vectors", "servicediscovery",
"servicequotas", "ssm", "sso", "states", "textract", "timestream-influxdb", "translate", "signer", "xray",
"securityhub", "guardduty", "secretsmanager", "scheduler", "lambda", "cloudformation", "glue",
"sqs", "sns", "kinesis", "pipes", "dsql", "sts", "eks", "resource-groups", "logs", "cloudwatch",
"sqs", "sns", "kinesis", "pipes", "dsql", "sts", "eks", "resource-groups", "logs", "ses", "cloudwatch",
"comprehend", "config", "dms", "elasticache", "identitystore", "memorydb", "route53resolver",
"sagemaker", "transcribe", "transfer", "ec2-instance-connect", "s3", "bedrock", "apigateway", "kms",
"dynamodb", "iam")
@@ -658,7 +662,6 @@ NOT_COVERED: dict[str, str] = {
"portfolio or product imported from another account keeps its owner's account in its ARN while "
"requests name it by its id alone; and AppRegistry's applications and attribute groups are "
"named in the path",
"ses": _LATER,
"signin": _REST,
"ssmmessages": "channel routes authorise agent and client resources directly rather than through generated request mappings",
"sso-oauth": _REST,
@@ -686,6 +689,8 @@ ID_TARGETS = {"ec2": ("instance", "network-acl", "network-interface", "route-tab
# An ARN format's account given as `${AccountId}`, the account `${Account}` gives in every other format.
ACCOUNT_ID_SLOT_RE = re.compile(r"^(arn:[^:]*:[^:]*:[^:]*:)\$\{AccountId}:")
VARIABLE_RE = re.compile(r"\$\{(\w+)}")
# An API a request reaching an operation is one of: a protocol botocore gives a client's model and its API version.
API_RE = re.compile(r"[a-z0-9-]+/\d{4}-\d{2}-\d{2}")
# A resource-tag condition key the reference gives a type, named after the tag key it compares, which it writes as the
# variable `${TagKey}` or as `tag-key`, as the IAM User Guide writes `aws:ResourceTag/tag-key` ("There is one context
# key for each tag key-value pair"): Secrets Manager's `secretsmanager:ResourceTag/tag-key`. SSM spells the word
@@ -4250,13 +4255,42 @@ def by_client(operation: str, models: dict[str, dict], read, formats: dict[str,
apart[client] = narrowed(apart[client], client_words(models[client]), models[client], name, formats,
arn_types=not shared)
resources: list[dict] = []
readers: list[set[str]] = []
for client in clients:
for resource in apart[client]:
everywhere = all(resource in apart[other] for other in clients)
tagged = resource if everywhere or shared else dict(resource, endpoint=prefixes[client])
if tagged not in resources:
resources.append(tagged)
return resources
readers.append(set())
readers[resources.index(tagged)].add(client)
# A row some of the clients read applies to the requests of their APIs alone; the rest, every client's, are read
# for every API of the operation (`with_read_apis`).
return [resource if named == set(clients) else dict(resource, apis=apis_of(models, sorted(named)))
for resource, named in zip(resources, readers, strict=True)]
def apis_of(models: dict[str, dict], clients: list[str]) -> list[str]:
"""The APIs of the clients, each a protocol botocore gives the client's model with its API version
(`query/2010-12-01` for SES v1, `rest-json/2019-09-27` for SES v2), which a request reaching the operation is
one of: a row read for some of an operation's clients applies to the requests of their APIs alone."""
return sorted({f"{protocol}/{models[client]['metadata']['apiVersion']}" for client in clients
for protocol in models[client]["metadata"].get("protocols")
or [models[client]["metadata"]["protocol"]]})
def with_apis(resources: list[dict], apis: list[str]) -> list[dict]:
"""The resources, each not yet read for some APIs read for `apis`."""
return [resource if "apis" in resource else dict(resource, apis=apis) for resource in resources]
def with_read_apis(entry: dict, operation: str, models: dict[str, dict]) -> dict:
"""The entry, each of its rows naming the APIs it is read for: one only some clients read was given theirs
(`by_client`), and every other row is read for every API of the clients whose model has the operation, or of the
namespace's clients where none does."""
name = operation.split(":", 1)[1]
clients = sorted(client for client, model in models.items() if name in model["operations"]) or sorted(models)
return {**entry, "resources": with_apis(entry["resources"], apis_of(models, clients))}
def narrowed(resources: list[dict], words: set[str], model: dict, operation: str,
@@ -4789,9 +4823,9 @@ def build(documents: list[dict], provenance: str, data: Path, botocore: str) ->
models = load_models(data, set(namespaces[namespace_of(operation)]))
if namespace_of(operation) in permission_actions:
value = {**value, "actions": permission_actions[namespace_of(operation)]}
operations[operation] = entry_for(operation, value, {**formats.get(namespace_of(operation), {}),
**path_formats.get(namespace_of(operation), {})}, models,
prefixes.get(namespace_of(operation)), forwarded, routed.get(operation))
operations[operation] = with_read_apis(entry_for(
operation, value, {**formats.get(namespace_of(operation), {}), **path_formats.get(namespace_of(operation), {})},
models, prefixes.get(namespace_of(operation)), forwarded, routed.get(operation)), operation, models)
unqualified = unqualified_types(formats, operations, namespaces, data)
return {
"_source": {
@@ -5153,6 +5187,9 @@ def validate(document: dict) -> list[str]:
# A route authorized by its method names the type of its path, which its action may not list (`--check`
# says whether it is the one its path is).
routed = set(formats.get(namespace, {})) if namespace in PATH_SOURCES else set()
problems += _apis_problems(operation, resource)
if isinstance(resource, dict):
resource = {key: value for key, value in resource.items() if key != "apis"}
problems += _resource_problems(operation, resource, acting | measured | routed,
formats.get(namespace, {}))
for created in entry.get("creates", []) if isinstance(entry.get("creates", []), list) else [None]:
@@ -5218,6 +5255,15 @@ def validate(document: dict) -> list[str]:
return problems
def _apis_problems(operation: str, resource: object) -> list[str]:
"""A row that names no APIs it is read for, each a protocol and an API version, sorted and once each."""
apis = resource.get("apis") if isinstance(resource, dict) else None
if not isinstance(apis, list) or not apis or apis != sorted(set(apis)) \
or not all(isinstance(api, str) and API_RE.fullmatch(api) for api in apis):
return [f"{operation} reads {resource!r} for no protocol and API version it names (`apis`)"]
return []
def _resource_problems(operation: str, resource: object, types: set[str], formats: dict[str, str]) -> list[str]:
if isinstance(resource, dict) and "statement" in resource:
kinds = _kinds(resource)
@@ -5447,10 +5493,11 @@ def derive(document: dict, data: Path) -> list[str]:
for operation, entry in document["operations"].items():
namespace = namespace_of(operation)
models = load_models(data, set(document["namespaces"][namespace]))
expected = entry_for(operation, {"action": entry["action"], "types": entry["types"],
**({"actions": entry["actions"]} if "actions" in entry else {})},
{**document["arnFormats"].get(namespace, {}), **path_formats.get(namespace, {})}, models,
prefixes.get(namespace), document["forwardedActions"], routed.get(operation))
expected = with_read_apis(entry_for(
operation, {"action": entry["action"], "types": entry["types"],
**({"actions": entry["actions"]} if "actions" in entry else {})},
{**document["arnFormats"].get(namespace, {}), **path_formats.get(namespace, {})}, models,
prefixes.get(namespace), document["forwardedActions"], routed.get(operation)), operation, models)
if expected != entry:
problems.append(f"{operation}: the file has {json.dumps(entry)}, botocore gives {json.dumps(expected)}")
return problems
+2
View File
@@ -91,6 +91,7 @@ MODELS: dict[str, str] = {
"opensearch": "es",
# The data plane is signed for the service, which is one scope for both of its planes.
"payment-cryptography-data": "payment-cryptography",
"pinpoint-email": "ses",
"pipes": "pipes",
"quicksight": "quicksight",
"ram": "ram",
@@ -102,6 +103,7 @@ MODELS: dict[str, str] = {
"s3vectors": "s3vectors",
"scheduler": "scheduler",
"securityhub": "securityhub",
"sesv2": "ses",
"signer": "signer",
"xray": "xray",
}
+172 -114
View File
@@ -200,19 +200,20 @@ def test_a_built_document_with_what_a_create_makes_a_default_and_a_maps_ids_vali
documents = [reference("svc", {"CreateThing": [], "ListThings": ["thing"], "ApplySteps": ["pool"]},
{"thing": FORMATS["thing"], "pool": FORMATS["pool"]})]
document = r.build(documents, "test", tmp_path, "botocore test")
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
operations = document["operations"]
assert operations["svc:CreateThing"] == {"action": "svc:CreateThing", "types": [], "resources": [],
"makes": [{"type": "thing", "fill": {"ThingName": "ThingName"}}]}
assert operations["svc:ListThings"]["resources"] == [
assert without_apis(operations["svc:ListThings"]["resources"]) == [
{"types": ["thing"], "arn": "ThingArn"}, {"type": "thing", "fill": {}, "when": {"ThingArn": [None]}, "default": True}]
# A field of each value of a map of structures, named after a type the action acts on, names one of it each.
assert operations["svc:ApplySteps"]["resources"] == [{"type": "pool", "fill": {"PoolId": "steps{}.poolId"}}]
assert without_apis(operations["svc:ApplySteps"]["resources"]) == [{"type": "pool", "fill": {"PoolId": "steps{}.poolId"}}]
assert json.loads(r.render(document)) == document
# A create acting on types makes nothing this way, and a default is for a request naming none, by no member.
operations["svc:ListThings"]["makes"] = [{"type": "thing", "fill": {}}]
operations["svc:CreateThing"]["resources"] = [{"type": "thing", "fill": {"ThingName": "ThingName"},
"when": {"ThingArn": [None]}, "default": True}]
"when": {"ThingArn": [None]}, "default": True,
"apis": ["json/2020-01-01"]}]
assert len(r.validate(document)) == 2
@@ -270,7 +271,7 @@ def test_a_rest_xml_request_is_read_for_its_path_and_query_members_alone():
"Comment": {"shape": "String"}}}}
for protocol, read in (("rest-xml", {"Id": "Id", "Marker": "Marker"}),
("rest-json", {"Id": "Id", "Marker": "Marker", "Comment": "Comment"})):
models = {"svc": {"metadata": {"protocol": protocol}, "operations": {"GetThing": {"input": {"shape": "In"}}},
models = {"svc": {"metadata": {"apiVersion": "2020-01-01", "protocol": protocol}, "operations": {"GetThing": {"input": {"shape": "In"}}},
"shapes": shapes}}
assert r.request_members(models, "GetThing") == read, protocol
assert set(r.string_patterns(models, "GetThing")) == set(read), protocol
@@ -285,7 +286,7 @@ def test_an_arn_inside_a_structure_or_a_lists_structures_is_read_by_its_path():
"Config": {"type": "structure", "members": {"RoleArn": {"shape": "String"}, "Name": {"shape": "String"}}},
"In": {"type": "structure", "members": {"RulePriorities": {"shape": "Priorities"}, "Config": {"shape": "Config"},
"ListenerArn": {"shape": "String"}}}}
models = {"svc": {"metadata": {"protocol": "query"}, "operations": {"SetRulePriorities": {"input": {"shape": "In"}}},
models = {"svc": {"metadata": {"apiVersion": "2020-01-01", "protocol": "query"}, "operations": {"SetRulePriorities": {"input": {"shape": "In"}}},
"shapes": shapes}}
found = r.request_members(models, "SetRulePriorities")
assert found == {"RulePriorities[].RuleArn": "RulePriorities[].RuleArn",
@@ -372,7 +373,7 @@ def test_a_bare_id_names_the_resource_whose_config_an_operation_reads():
def lever_model(request_uri: str, label: str = "id") -> dict:
"""A rest-json model whose UpdateSafetyLeverState takes `id` from the path label given, and a `state`."""
return {"metadata": {"protocol": "rest-json"},
return {"metadata": {"apiVersion": "2020-01-01", "protocol": "rest-json"},
"operations": {"UpdateSafetyLeverState": {"http": {"method": "PATCH", "requestUri": request_uri},
"input": {"shape": "In"}}},
"shapes": {"In": {"type": "structure", "members": {
@@ -400,7 +401,7 @@ def test_a_bare_path_label_names_the_type_the_segment_before_it_names():
def test_a_resource_member_taking_only_an_arn_holds_the_resource_the_action_acts_on():
model = {
"metadata": {"protocol": "rest-xml", "endpointPrefix": "svc"},
"metadata": {"apiVersion": "2020-01-01", "protocol": "rest-xml", "endpointPrefix": "svc"},
"operations": {"TagResource": {"input": {"shape": "Input"}}},
"shapes": {"Input": {"type": "structure", "members": {
"Resource": {"shape": "Value", "location": "querystring", "locationName": "Resource"}}},
@@ -431,7 +432,41 @@ def model(operations: dict[str, dict[str, str]], protocol: str = "json") -> dict
for name, fields in operations.items():
shapes[name + "In"] = {"type": "structure", "members": {field: {"shape": shape} for field, shape in fields.items()}}
ops[name] = {"input": {"shape": name + "In"}}
return {"metadata": {"protocol": protocol}, "operations": ops, "shapes": shapes}
return {"metadata": {"apiVersion": "2020-01-01", "protocol": protocol}, "operations": ops, "shapes": shapes}
def test_a_row_only_some_clients_read_applies_to_the_requests_of_their_apis():
# SES v1 (Query) and v2 (REST) share the `email` endpoint and the operation's name; v1's request has a `SourceArn`,
# v2's a `FromArn`. Each row names the APIs it is read for, so a v2 request never reads v1's member.
v1 = model({"SendThing": {"SourceArn": "String", "ThingName": "String"}}, protocol="query")
v2 = model({"SendThing": {"FromArn": "String", "ThingName": "String"}}, protocol="rest-json")
v1["metadata"].update(apiVersion="2010-12-01", endpointPrefix="email")
v2["metadata"].update(apiVersion="2019-09-27", endpointPrefix="email")
models = {"svc": v1, "svcv2": v2}
formats = {"thing": FORMATS["thing"]}
read = r.by_client("svc:SendThing", models, lambda chosen: r.read_resources("svc:SendThing", ["thing"], formats,
chosen), formats)
assert {row.get("arn"): row.get("apis") for row in read if "arn" in row} == {
"SourceArn": ["query/2010-12-01"], "FromArn": ["rest-json/2019-09-27"]}
# A row every client reads is read for all of them once the entry is done.
named = r.with_read_apis({"resources": read}, "svc:SendThing", models)["resources"]
assert [row["apis"] for row in named if "fill" in row] == [["query/2010-12-01", "rest-json/2019-09-27"]]
# A model giving several protocols is read for each.
v2["metadata"]["protocols"] = ["rest-json", "rest-xml"]
assert r.apis_of(models, ["svcv2"]) == ["rest-json/2019-09-27", "rest-xml/2019-09-27"]
def test_every_row_names_the_apis_it_is_read_for():
document = good_document()
assert r.validate(document) == []
for apis in (None, [], ["json"], ["json/2020-01-01", "json/2020-01-01"], ["rest-json/2020-01-01", "json/2020-01-01"]):
broken = good_document()
row = broken["operations"]["svc:A"]["resources"][0]
if apis is None:
del row["apis"]
else:
row["apis"] = apis
assert any("no protocol and API version" in problem for problem in r.validate(broken)), apis
@pytest.fixture
@@ -467,7 +502,7 @@ def tables_model() -> dict:
get = table_members("querystring", "<p>The name of the table.</p>")
get["tableArn"] = {"shape": "TableARN", "location": "querystring", "locationName": "tableArn",
"documentation": "<p>The Amazon Resource Name (ARN) of the table.</p>"}
return {"metadata": {"protocol": "rest-json"},
return {"metadata": {"apiVersion": "2020-01-01", "protocol": "rest-json"},
"operations": {
"DeleteTable": {"http": {"method": "DELETE",
"requestUri": "/tables/{tableBucketARN}/{namespace}/{name}"},
@@ -554,14 +589,14 @@ def test_rest_arn_alternatives_and_integer_shapes_fill_versioned_resources(isola
"GetProductVersionByArn": ["productVersion"]}, formats)]
document = r.build(documents, "test", tmp_path, "botocore test")
entry = document["operations"]["svc:GetProductVersion"]
assert entry["resources"] == [{
assert without_apis(entry["resources"]) == [{
"type": "productVersion", "fill": {"ProductName": "ProductName", "ProductVersion": "VersionNumber"},
"arnOf": {"ProductName": "product"}}]
assert entry["located"] == {"ProductName": "{ProductName}", "VersionNumber": "{VersionNumber}"}
assert document["operations"]["svc:GetProductVersionByArn"]["resources"] == [
assert without_apis(document["operations"]["svc:GetProductVersionByArn"]["resources"]) == [
{"types": ["productVersion"], "arn": "Arn"}]
assert document["integerVariables"] == {"svc": {"productVersion": ["ProductVersion"]}}
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert r.derive(document, tmp_path) == []
document["integerVariables"] = {}
assert any("integerVariables differ from botocore" in problem for problem in r.derive(document, tmp_path))
@@ -590,11 +625,11 @@ DOCUMENTS = [reference("svc", {"GetThing": ["thing"], "ListThings": []}, {"thing
def test_a_built_document_validates_matches_botocore_and_names_the_namespaces_it_does_not_read(isolated, tmp_path):
write_models(tmp_path, {"svc": model({"GetThing": {"ThingName": "String"}, "ListThings": {}})})
document = r.build(DOCUMENTS, "test", tmp_path, "botocore test")
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert r.derive(document, tmp_path) == []
assert document["operations"]["svc:GetThing"] == {"action": "svc:GetThing", "types": ["thing"],
assert entry_without_apis(document["operations"]["svc:GetThing"]) == {"action": "svc:GetThing", "types": ["thing"],
"resources": [{"type": "thing", "fill": {"ThingName": "ThingName"}}]}
assert document["operations"]["svc:ListThings"]["resources"] == []
assert without_apis(document["operations"]["svc:ListThings"]["resources"]) == []
assert document["otherNamespaces"] == ["other"]
assert json.loads(r.render(document)) == document
@@ -603,8 +638,8 @@ def test_a_member_holding_an_account_id_gives_the_account_of_the_types_named_by_
write_models(tmp_path, {"svc": model({"GetThing": {"ThingName": "String", "registryId": "AccountId"},
"ListThings": {"registryId": "AccountId"}})})
document = r.build(DOCUMENTS, "test", tmp_path, "botocore test")
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert document["operations"]["svc:GetThing"]["resources"] == [
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
assert without_apis(document["operations"]["svc:GetThing"]["resources"]) == [
{"type": "thing", "fill": {"ThingName": "ThingName"}, "account": "registryId"}]
# An ARN carries its own account, and a format without one takes none.
assert r.with_account([{"types": ["thing"], "arn": "ThingArn"}], FORMATS, ["registryId"]) == [
@@ -904,9 +939,9 @@ def test_redshift_serverless_account_inference_preserves_the_generated_resources
for operation, entry in document["operations"].items():
if not operation.startswith("redshift-serverless:"):
continue
derived = r.entry_for(operation, {"action": entry["action"], "types": entry["types"]},
document["arnFormats"]["redshift-serverless"], models, None,
document["forwardedActions"])
derived = r.with_read_apis(r.entry_for(operation, {"action": entry["action"], "types": entry["types"]},
document["arnFormats"]["redshift-serverless"], models, None,
document["forwardedActions"]), operation, models)
assert derived == entry, operation
if r.account_members(models, operation.split(":", 1)[1]) == ["ownerAccount"]:
account_operations.add(operation.split(":", 1)[1])
@@ -951,7 +986,7 @@ def test_a_hand_edited_entry_does_not_match_botocore(isolated, tmp_path):
write_models(tmp_path, {"svc": model({"GetThing": {"ThingName": "String"}, "ListThings": {}})})
document = r.build(DOCUMENTS, "test", tmp_path, "botocore test")
document["operations"]["svc:GetThing"]["resources"] = []
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert len(r.derive(document, tmp_path)) == 1
@@ -965,10 +1000,10 @@ def test_a_type_another_qualifies_and_no_action_acts_on_is_checked_without_the_q
document = r.build(documents, "test", tmp_path, "botocore test")
# `thingversion` is a thing's format and one more `:${...}`, and no action acts on it.
assert document["unqualified"] == {"svc": ["thing"]}
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
# A hand edit no longer matches.
document["unqualified"] = {}
assert r.validate(document) == [] and len(r.derive(document, tmp_path)) == 1
assert r.validate(with_apis_named(document)) == [] and len(r.derive(document, tmp_path)) == 1
# An action acting on the qualified type checks it on its own ARN.
documents = [reference("svc", {"GetThing": ["thing"], "ListThings": ["thingversion"]}, THINGS)]
assert r.build(documents, "test", tmp_path, "botocore test")["unqualified"] == {}
@@ -996,7 +1031,7 @@ def test_a_type_whose_arn_shape_takes_a_segment_past_its_name_has_an_id_its_serv
write_models(tmp_path, {"svc": minted})
document = r.build(DOCUMENTS, "test", tmp_path, "botocore test")
assert document["mintedIds"] == {"svc": ["thing"]}
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
document["mintedIds"] = {}
assert len(r.derive(document, tmp_path)) == 1
# One segment that may hold slashes is the name alone.
@@ -1017,8 +1052,8 @@ def test_a_create_documenting_characters_its_service_mints_after_a_name_gives_th
{"thing": FORMATS["thing"]})]
document = r.build(documents, "test", tmp_path, "botocore test")
assert document["mintedSuffixes"] == {"svc": {"thing": "-??????"}}
assert document["operations"]["svc:CreateThing"]["resources"] == [{"type": "thing", "fill": {"ThingName": "Name"}}]
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert without_apis(document["operations"]["svc:CreateThing"]["resources"]) == [{"type": "thing", "fill": {"ThingName": "Name"}}]
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
document["mintedSuffixes"] = {}
assert any("minted suffix" in problem for problem in r.derive(document, tmp_path))
for bad in ({"svc": {"thing": "??????"}}, {"svc": {"group": "-??"}}, {"svc": {"thing": "-ab"}}, {"svc": {}}):
@@ -1043,21 +1078,21 @@ def test_a_type_whose_arn_is_all_an_id_its_service_mints_is_found_by_its_documen
"<p>Targets are uniquely identified by the combination of namespace, resource ID, and dimension.</p>")
write_models(tmp_path, {"svc": found})
document = r.build(documents, "test", tmp_path, "botocore test")
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
operations = document["operations"]
# Found by its documented key, in the request's order, rather than filled by ResourceId, not the id its ARN ends in.
assert operations["svc:PutTarget"]["resources"] == [
assert without_apis(operations["svc:PutTarget"]["resources"]) == [
{"type": "target", "fill": {}, "find": ["Namespace", "ResourceId", "Dimension"]}]
# Its ARN names it as given, and a request lacking a member of its key names none.
assert operations["svc:TagTarget"]["resources"] == [{"types": ["target"], "arn": "ResourceArn"}]
assert operations["svc:GetByResource"]["resources"] == []
assert without_apis(operations["svc:TagTarget"]["resources"]) == [{"types": ["target"], "arn": "ResourceArn"}]
assert without_apis(operations["svc:GetByResource"]["resources"]) == []
# Found by its name, its id being one no request gives.
assert operations["svc:RunOn"]["resources"] == [{"type": "group", "fill": {}, "find": ["GroupName"]}]
assert without_apis(operations["svc:RunOn"]["resources"]) == [{"type": "group", "fill": {}, "find": ["GroupName"]}]
# Where a request gives the id, a name beside it is a new name, not the group's.
found["shapes"]["RenameGroupIn"]["members"]["GroupId"] = {"shape": "String"}
write_models(tmp_path / "given", {"svc": found})
renamed = r.build(documents, "test", tmp_path / "given", "botocore test")["operations"]
assert renamed["svc:RenameGroup"]["resources"] == [{"type": "group", "fill": {"GroupId": "GroupId"}}]
assert without_apis(renamed["svc:RenameGroup"]["resources"]) == [{"type": "group", "fill": {"GroupId": "GroupId"}}]
assert not any("find" in resource for resource in renamed["svc:RunOn"]["resources"])
# A hand edit no longer matches.
operations["svc:PutTarget"]["resources"] = [{"type": "target", "fill": {"ResourceId": "ResourceId"}}]
@@ -1077,13 +1112,13 @@ def test_a_member_naming_a_resource_of_no_type_names_what_its_record_says_it_run
"Status": {"shape": "String"}}}
write_models(tmp_path, {"svc": sessions})
document = r.build(documents, "test", tmp_path, "botocore test")
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
operations = document["operations"]
assert operations["svc:Run"]["resources"] == [{"types": ["cluster", "group"], "through": "SessionId"}]
assert operations["svc:RunOnGroup"]["resources"][-1] == {"types": ["group"], "through": "SessionId"}
assert without_apis(operations["svc:Run"]["resources"]) == [{"types": ["cluster", "group"], "through": "SessionId"}]
assert without_apis(operations["svc:RunOnGroup"]["resources"])[-1] == {"types": ["group"], "through": "SessionId"}
# Not by a request without the member, nor for an action acting on none of the types.
assert not any("through" in resource for resource in operations["svc:RunOnCluster"]["resources"])
assert operations["svc:ListSessions"]["resources"] == []
assert without_apis(operations["svc:ListSessions"]["resources"]) == []
# Without the record, the session reaches nothing.
del sessions["shapes"]["SessionData"]
write_models(tmp_path / "plain", {"svc": sessions})
@@ -1105,7 +1140,7 @@ def test_a_member_taking_an_arn_before_a_name_is_read_as_the_variable_of_that_ty
shapes = {"String": {"type": "string"},
"BusNameOrArn": {"type": "string", "pattern": "(arn:aws[\\w-]*:svc:[a-z]+-[a-z]+-[\\w-]+:[0-9]{12}:bus\\/)?[/\\.\\-_A-Za-z0-9]+"},
"In": {"type": "structure", "members": {"Name": {"shape": "String"}, "BusName": {"shape": "BusNameOrArn"}}}}
models = {"svc": {"metadata": {"protocol": "json"}, "operations": {"PutRule": {"input": {"shape": "In"}}}, "shapes": shapes}}
models = {"svc": {"metadata": {"apiVersion": "2020-01-01", "protocol": "json"}, "operations": {"PutRule": {"input": {"shape": "In"}}}, "shapes": shapes}}
assert r.name_or_arn_members(models, "PutRule") == {"BusName": "bus"}
formats = {"bus": "arn:${Partition}:svc:${Region}:${Account}:bus/${BusName}",
"rule": "arn:${Partition}:svc:${Region}:${Account}:rule/${BusName}/${RuleName}"}
@@ -1124,7 +1159,7 @@ def test_a_field_of_each_of_a_lists_structures_taking_an_arn_before_a_name_is_re
"Entries": {"type": "list", "member": {"shape": "Entry"}},
"Config": {"type": "structure", "members": {"BusName": {"shape": "BusNameOrArn"}}},
"In": {"type": "structure", "members": {"Entries": {"shape": "Entries"}, "Config": {"shape": "Config"}}}}
models = {"svc": {"metadata": {"protocol": "json"}, "operations": {"PutEvents": {"input": {"shape": "In"}}}, "shapes": shapes}}
models = {"svc": {"metadata": {"apiVersion": "2020-01-01", "protocol": "json"}, "operations": {"PutEvents": {"input": {"shape": "In"}}}, "shapes": shapes}}
# Only a list's structures give one value for each, so a lone structure's field is not read.
assert r.name_or_arn_members(models, "PutEvents") == {"Entries[].BusName": "bus"}
formats = {"bus": "arn:${Partition}:svc:${Region}:${Account}:bus/${BusName}"}
@@ -1133,6 +1168,23 @@ def test_a_field_of_each_of_a_lists_structures_taking_an_arn_before_a_name_is_re
dict(buses[0], arnOf={"Entries[].BusName": "bus"})]
def without_apis(rows: list[dict]) -> list[dict]:
"""Rows as the readings give them, without the APIs every row of a built document names (`with_read_apis`)."""
return [{key: value for key, value in row.items() if key != "apis"} for row in rows]
def entry_without_apis(entry: dict) -> dict:
return {**entry, "resources": without_apis(entry["resources"])}
def with_apis_named(document: dict, api: str = "json/2020-01-01") -> dict:
"""A hand-built document, each row naming an API it is read for, as every row of the file does."""
for entry in document["operations"].values():
entry["resources"] = [dict(row, apis=[api]) if isinstance(row, dict) and "apis" not in row else row
for row in entry["resources"]]
return document
def good_document() -> dict:
return {"namespaces": {"svc": ["svc"]},
"notCovered": {"later": "a later batch"},
@@ -1141,8 +1193,10 @@ def good_document() -> dict:
"unqualified": {"svc": ["thing"]}, "mintedIds": {"svc": ["thing"]}, "mintedSuffixes": {},
"forwardedActions": {},
"operations": {
"svc:A": {"action": "svc:A", "types": ["thing"], "resources": [{"types": ["thing"], "arn": "ThingArn"}]},
"svc:B": {"action": "svc:B", "types": ["group"], "resources": [{"type": "group", "fill": {"GroupName": "Names[]"}}]},
"svc:A": {"action": "svc:A", "types": ["thing"],
"resources": [{"types": ["thing"], "arn": "ThingArn", "apis": ["json/2020-01-01"]}]},
"svc:B": {"action": "svc:B", "types": ["group"],
"resources": [{"type": "group", "fill": {"GroupName": "Names[]"}, "apis": ["json/2020-01-01"]}]},
"svc:C": {"action": "svc:C", "types": [], "resources": []}}}
@@ -1171,7 +1225,7 @@ def routed_model(routes: dict[str, tuple[str, str, dict[str, str]]]) -> dict:
shapes[name + "In"] = {"type": "structure", "members": {
member: {"shape": "String", "location": "uri", "locationName": label} for label, member in labels.items()}}
operations[name] = {"http": {"method": method, "requestUri": uri}, "input": {"shape": name + "In"}}
return {"metadata": {"protocol": "rest-json"}, "operations": operations, "shapes": shapes}
return {"metadata": {"apiVersion": "2020-01-01", "protocol": "rest-json"}, "operations": operations, "shapes": shapes}
def test_a_route_authorized_by_its_method_names_the_reference_type_of_its_own_path():
@@ -1237,7 +1291,7 @@ def test_route_types_are_read_only_for_a_namespace_with_a_path_source_and_never_
"svc": {"/sdktypes (resource-path-specifier)": "arn:${Partition}:svc:${Region}::/sdktypes"}}
assert any("pathFormats" in problem for problem in r.validate(document))
monkeypatch.setattr(r, "PATH_SOURCES", {"svc": Path("svc.json")})
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
document["pathFormats"] = {"svc": {"thing": "arn:${Partition}:svc:${Region}::/things"}}
assert any("pathFormats" in problem for problem in r.validate(document))
@@ -1249,39 +1303,39 @@ def test_a_well_formed_document_validates():
document["operations"]["svc:B"]["resources"][0]["account"] = "registryId"
document["operations"]["svc:B"]["resources"][0]["unless"] = {"Bus": ["default"]}
document["operations"]["svc:B"]["resources"][0]["arnOf"] = {"Bus": "thing"}
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert r.validate(with_a_create()) == []
# A field of each of a list's structures fills a variable, read as given, or as an ARN.
document = good_document()
document["operations"]["svc:B"]["resources"][0].update(
fill={"GroupName": "Groups[].Name"}, arnOf={"Groups[].Name": "thing"})
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
# A field of a structure fills a variable, read as one value, and a variable no member fills may be fixed.
document = good_document()
document["operations"]["svc:B"]["resources"][0].update(
fill={"GroupName": "Group.Name"}, fixed={"GroupId": "g-1"}, made=True)
document["operations"]["svc:A"]["resources"][0]["made"] = True
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
# A type whose ARN is all an id its service mints, found by the members naming it, or each value of one list.
document = good_document()
document["operations"]["svc:B"]["resources"][0].update(fill={}, find=["Namespace", "Id"])
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
document["operations"]["svc:B"]["resources"][0].update(find=["Ids[]"])
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
# A member filling the one variable of another type's format names that type's default when left out.
document = good_document()
document["arnFormats"]["svc"]["service"] = "arn:${Partition}:svc:${Region}:${Account}:service/${ThingName}/${Name}"
document["operations"]["svc:A"]["types"] = ["service"]
document["operations"]["svc:A"]["resources"] = [{"type": "service", "fill": {"ThingName": "thing", "Name": "Names[]"},
"defaults": {"thing": "thing"}}]
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
# A resource named through a member naming another of its service's own, which it runs on, or through each
# value of a list's field when another member is absent.
document = good_document()
document["operations"]["svc:A"]["resources"] = [{"types": ["thing"], "through": "SessionId"},
{"types": ["thing"], "through": "Parts[].PartId",
"when": {"ThingName": [None]}}]
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
def with_a_create() -> dict:
@@ -1400,54 +1454,58 @@ def test_the_vendored_file_is_well_formed():
document = json.loads(r.OUTPUT.read_text(encoding="utf-8"))
assert r.validate(document) == []
assert r.stale_namespaces(document) == []
operations = document["operations"]
assert operations["elasticloadbalancing:CreateTargetGroup"]["resources"] == [
# Every row names the APIs it is read for; SES v1's and v2's SendEmail share the entry, each member its own API's.
send = {row.get("arn"): row["apis"] for row in document["operations"]["ses:SendEmail"]["resources"] if "arn" in row}
assert send["SourceArn"] == ["query/2010-12-01"]
assert send["FromEmailAddressIdentityArn"] == ["rest-json/2019-09-27"]
operations = {operation: entry_without_apis(entry) for operation, entry in document["operations"].items()}
assert without_apis(operations["elasticloadbalancing:CreateTargetGroup"]["resources"]) == [
{"type": "targetgroup", "fill": {"TargetGroupName": "Name"}}]
assert operations["states:DescribeStateMachine"]["resources"] == [{"types": ["statemachine"], "arn": "stateMachineArn"}]
assert operations["ecr:DescribeRepositories"]["resources"] == [
assert without_apis(operations["states:DescribeStateMachine"]["resources"]) == [{"types": ["statemachine"], "arn": "stateMachineArn"}]
assert without_apis(operations["ecr:DescribeRepositories"]["resources"]) == [
{"type": "repository", "fill": {"RepositoryName": "repositoryNames[]"}, "account": "registryId"}]
# Its request has no registryId, so the repositories are the caller's.
assert operations["ecr:BatchGetRepositoryScanningConfiguration"]["resources"] == [
assert without_apis(operations["ecr:BatchGetRepositoryScanningConfiguration"]["resources"]) == [
{"type": "repository", "fill": {"RepositoryName": "repositoryNames[]"}}]
assert operations["cognito-idp:DescribeUserPool"]["resources"] == [{"type": "userpool", "fill": {"UserPoolId": "UserPoolId"}}]
assert without_apis(operations["cognito-idp:DescribeUserPool"]["resources"]) == [{"type": "userpool", "fill": {"UserPoolId": "UserPoolId"}}]
# StartExecution's name is the execution's, so only its state machine ARN is read; Step Functions drops a test
# case's `#` from it at runtime (StoredResourceArns.canonical).
assert operations["states:StartExecution"]["resources"] == [{"types": ["statemachine"], "arn": "stateMachineArn"}]
assert without_apis(operations["states:StartExecution"]["resources"]) == [{"types": ["statemachine"], "arn": "stateMachineArn"}]
# An ARN inside a structure or each of a list's structures.
assert operations["elasticloadbalancing:SetRulePriorities"]["resources"] == [
assert without_apis(operations["elasticloadbalancing:SetRulePriorities"]["resources"]) == [
{"types": ["listener-rule/app", "listener-rule/net"], "arn": "RulePriorities[].RuleArn"}]
assert operations["states:CreateStateMachineAlias"]["resources"] == [
assert without_apis(operations["states:CreateStateMachineAlias"]["resources"]) == [
{"types": ["statemachine"], "arn": "routingConfiguration[].stateMachineVersionArn"}]
# An EventBridge rule is on the bus EventBusName names, by name or ARN; a rule on the default bus, the one a
# request naming none acts on, which EventBridge gives at runtime, has no bus in its ARN, and a default bus's ARN
# puts it in that ARN's account.
assert operations["events:DescribeRule"]["resources"] == [
assert without_apis(operations["events:DescribeRule"]["resources"]) == [
{"type": "rule-on-custom-event-bus", "fill": {"EventBusName": "EventBusName", "RuleName": "Name"},
"arnOf": {"EventBusName": "event-bus"}, "unlessDefault": {"EventBusName": "event-bus"}},
{"type": "rule-on-default-event-bus", "fill": {"RuleName": "Name"}, "whenDefault": {"EventBusName": "event-bus"},
"arnOf": {"EventBusName": "event-bus"}}]
assert operations["events:DescribeEventBus"]["resources"] == [
assert without_apis(operations["events:DescribeEventBus"]["resources"]) == [
{"types": ["event-busv2"], "arn": "EventBusArn", "endpoint": "eventsv2"},
{"type": "event-bus", "fill": {"EventBusName": "Name"}, "arnOf": {"Name": "event-bus"}, "endpoint": "events"}]
# Each PutEvents entry is on the bus it names, by name or ARN (the default one, which EventBridge gives, when it
# names none); an EventBridge V2 request is on the one bus its EventBusArn names.
assert operations["events:PutEvents"]["resources"] == [
assert without_apis(operations["events:PutEvents"]["resources"]) == [
{"types": ["event-busv2"], "arn": "EventBusArn", "endpoint": "eventsv2"},
{"type": "event-bus", "fill": {"EventBusName": "Entries[].EventBusName"},
"arnOf": {"Entries[].EventBusName": "event-bus"}, "endpoint": "events"}]
# EventBridge V2 is read beside EventBridge, and where both name an operation's resources, which one applies is
# the endpoint serving the request, never a member a caller could add.
assert document["namespaces"]["events"] == ["eventbridgev2", "events"]
assert operations["events:DeleteSubscriber"]["resources"] == [{"types": ["subscriber"], "arn": "SubscriberArn"}]
assert operations["events:DeleteEventBus"]["resources"] == [
assert without_apis(operations["events:DeleteSubscriber"]["resources"]) == [{"types": ["subscriber"], "arn": "SubscriberArn"}]
assert without_apis(operations["events:DeleteEventBus"]["resources"]) == [
{"types": ["event-busv2"], "arn": "EventBusArn", "endpoint": "eventsv2"},
{"type": "event-bus", "fill": {"EventBusName": "Name"}, "endpoint": "events"}]
created = operations["events:CreateEventBus"]["resources"]
created = without_apis(operations["events:CreateEventBus"]["resources"])
assert {"type": "event-bus", "fill": {"EventBusName": "Name"}, "endpoint": "events", "made": True} in created
assert {"type": "event-busv2", "fill": {"EventBusName": "Name"}, "endpoint": "eventsv2"} in created
# A create's tags are checked on what it makes: not a dead-letter target or the bus a subscriber is made on.
assert [resource for resource in created if "arn" in resource and resource.get("made")] == []
assert [resource for resource in operations["events:CreateSubscriber"]["resources"] if resource.get("made")] == [
assert [resource for resource in without_apis(operations["events:CreateSubscriber"]["resources"]) if resource.get("made")] == [
{"type": "subscriber", "fill": {"SubscriberName": "Name"}, "made": True}]
assert not any("when" in resource or "unless" in resource
for operation, entry in operations.items() if operation.startswith("events:")
@@ -1458,17 +1516,17 @@ def test_the_vendored_file_is_well_formed():
# Lambda is read whole: a partial ARN names a function, a provisioned concurrency config acts on the version or
# alias its Qualifier names, the action the reference gives it, and AddPermission's SourceAccount is its source's.
assert "lambda" in document["namespaces"]
assert operations["lambda:Invoke"]["resources"] == [
assert without_apis(operations["lambda:Invoke"]["resources"]) == [
{"type": "function", "fill": {"FunctionName": "FunctionName"}, "partialArn": True}]
assert operations["lambda:PublishVersion"]["resources"] == [
assert without_apis(operations["lambda:PublishVersion"]["resources"]) == [
{"type": "function", "fill": {"FunctionName": "FunctionName"}, "partialArn": True}]
assert operations["lambda:GetProvisionedConcurrencyConfig"]["resources"] == [
assert without_apis(operations["lambda:GetProvisionedConcurrencyConfig"]["resources"]) == [
{"type": kind, "fill": {"FunctionName": "FunctionName", variable: "Qualifier"},
"arnOf": {"FunctionName": "function"}, "partialArn": True}
for kind, variable in (("function alias", "Alias"), ("function version", "Version"))]
assert not any("account" in resource for resource in operations["lambda:AddPermission"]["resources"])
assert operations["lambda:GetMicrovm"]["resources"] == [{"types": ["microvmImage"], "through": "microvmIdentifier"}]
assert operations["lambda:SendDurableExecutionCallbackSuccess"]["resources"] == [
assert without_apis(operations["lambda:GetMicrovm"]["resources"]) == [{"types": ["microvmImage"], "through": "microvmIdentifier"}]
assert without_apis(operations["lambda:SendDurableExecutionCallbackSuccess"]["resources"]) == [
{"types": ["durable execution"], "through": "CallbackId"}]
assert operations["lambda:GetWebFunctionEndpoint"]["resources"][0]["arnOf"] == {"functionName": "webFunction"}
# A listener is made under a load balancer, and a rule under a listener.
@@ -1480,25 +1538,25 @@ def test_the_vendored_file_is_well_formed():
# S3 is read from the table: an object by its bucket and key, a bucket per client, and DeleteObjects, whose keys
# its XML body names, left to S3.
assert "s3" in document["namespaces"]
assert operations["s3:PutObject"]["resources"] == [
assert without_apis(operations["s3:PutObject"]["resources"]) == [
{"type": "object", "fill": {"BucketName": "Bucket", "ObjectName": "Key"}}]
assert operations["s3:CreateBucket"]["locatedApart"] == {"s3": {"Bucket": "{Bucket}"}, "s3control": {"Bucket": "{name}"}}
assert operations["s3:DeleteObjects"]["unread"] == ["Delete.Objects[].Key"]
# An SQS request names its queue by URL, which SQS finds as its handlers do; a create names it by name.
assert operations["sqs:SendMessage"]["resources"] == [{"type": "queue", "fill": {}, "find": ["QueueUrl"]}]
assert operations["sqs:CreateQueue"]["resources"] == [{"type": "queue", "fill": {"QueueName": "QueueName"}}]
assert without_apis(operations["sqs:SendMessage"]["resources"]) == [{"type": "queue", "fill": {}, "find": ["QueueUrl"]}]
assert without_apis(operations["sqs:CreateQueue"]["resources"]) == [{"type": "queue", "fill": {"QueueName": "QueueName"}}]
# Transfer Family is read whole: a server by its id, a user by its server and name.
assert "transfer" in document["namespaces"] and "transfer" not in document["notCovered"]
assert operations["transfer:DescribeUser"]["resources"] == [
assert without_apis(operations["transfer:DescribeUser"]["resources"]) == [
{"type": "user", "fill": {"ServerId": "ServerId", "UserName": "UserName"}}]
# An import makes a resource whose id Transfer Family mints, open, not filled from the body it imports.
assert operations["transfer:ImportCertificate"]["makes"] == [{"type": "certificate", "fill": {}}]
assert operations["transfer:ImportHostKey"]["makes"] == [{"type": "host-key", "fill": {"ServerId": "ServerId"}}]
# CloudWatch is read whole: each alarm a list names, and a dashboard by its name, its ARN with no Region.
assert "cloudwatch" in document["namespaces"] and "cloudwatch" not in document["notCovered"]
assert operations["cloudwatch:DeleteAlarms"]["resources"] == [
assert without_apis(operations["cloudwatch:DeleteAlarms"]["resources"]) == [
{"type": "alarm", "fill": {"AlarmName": "AlarmNames[]"}}]
assert operations["cloudwatch:DeleteDashboards"]["resources"] == [
assert without_apis(operations["cloudwatch:DeleteDashboards"]["resources"]) == [
{"type": "dashboard", "fill": {"DashboardName": "DashboardNames[]"}}]
assert document["arnFormats"]["cloudwatch"]["dashboard"] == (
"arn:${Partition}:cloudwatch::${Account}:dashboard/${DashboardName}")
@@ -1506,18 +1564,18 @@ def test_the_vendored_file_is_well_formed():
assert "comprehend" in document["namespaces"] and "comprehend" not in document["notCovered"]
assert operations["comprehend:DetectSentiment"] == {
"action": "comprehend:DetectSentiment", "types": [], "resources": []}
assert operations["comprehend:DescribeDocumentClassifier"]["resources"] == [
assert without_apis(operations["comprehend:DescribeDocumentClassifier"]["resources"]) == [
{"types": ["document-classifier"], "arn": "DocumentClassifierArn"}]
# Config is read whole: a rule is found by its name, its ARN ending in the id Config mints; a conformance pack is
# its name, the id it mints after it found the same way when Config holds the pack.
assert "config" in document["namespaces"] and "config" not in document["notCovered"]
assert operations["config:DeleteConfigRule"]["resources"] == [
assert without_apis(operations["config:DeleteConfigRule"]["resources"]) == [
{"type": "ConfigRule", "fill": {}, "find": ["ConfigRuleName"]}]
assert operations["config:DeleteConformancePack"]["resources"] == [
assert without_apis(operations["config:DeleteConformancePack"]["resources"]) == [
{"type": "ConformancePack", "fill": {"ConformancePackName": "ConformancePackName"}}]
# An aggregation authorization is the caller's, its path the account and Region it authorizes; a recorder put
# names its recorder in the ConfigurationRecorder structure.
assert operations["config:PutAggregationAuthorization"]["resources"] == [
assert without_apis(operations["config:PutAggregationAuthorization"]["resources"]) == [
{"type": "AggregationAuthorization",
"fill": {"AggregatorAccount": "AuthorizedAccountId", "AggregatorRegion": "AuthorizedAwsRegion"}}]
assert {"type": "ConfigurationRecorder", "fill": {"RecorderName": "ConfigurationRecorder.name"}} in operations[
@@ -1525,7 +1583,7 @@ def test_the_vendored_file_is_well_formed():
# DMS is read whole: an existing resource by the ARN its request names it by, each format ending in a literal `*`.
assert document["arnFormats"]["dms"]["Endpoint"] == "arn:${Partition}:dms:${Region}:${Account}:endpoint:*"
assert "dms" in document["namespaces"] and "dms" not in document["notCovered"]
assert operations["dms:DeleteEndpoint"]["resources"] == [{"types": ["Endpoint"], "arn": "EndpointArn"}]
assert without_apis(operations["dms:DeleteEndpoint"]["resources"]) == [{"types": ["Endpoint"], "arn": "EndpointArn"}]
# An endpoint written with no CertificateArn names no certificate.
assert not any(resource.get("type") == "Certificate" for resource in operations["dms:CreateEndpoint"]["resources"])
# ElastiCache is read whole: a cluster, group or user by the identifier its request names.
@@ -1541,7 +1599,7 @@ def test_the_vendored_file_is_well_formed():
# CreateCluster makes a cluster, whose tags are checked on it, not on the multi-Region cluster it may join.
assert operations["memorydb:CreateCluster"]["makes"] == [
{"type": "cluster", "fill": {"ClusterName": "ClusterName"}}]
assert operations["elasticache:ModifyUserGroup"]["resources"] == [
assert without_apis(operations["elasticache:ModifyUserGroup"]["resources"]) == [
{"type": "usergroup", "fill": {"UserGroupId": "UserGroupId"}},
{"type": "user", "fill": {"UserId": "UserIdsToAdd[]"}}, {"type": "user", "fill": {"UserId": "UserIdsToRemove[]"}}]
# Identity Store is read whole: the identity store and the user or group a request names by id.
@@ -1558,27 +1616,27 @@ def test_the_vendored_file_is_well_formed():
operations["identitystore:GetUserId"]["resources"]
# MemoryDB is read whole: a cluster, ACL or user by its name.
assert "memorydb" in document["namespaces"] and "memorydb" not in document["notCovered"]
assert operations["memorydb:DeleteACL"]["resources"] == [{"type": "acl", "fill": {"AclName": "ACLName"}}]
assert without_apis(operations["memorydb:DeleteACL"]["resources"]) == [{"type": "acl", "fill": {"AclName": "ACLName"}}]
# Route 53 Resolver is read whole: a rule, an endpoint or a domain list by the id its request names.
assert "route53resolver" in document["namespaces"] and "route53resolver" not in document["notCovered"]
assert {"type": "inference-recommendations-job", "fill": {"InferenceRecommendationsJobName": "JobName"}} in \
operations["sagemaker:DescribeInferenceRecommendationsJob"]["resources"]
assert operations["route53resolver:GetResolverRule"]["resources"] == [
assert without_apis(operations["route53resolver:GetResolverRule"]["resources"]) == [
{"type": "resolver-rule", "fill": {"ResourceId": "ResolverRuleId"}}]
# CreateOutpostResolver's OutpostArn is an Outpost's ARN, so it holds no resolver: it makes its own, id open.
assert operations["route53resolver:CreateOutpostResolver"]["resources"] == [
assert without_apis(operations["route53resolver:CreateOutpostResolver"]["resources"]) == [
{"type": "outpost-resolver", "fill": {}}]
# SageMaker is read whole: a model, an endpoint or a training job by its name.
assert "sagemaker" in document["namespaces"] and "sagemaker" not in document["notCovered"]
assert operations["sagemaker:DescribeModel"]["resources"] == [{"type": "model", "fill": {"ModelName": "ModelName"}}]
assert without_apis(operations["sagemaker:DescribeModel"]["resources"]) == [{"type": "model", "fill": {"ModelName": "ModelName"}}]
# Transcribe is read whole: a transcription job or a vocabulary by its name.
assert "transcribe" in document["namespaces"] and "transcribe" not in document["notCovered"]
assert operations["transcribe:GetTranscriptionJob"]["resources"] == [
assert without_apis(operations["transcribe:GetTranscriptionJob"]["resources"]) == [
{"type": "transcriptionjob", "fill": {"JobName": "TranscriptionJobName"}}]
# A scalable target is found by the three members naming it, its ARN ending in the id the service mints.
assert operations["application-autoscaling:DeregisterScalableTarget"]["resources"] == [
assert without_apis(operations["application-autoscaling:DeregisterScalableTarget"]["resources"]) == [
{"type": "ScalableTarget", "fill": {}, "find": ["ServiceNamespace", "ResourceId", "ScalableDimension"]}]
assert operations["application-autoscaling:TagResource"]["resources"] == [
assert without_apis(operations["application-autoscaling:TagResource"]["resources"]) == [
{"types": ["ScalableTarget"], "arn": "ResourceARN"}]
# A Data API request runs on the cluster it names, or on the serverless workgroup its name or ARN finds.
assert operations["redshift-data:ExecuteStatement"]["resources"][1:] == [
@@ -1588,8 +1646,8 @@ def test_the_vendored_file_is_well_formed():
# A request naming its session alone runs on the cluster or workgroup the session was opened on.
assert operations["redshift-data:BatchExecuteStatement"]["resources"][-1] == {
"types": ["cluster", "workgroup"], "through": "SessionId"}
assert operations["redshift-data:ListStatements"]["resources"] == []
assert operations["redshift-data:ListSessions"]["resources"] == []
assert without_apis(operations["redshift-data:ListStatements"]["resources"]) == []
assert without_apis(operations["redshift-data:ListSessions"]["resources"]) == []
# The v2 API's Type picks the load balancer it creates, application when it gives none.
assert operations["elasticloadbalancing:CreateLoadBalancer"]["resources"][1] == {
"type": "loadbalancer/app/", "fill": {"LoadBalancerName": "Name"}, "when": {"Type": ["application", None]}}
@@ -1612,10 +1670,10 @@ def test_a_measured_operation_takes_the_resources_aws_was_measured_to_check_wher
isolated.setattr(r, "MEASURED", {"probed:ListThings": ([{"type": "thing", "fill": {}}], PROBED)})
document = r.build(measured_documents(tmp_path, []), "test", tmp_path, "botocore test")
# The measured resources replace what the rules read, keeping the reference's empty types.
assert document["operations"]["probed:ListThings"] == {
assert entry_without_apis(document["operations"]["probed:ListThings"]) == {
"action": "probed:ListThings", "types": [], "resources": [{"type": "thing", "fill": {}}]}
assert r.reads("probed:ListThings")
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert r.derive(document, tmp_path) == []
@@ -1679,7 +1737,7 @@ def test_a_forwarded_operation_is_also_checked_as_the_action_on_what_its_record_
assert document["forwardedActions"] == {
"keys:Decrypt": {"type": "key", "format": KEY_FORMAT, "viaService": "keys:ViaService"}}
assert "forwarded" not in document["operations"]["svc:ListThings"]
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert r.derive(document, tmp_path) == []
assert json.loads(r.render(document)) == document
# An action the reference gives no ViaService key carries none.
@@ -1812,11 +1870,11 @@ def test_a_rest_request_reads_its_path_and_query_members_and_records_where_the_o
"ListThings": {"Marker": "querystring:marker"}})
write_models(tmp_path, {"svc": svc})
document = r.build(DOCUMENTS, "test", tmp_path, "botocore test")
assert document["operations"]["svc:GetThing"] == {
assert entry_without_apis(document["operations"]["svc:GetThing"]) == {
"action": "svc:GetThing", "types": ["thing"], "resources": [{"type": "thing", "fill": {"ThingName": "ThingName"}}],
"located": {"ThingName": "{Name}"}}
assert "located" not in document["operations"]["svc:ListThings"]
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
assert r.derive(document, tmp_path) == []
@@ -1890,7 +1948,7 @@ def test_a_type_a_body_the_reader_does_not_read_names_by_a_key_shape_is_left_unr
"In": {"type": "structure", "members": {
"Bucket": {"shape": "String", "location": "uri", "locationName": "Bucket"},
"Delete": {"shape": "Delete"}}}}
models = {"s3": {"metadata": {"protocol": "rest-xml"}, "operations": {"DeleteObjects": {"input": {"shape": "In"}}},
models = {"s3": {"metadata": {"apiVersion": "2020-01-01", "protocol": "rest-xml"}, "operations": {"DeleteObjects": {"input": {"shape": "In"}}},
"shapes": shapes}}
bucket_only = [{"type": "object", "fill": {"BucketName": "Bucket"}}]
assert r.body_only_identifiers(["object"], OBJECTS, bucket_only, models, "DeleteObjects") == ["Delete.Objects[].Key"]
@@ -1898,7 +1956,7 @@ def test_a_type_a_body_the_reader_does_not_read_names_by_a_key_shape_is_left_unr
assert r.body_only_identifiers(["object"], OBJECTS, [{"type": "object", "fill": {
"BucketName": "Bucket", "ObjectName": "Key"}}], models, "DeleteObjects") == []
# A body the reader reads leaves nothing unread.
rest_json = {"s3": {**models["s3"], "metadata": {"protocol": "rest-json"}}}
rest_json = {"s3": {**models["s3"], "metadata": {"apiVersion": "2020-01-01", "protocol": "rest-json"}}}
assert r.body_only_identifiers(["object"], OBJECTS, bucket_only, rest_json, "DeleteObjects") == []
@@ -1918,7 +1976,7 @@ def test_a_member_located_apart_names_a_client_whose_routes_are_vendored_and_an_
monkeypatch.setattr(r, "REST_MODELS", {"one": "svc"})
entry = document["operations"]["svc:GetThing"]
entry.update(locatedApart={"one": {"ThingName": "{name}"}}, unread=["Delete.Objects[].Key"])
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
for broken in ({"locatedApart": {"two": {"ThingName": "{name}"}}}, {"locatedApart": {"one": {"ThingName": "x"}}},
{"locatedApart": {}}):
assert any("locates apart" in problem for problem in r.validate(
@@ -1957,7 +2015,7 @@ def test_a_namespace_reads_the_operations_of_the_rest_models_floci_routes_under_
assert r.main(["--source-dir", str(sources), "--botocore-data", str(tmp_path), "--output", str(output)]) == 0
document = json.loads(output.read_text())
assert document["namespaces"]["svc"] == ["svc", "svc-v2"]
assert document["operations"]["svc:DescribeThing"] == {
assert entry_without_apis(document["operations"]["svc:DescribeThing"]) == {
"action": "svc:DescribeThing", "types": ["thing"],
"resources": [{"type": "thing", "fill": {"ThingName": "ThingName"}}], "located": {"ThingName": "{ThingName}"}}
assert r.main(["--check", "--botocore-data", str(tmp_path), "--output", str(output)]) == 0
@@ -2179,8 +2237,8 @@ def test_controltower_entries_are_derived_without_operation_corrections(operatio
data, _ = resolve_botocore_data(None)
model = r.load_models(data, {"controltower"})
expected = document["operations"][key]
assert r.entry_for(key, {"action": expected["action"], "types": expected["types"]},
document["arnFormats"]["controltower"], model) == expected
assert r.with_read_apis(r.entry_for(key, {"action": expected["action"], "types": expected["types"]},
document["arnFormats"]["controltower"], model), key, model) == expected
@pytest.mark.parametrize("pattern, expected", [
@@ -2213,7 +2271,7 @@ def test_explicit_arn_member_set_is_respected_by_resource_mapping():
@pytest.mark.parametrize("member", ["opaqueReference", "targetApplicationArn", "applicationArn"])
def test_arn_pattern_does_not_turn_unrelated_members_into_identifiers(member):
model = {
"metadata": {"protocol": "json", "endpointPrefix": "svc"},
"metadata": {"apiVersion": "2020-01-01", "protocol": "json", "endpointPrefix": "svc"},
"operations": {"ReadPool": {"input": {"shape": "Input"}}},
"shapes": {"Input": {"type": "structure", "members": {member: {"shape": "Value"}}},
"Value": {"type": "string", "pattern": "arn:.*"}},
@@ -2309,7 +2367,7 @@ def documented(operation: str, fields: dict[str, tuple[str, str]], output: dict[
if output:
shapes["Out"] = {"type": "structure", "members": {name: {"shape": shape} for name, shape in output.items()}}
spec["output"] = {"shape": "Out"}
return {"metadata": {"protocol": protocol, "endpointPrefix": "svc"}, "operations": {operation: spec}, "shapes": shapes}
return {"metadata": {"apiVersion": "2020-01-01", "protocol": protocol, "endpointPrefix": "svc"}, "operations": {operation: spec}, "shapes": shapes}
DOCUMENTED = {"pipeline": "arn:${Partition}:svc:${Region}:${Account}:pipeline/${PipelineName}",
@@ -2471,7 +2529,7 @@ def cluster_model(operation: str, docs: dict[str, str], required: tuple[str, ...
"In": {"type": "structure", "required": list(required), "members": {
name: {"shape": "Names" if name.endswith("s") else "String", "documentation": doc}
for name, doc in docs.items()}}}
return {"svc": {"metadata": {"protocol": "json"}, "operations": {operation: {"input": {"shape": "In"}}},
return {"svc": {"metadata": {"apiVersion": "2020-01-01", "protocol": "json"}, "operations": {operation: {"input": {"shape": "In"}}},
"shapes": shapes}}
@@ -2570,7 +2628,7 @@ def test_each_elements_id_whose_target_type_is_one_type_fills_that_types_last_va
"Attributes": {"type": "list", "member": {"shape": "Attribute"}},
"In": {"type": "structure", "members": {"cluster": {"shape": "String"},
"attributes": {"shape": "Attributes"}}}}
models = {"svc": {"metadata": {"protocol": "json"}, "operations": {"PutAttributes": {"input": {"shape": "In"}}},
models = {"svc": {"metadata": {"apiVersion": "2020-01-01", "protocol": "json"}, "operations": {"PutAttributes": {"input": {"shape": "In"}}},
"shapes": shapes}}
typed = r.typed_target_fields(models, "PutAttributes")
assert typed == {"attributes[].targetId": ["container-instance"]}
@@ -3206,7 +3264,7 @@ def test_the_statements_are_built_checked_offline_and_verified_against_aws_and_t
assert document["statementActions"] == {"glue:GetDatabase": ["catalog", "database", "rootcatalog"]}
assert document["statements"] == {"svc:GetThing": {"CREATE DATABASE": [{"action": "glue:GetDatabase", "resources": [
{"type": "rootcatalog", "fill": {}}, {"type": "database", "fill": {"DatabaseName": "database"}}]}]}}
assert r.validate(document) == [] and r.derive(document, tmp_path) == []
assert r.validate(with_apis_named(document)) == [] and r.derive(document, tmp_path) == []
assert json.loads(r.render(document)) == document
# A statement edited by hand, or a source changed without a sync, fails the offline check.
@@ -3287,7 +3345,7 @@ def test_nested_record_id_finds_only_containing_and_adjacent_resource_types():
"InterfaceAttachment": {"type": "structure", "members": {
"AttachmentId": {"shape": "String"}, "InstanceId": {"shape": "String"}}}}
shapes["Request"] = {"type": "structure", "members": {"AttachmentId": {"shape": "String"}}}
models = {"svc": {"shapes": shapes, "metadata": {"protocol": "json"},
models = {"svc": {"shapes": shapes, "metadata": {"apiVersion": "2020-01-01", "protocol": "json"},
"operations": {"DetachInterface": {"input": {"shape": "Request"}}}}}
expected = [{"type": kind, "fill": {}, "find": ["AttachmentId"]} for kind in ("instance", "interface")]
assert r.read_resources("svc:DetachInterface", list(formats), formats, models) == expected
@@ -3343,7 +3401,7 @@ def keys_model() -> dict:
}
operations = {name: {"name": name, "input": {"shape": f"{name}Request"}}
for name in ("ReEncrypt", "UpdateAlias", "DeleteAlias", "ReplicateKey")}
return {"metadata": {"protocol": "json", "endpointPrefix": "kms"}, "operations": operations, "shapes": shapes}
return {"metadata": {"apiVersion": "2020-01-01", "protocol": "json", "endpointPrefix": "kms"}, "operations": operations, "shapes": shapes}
def keys_row(operation: str, actions: list[str], items: list[str]) -> dict:
@@ -3428,7 +3486,7 @@ def test_an_operation_checked_as_several_actions_checks_each_resource_as_one_of_
"resources": [{"type": "key", "fill": {"KeyId": "SourceKeyId"}, "action": "svc:ReEncryptFrom"},
{"type": "key", "fill": {"KeyId": "DestinationKeyId"}, "action": "svc:ReEncryptTo"}]}
document["operations"] = dict(sorted({**document["operations"], "svc:ReEncrypt": entry}.items()))
assert r.validate(document) == []
assert r.validate(with_apis_named(document)) == []
unchecked = dict(entry, resources=[{"type": "key", "fill": {"KeyId": "SourceKeyId"}}])
document["operations"]["svc:ReEncrypt"] = unchecked
assert any("none of the actions" in problem for problem in r.validate(document))
@@ -3513,7 +3571,7 @@ def dynamodb_model() -> dict:
}
operations = {name: {"name": name, "input": {"shape": f"{name}Input"}}
for name in ("TransactWriteItems", "ExecuteStatement", "BatchExecuteStatement", "BatchGetItem")}
return {"metadata": {"protocol": "json", "endpointPrefix": "dynamodb"}, "operations": operations, "shapes": shapes}
return {"metadata": {"apiVersion": "2020-01-01", "protocol": "json", "endpointPrefix": "dynamodb"}, "operations": operations, "shapes": shapes}
def test_each_transaction_item_is_checked_as_the_action_the_vendored_page_gives_its_kind():
@@ -3600,7 +3658,7 @@ def iam_model() -> dict:
for operation, names in members.items():
shapes[f"{operation}Request"] = {"type": "structure", "members": {name: {"shape": "name"} for name in names}}
operations = {name: {"name": name, "input": {"shape": f"{name}Request"}} for name in members}
return {"metadata": {"protocol": "query", "endpointPrefix": "iam"}, "operations": operations, "shapes": shapes}
return {"metadata": {"apiVersion": "2020-01-01", "protocol": "query", "endpointPrefix": "iam"}, "operations": operations, "shapes": shapes}
def test_the_identifiers_give_the_types_whose_arn_holds_a_name_after_its_path():
@@ -3772,7 +3830,7 @@ SSM_SESSION_FORMATS = {
@pytest.fixture
def session_models() -> dict[str, dict]:
return {"ssm": {
"metadata": {"protocol": "json"},
"metadata": {"apiVersion": "2020-01-01", "protocol": "json"},
"operations": {operation: {"input": {"shape": operation + "Request"}}
for operation in ("StartSession", "GetConnectionStatus", "SendCommand")},
"shapes": {