mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(iam): read Identity Store from the generated tables (#9315)
Move `identitystore` from NOT_COVERED to NAMESPACES in regen_iam_request_resources.py, so Identity Store requests are checked on the resources they name instead of `*`: the identity store its IdentityStoreId names, and the group, user or membership its id names, whose ARNs have no Region and no account; the list calls also on every group, user or membership, as the Service Reference gives them. A type an action requires that its request does not name is now read too. Which types an action requires is what the Service Authorization Reference marks with an asterisk, which neither botocore nor the Service Reference says, so fetch_required_resource_types.py vendors that page's actions table as it stands into tools/aws/sources/required-resource-types.json, granted for Identity Store alone. Two generic readings use it: a required type the record of the resource the request names holds is read through that resource's id (DescribeGroupMembership and DeleteGroupMembership, the membership's group and user), and a required type whose id a lookup returns is found by the members its request gives, each way it may give them apart (GetGroupMembershipId, GetGroupId, GetUserId). The reader lets a find name a field of a structure at any depth and gives the service the members' paths with their values, and Identity Store answers both as its handlers find them. No other namespace's rows change.
This commit is contained in:
1 parent
8758208313
commit
3fbb0ced10
20 files changed
+1045
-21
No files matched your search
@@ -646,7 +646,9 @@ IAM_REQUEST_RESOURCES_PATHS := src/main/resources/aws/iam-request-resources.json
|
|||||||
tools/aws/sources/kms-api-permissions.json tools/aws/fetch_kms_api_permissions.py \
|
tools/aws/sources/kms-api-permissions.json tools/aws/fetch_kms_api_permissions.py \
|
||||||
tools/aws/test_fetch_kms_api_permissions.py tools/aws/sources/dynamodb-permissions.json \
|
tools/aws/test_fetch_kms_api_permissions.py tools/aws/sources/dynamodb-permissions.json \
|
||||||
tools/aws/fetch_dynamodb_permissions.py tools/aws/test_fetch_dynamodb_permissions.py \
|
tools/aws/fetch_dynamodb_permissions.py tools/aws/test_fetch_dynamodb_permissions.py \
|
||||||
tools/aws/sources/iam-identifiers.json tools/aws/fetch_iam_identifiers.py tools/aws/test_fetch_iam_identifiers.py
|
tools/aws/sources/iam-identifiers.json tools/aws/fetch_iam_identifiers.py tools/aws/test_fetch_iam_identifiers.py \
|
||||||
|
tools/aws/sources/required-resource-types.json tools/aws/fetch_required_resource_types.py \
|
||||||
|
tools/aws/test_fetch_required_resource_types.py
|
||||||
|
|
||||||
iam-data-verify: ## CI gate (online): every vendored IAM file must still match AWS; CHANGED="<paths>" checks only the ones they cover
|
iam-data-verify: ## CI gate (online): every vendored IAM file must still match AWS; CHANGED="<paths>" checks only the ones they cover
|
||||||
@# Every check runs even when an earlier one fails, so one file's drift cannot hide another's
|
@# Every check runs even when an earlier one fails, so one file's drift cannot hide another's
|
||||||
|
|||||||
@@ -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,
|
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
|
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
|
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 and Amazon ElastiCache 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 and AWS Identity Store 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
|
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
|
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
|
of a type the action acts on, or members filling the variables of a type's format. Nothing in it is
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ Groups, users, and group memberships are persisted through `StorageFactory` and
|
|||||||
|
|
||||||
Deleting a user or group removes its related local group memberships so subsequent membership queries do not retain dangling references.
|
Deleting a user or group removes its related local group memberships so subsequent membership queries do not retain dangling references.
|
||||||
|
|
||||||
|
With IAM enforcement on, each action is checked on the resources the AWS Service Authorization Reference lists for it, read from the request: the identity store its `IdentityStoreId` names, `arn:aws:identitystore::<account>:identitystore/<id>`, and the group, user or membership its `GroupId`, `UserId`, `MemberId.UserId` or `MembershipId` names, `arn:aws:identitystore:::group/<id>` with no Region or account. The list actions are also checked on every group, user or membership (`arn:aws:identitystore:::user/*`), as the reference gives them. A type the reference marks an action as requiring that the request does not name is the one Identity Store finds from what it holds: `DescribeGroupMembership` and `DeleteGroupMembership` are also checked on the group and the user of the membership their `MembershipId` names, `GetGroupMembershipId` on the membership of its group and member, and `GetGroupId` and `GetUserId` on the group or user their `AlternateIdentifier` names; a lookup that finds nothing is checked on every resource of its type (`arn:aws:identitystore:::user/*`).
|
||||||
|
|
||||||
## IAM Identity Center SCIM
|
## IAM Identity Center SCIM
|
||||||
|
|
||||||
Floci also accepts IAM Identity Center SCIM v2 requests under `/{tenant_id}/scim/v2`. SCIM requests require the AWS-supported `Authorization: Bearer <token>` authentication shape. Because Floci does not provision real IAM Identity Center access tokens, it validates against the configured local token. The default is `floci-scim-token`; set `FLOCI_SERVICES_IDENTITYSTORE_SCIM_BEARER_TOKEN` to override it. The tenant must also resolve to an existing IAM Identity Center identity store.
|
Floci also accepts IAM Identity Center SCIM v2 requests under `/{tenant_id}/scim/v2`. SCIM requests require the AWS-supported `Authorization: Bearer <token>` authentication shape. Because Floci does not provision real IAM Identity Center access tokens, it validates against the configured local token. The default is `floci-scim-token`; set `FLOCI_SERVICES_IDENTITYSTORE_SCIM_BEARER_TOKEN` to override it. The tenant must also resolve to an existing IAM Identity Center identity store.
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ final class RequestResourceMembers {
|
|||||||
*/
|
*/
|
||||||
private static final Pattern FILL_MEMBER = Pattern.compile("[A-Za-z][A-Za-z0-9_]*(\\[]|\\[]\\.[A-Za-z][A-Za-z0-9_]*"
|
private static final Pattern FILL_MEMBER = Pattern.compile("[A-Za-z][A-Za-z0-9_]*(\\[]|\\[]\\.[A-Za-z][A-Za-z0-9_]*"
|
||||||
+ "(\\.[A-Za-z][A-Za-z0-9_]*)?|\\{}|\\{}\\.[A-Za-z][A-Za-z0-9_]*|\\.[A-Za-z][A-Za-z0-9_]*)?");
|
+ "(\\.[A-Za-z][A-Za-z0-9_]*)?|\\{}|\\{}\\.[A-Za-z][A-Za-z0-9_]*|\\.[A-Za-z][A-Za-z0-9_]*)?");
|
||||||
|
/**
|
||||||
|
* A member a service finds a resource by: one list, or a value at any depth of structures, as a lookup's request
|
||||||
|
* gives it ({@code AlternateIdentifier.ExternalId.Id}).
|
||||||
|
*/
|
||||||
|
private static final Pattern FOUND_MEMBER =
|
||||||
|
Pattern.compile("[A-Za-z][A-Za-z0-9_]*(\\[]|(\\.[A-Za-z][A-Za-z0-9_]*)*)");
|
||||||
/** An ARN format's leading resource type word, and the rest of its resource. */
|
/** An ARN format's leading resource type word, and the rest of its resource. */
|
||||||
private static final Pattern RESOURCE_PART = Pattern.compile(
|
private static final Pattern RESOURCE_PART = Pattern.compile(
|
||||||
"^arn:\\$\\{Partition}:[^:]*:[^:]*:[^:]*:([A-Za-z][A-Za-z0-9-]*)(.*)$");
|
"^arn:\\$\\{Partition}:[^:]*:[^:]*:[^:]*:([A-Za-z][A-Za-z0-9-]*)(.*)$");
|
||||||
@@ -852,7 +858,7 @@ final class RequestResourceMembers {
|
|||||||
});
|
});
|
||||||
List<Member> find = new ArrayList<>();
|
List<Member> find = new ArrayList<>();
|
||||||
for (JsonNode member : resource.path("find")) {
|
for (JsonNode member : resource.path("find")) {
|
||||||
find.add(member(operation, member.asText("")));
|
find.add(foundMember(operation, member.asText("")));
|
||||||
}
|
}
|
||||||
if (resource.has("find") && (!resource.path("find").isArray() || find.isEmpty() || !fill.isEmpty()
|
if (resource.has("find") && (!resource.path("find").isArray() || find.isEmpty() || !fill.isEmpty()
|
||||||
|| (find.size() > 1 && find.stream().anyMatch(Member::list))
|
|| (find.size() > 1 && find.stream().anyMatch(Member::list))
|
||||||
@@ -1056,6 +1062,17 @@ final class RequestResourceMembers {
|
|||||||
return path.endsWith("[]") ? new Member(path.substring(0, path.length() - 2), true) : new Member(path, false);
|
return path.endsWith("[]") ? new Member(path.substring(0, path.length() - 2), true) : new Member(path, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** A member a service finds a resource by: {@code Name[]}, {@code Name}, or a field of its structures, any deep. */
|
||||||
|
private static Member foundMember(String operation, String path) {
|
||||||
|
if (!FOUND_MEMBER.matcher(path).matches()) {
|
||||||
|
throw new IllegalStateException(RESOURCE_NAME + " reads " + operation + " at " + path
|
||||||
|
+ ", which is no member");
|
||||||
|
}
|
||||||
|
int dot = path.indexOf('.');
|
||||||
|
return dot < 0 ? member(operation, path)
|
||||||
|
: new Member(path.substring(0, dot), false, foundMember(operation, path.substring(dot + 1)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A member filling a variable: {@code Name}, {@code Name[]}, or a field of a structure, {@code Name.Field}, of
|
* A member filling a variable: {@code Name}, {@code Name[]}, or a field of a structure, {@code Name.Field}, of
|
||||||
* each of a list's structures, {@code Name[].Field}, or of a field of each of them, {@code Name[].Item.Field}, or
|
* each of a list's structures, {@code Name[].Field}, or of a field of each of them, {@code Name[].Item.Field}, or
|
||||||
|
|||||||
@@ -1132,8 +1132,8 @@ public final class RequestResources {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (String value : values(form, body, resource.find().getFirst())) {
|
for (String value : values(form, body, resource.find().getFirst())) {
|
||||||
foundOne(arns, resource.types().getFirst(), List.of(value), formats, partition, region, account,
|
foundOne(arns, resource.types().getFirst(), List.of(resource.find().getFirst().path()),
|
||||||
accountId, stored);
|
List.of(value), formats, partition, region, account, accountId, stored);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1152,15 +1152,19 @@ public final class RequestResources {
|
|||||||
if (account == null) {
|
if (account == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foundOne(arns, resource.types().getFirst(), names, formats, partition, region, account, accountId, stored);
|
foundOne(arns, resource.types().getFirst(), resource.find().stream().map(RequestResourceMembers.Member::path)
|
||||||
|
.toList(), names, formats, partition, region, account, accountId, stored);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The resource of the type {@code stored} finds by the values in the account, or else its ARN with its id open. */
|
/**
|
||||||
private static void foundOne(Set<String> arns, String type, List<String> names,
|
* The resource of the type {@code stored} finds by the values of the members in the account, or else its ARN with
|
||||||
|
* its id open.
|
||||||
|
*/
|
||||||
|
private static void foundOne(Set<String> arns, String type, List<String> members, List<String> names,
|
||||||
Map<String, RequestResourceMembers.ArnFormat> formats, String partition,
|
Map<String, RequestResourceMembers.ArnFormat> formats, String partition,
|
||||||
String region, String account, String accountId, StoredResourceArns stored) {
|
String region, String account, String accountId, StoredResourceArns stored) {
|
||||||
Optional<String> found = stored == null ? Optional.empty()
|
Optional<String> found = stored == null ? Optional.empty()
|
||||||
: account.equals(accountId) ? stored.findByMembers(type, names, region)
|
: account.equals(accountId) ? stored.findByMembers(type, members, names, region)
|
||||||
: stored.findInAccount(type, names, account, region);
|
: stored.findInAccount(type, names, account, region);
|
||||||
arns.add(found.orElseGet(() -> render(formats.get(type).format(), Map.of(), partition, region, account)));
|
arns.add(found.orElseGet(() -> render(formats.get(type).format(), Map.of(), partition, region, account)));
|
||||||
}
|
}
|
||||||
@@ -1264,7 +1268,8 @@ public final class RequestResources {
|
|||||||
* The ARN of the namespace's resource of {@code type} named by {@code id}, the one variable of its format past
|
* The ARN of the namespace's resource of {@code type} named by {@code id}, the one variable of its format past
|
||||||
* partition, Region and account, as a request naming the resource by its id gives it.
|
* partition, Region and account, as a request naming the resource by its id gives it.
|
||||||
*/
|
*/
|
||||||
static String idArn(String namespace, String type, String id, String partition, String region, String accountId) {
|
public static String idArn(String namespace, String type, String id, String partition, String region,
|
||||||
|
String accountId) {
|
||||||
return idArn(RequestResourceMembers.table().formats().get(namespace).get(type).format(), id, partition, region,
|
return idArn(RequestResourceMembers.table().formats().get(namespace).get(type).format(), id, partition, region,
|
||||||
accountId);
|
accountId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,4 +227,13 @@ public interface StoredResourceArns {
|
|||||||
default Optional<String> findByMembers(String type, List<String> names, String region) {
|
default Optional<String> findByMembers(String type, List<String> names, String region) {
|
||||||
return find(type, names, region);
|
return find(type, names, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* As {@link #findByMembers(String, List, String)}, with the paths of the members the values come from, as the
|
||||||
|
* table writes them ({@code AlternateIdentifier.ExternalId.Id}), for a service whose request may name the resource
|
||||||
|
* in more than one way, each the same number of values.
|
||||||
|
*/
|
||||||
|
default Optional<String> findByMembers(String type, List<String> members, List<String> names, String region) {
|
||||||
|
return findByMembers(type, names, region);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -315,6 +315,15 @@ public class IdentityStoreService implements Resettable {
|
|||||||
.orElseThrow(() -> notFound("Group membership not found."));
|
.orElseThrow(() -> notFound("Group membership not found."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The membership of that id, which its id alone names, as every identity store's ids are its own; empty when there
|
||||||
|
* is none.
|
||||||
|
*/
|
||||||
|
public Optional<Membership> findMembership(String membershipId) {
|
||||||
|
return memberships.scanForAccount(GLOBAL_PARTITION, key -> key.endsWith("::" + membershipId)).stream()
|
||||||
|
.findFirst();
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized void deleteMembership(JsonNode request) {
|
public synchronized void deleteMembership(JsonNode request) {
|
||||||
String storeId = requireStore(required(request, "IdentityStoreId"));
|
String storeId = requireStore(required(request, "IdentityStoreId"));
|
||||||
String membershipId = requireResourceId(required(request, "MembershipId"), "MembershipId");
|
String membershipId = requireResourceId(required(request, "MembershipId"), "MembershipId");
|
||||||
|
|||||||
+93
@@ -0,0 +1,93 @@
|
|||||||
|
package io.floci.aws.services.identitystore;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import io.floci.aws.core.common.AwsException;
|
||||||
|
import io.floci.aws.core.common.RegionResolver;
|
||||||
|
import io.floci.aws.core.common.RequestResources;
|
||||||
|
import io.floci.aws.core.common.StoredResourceArns;
|
||||||
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
import jakarta.inject.Inject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What IAM asks Identity Store of the resources a request names: the group and the user of the membership a
|
||||||
|
* {@code MembershipId} names, and the group, user or membership a lookup's request names by other members (an
|
||||||
|
* alternate identifier, or a group and a member), which the Service Authorization Reference requires those actions
|
||||||
|
* on. Each is found as its handler finds it.
|
||||||
|
*/
|
||||||
|
@ApplicationScoped
|
||||||
|
public class IdentityStoreStoredResourceArns implements StoredResourceArns {
|
||||||
|
|
||||||
|
private static final ObjectMapper MAPPER = new ObjectMapper();
|
||||||
|
|
||||||
|
private final IdentityStoreService identityStore;
|
||||||
|
private final RegionResolver regions;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public IdentityStoreStoredResourceArns(IdentityStoreService identityStore, RegionResolver regions) {
|
||||||
|
this.identityStore = identityStore;
|
||||||
|
this.regions = regions;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String namespace() {
|
||||||
|
return "identitystore";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Identity Store finds its resources by the members a lookup names them by, never by one name alone. */
|
||||||
|
@Override
|
||||||
|
public Optional<String> find(String type, List<String> names, String region) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The group, user or membership the lookup the members make up finds, as {@code GetGroupId}, {@code GetUserId} and
|
||||||
|
* {@code GetGroupMembershipId} find it; empty when it finds none.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Optional<String> findByMembers(String type, List<String> members, List<String> names, String region) {
|
||||||
|
if (members.size() != names.size()) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
ObjectNode request = MAPPER.createObjectNode();
|
||||||
|
for (int i = 0; i < members.size(); i++) {
|
||||||
|
ObjectNode node = request;
|
||||||
|
String[] path = members.get(i).split("\\.");
|
||||||
|
for (int j = 0; j < path.length - 1; j++) {
|
||||||
|
node = node.has(path[j]) ? (ObjectNode) node.get(path[j]) : node.putObject(path[j]);
|
||||||
|
}
|
||||||
|
node.put(path[path.length - 1], names.get(i));
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String id = switch (type) {
|
||||||
|
case "Group" -> identityStore.getGroupId(request).groupId();
|
||||||
|
case "User" -> identityStore.getUserId(request).userId();
|
||||||
|
case "GroupMembership" -> identityStore.getMembershipId(request).membershipId();
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
return Optional.ofNullable(id).map(found -> arn(type, found, region));
|
||||||
|
} catch (AwsException e) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The group and the user of the membership a {@code MembershipId} names; none when there is no such membership. */
|
||||||
|
@Override
|
||||||
|
public List<String> through(String member, String value, String region) {
|
||||||
|
if (!"MembershipId".equals(member)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
return identityStore.findMembership(value)
|
||||||
|
.map(membership -> Stream.of(arn("Group", membership.groupId(), region),
|
||||||
|
arn("User", membership.userId(), region)).toList())
|
||||||
|
.orElse(List.of());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String arn(String type, String id, String region) {
|
||||||
|
return RequestResources.idArn(namespace(), type, id, regions.partitionForRegion(region), region, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.44.9 (local/aws/botocore)", "retrieved": "2026-11-24", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.44.9 (local/aws/botocore)", "retrieved": "2026-11-24", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
||||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "apigateway": ["apigateway", "apigatewayv2"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "bedrock": ["bedrock", "bedrock-agent", "bedrock-agent-runtime", "bedrock-data-automation", "bedrock-data-automation-runtime", "bedrock-runtime"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb", "dynamodbstreams"], "ec2": ["ec2"], "ec2-instance-connect": ["ec2-instance-connect"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "iam": ["iam", "iam-toolbox"], "inspector2": ["inspector2"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "pipes": ["pipes"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "resource-groups": ["resource-groups"], "route53": ["route53"], "s3": ["s3", "s3control"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "apigateway": ["apigateway", "apigatewayv2"], "application-autoscaling": ["application-autoscaling"], "aps": ["amp"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "bedrock": ["bedrock", "bedrock-agent", "bedrock-agent-runtime", "bedrock-data-automation", "bedrock-data-automation-runtime", "bedrock-runtime"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb", "dynamodbstreams"], "ec2": ["ec2"], "ec2-instance-connect": ["ec2-instance-connect"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "iam": ["iam", "iam-toolbox"], "identitystore": ["identitystore"], "inspector2": ["inspector2"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "pipes": ["pipes"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "resource-groups": ["resource-groups"], "route53": ["route53"], "s3": ["s3", "s3control"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||||
"notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "identitystore": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "iot": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "kafka": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "memorydb": "not read yet: a later batch, with Line truncated
|
"notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "iot": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "kafka": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "memorydb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "mq": "REST: its requests name their resources in thLine truncated
|
||||||
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "apiportal", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bcm-data-hub", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "end-user-messaging", "entityresolution", "evs", "finops-agent", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "osm", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"],
|
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "apiportal", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bcm-data-hub", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "end-user-messaging", "entityresolution", "evs", "finops-agent", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "osm", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"],
|
||||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "apigateway": {"AccessLogSettings": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/accesslogsettings", "Account": "arn:${Partition}:apigateway:${Region}::/account", "Api": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}", "ApiKey": "arn:${Partition}:apigateway:${Region}::/apikeys/${ApiKeyId}", "ApiKeys": "arn:${Partition}:apigateway:${Region}::/apikeys", "ApiMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings/${ApiMappingId}", "ApiMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings", "Apis": "arn:${Partition}:apigateway:${Region}::/apis", "Authorizer": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers/${AuthorizerId}", "Authorizers": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers", "AuthorizersCache": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/cache/authorizers", "BasePathMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings/${BasePath}", "BasePathMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings", "ClientCertificate": "arn:${Partition}:apigateway:${Region}::/clientcertificates/${ClientCertificateId}", "ClientCertificates": "arn:${Partition}:apigateway:${Region}::/clientcertificates", "Cors": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/cors", "Deployment": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments/${DeploymentId}", "Deployments": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments", "DocumentationPart": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts/${DocumentationPartId}", "DocumentationParts": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts", "DocumentationVersion": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions/${DocumentationVersionId}", "DocumentationVersions": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions", "DomainName": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}", "DomainNameAccessAssociation": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations/domainname/${DomainName}/${SourceType}/${SourceId}", "DomainNameAccessAssociations": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations", "DomainNames": "arn:${Partition}:apigateway:${Region}::/domainnames", "ExportedAPI": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/exports/${Specification}", "GatewayResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses/${ResponseType}", "GatewayResponses": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses", "Integration": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}", "IntegrationResponse": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses/${IntegrationResponseId}", "IntegrationResponses": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses", "Integrations": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations", "Method": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}", "MethodResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}/responses/${StatusCode}", "Model": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}", "ModelTemplate": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}/template", "Models": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models", "Portal": "arn:${Partition}:apigateway:${Region}:${Account}:/portals/${PortalId}", "PortalProduct": "arn:${Partition}:apigateway:${Region}:${Account}:/portalproducts/$Line truncated
|
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "apigateway": {"AccessLogSettings": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/accesslogsettings", "Account": "arn:${Partition}:apigateway:${Region}::/account", "Api": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}", "ApiKey": "arn:${Partition}:apigateway:${Region}::/apikeys/${ApiKeyId}", "ApiKeys": "arn:${Partition}:apigateway:${Region}::/apikeys", "ApiMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings/${ApiMappingId}", "ApiMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/apimappings", "Apis": "arn:${Partition}:apigateway:${Region}::/apis", "Authorizer": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers/${AuthorizerId}", "Authorizers": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/authorizers", "AuthorizersCache": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/stages/${StageName}/cache/authorizers", "BasePathMapping": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings/${BasePath}", "BasePathMappings": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}/basepathmappings", "ClientCertificate": "arn:${Partition}:apigateway:${Region}::/clientcertificates/${ClientCertificateId}", "ClientCertificates": "arn:${Partition}:apigateway:${Region}::/clientcertificates", "Cors": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/cors", "Deployment": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments/${DeploymentId}", "Deployments": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/deployments", "DocumentationPart": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts/${DocumentationPartId}", "DocumentationParts": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/parts", "DocumentationVersion": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions/${DocumentationVersionId}", "DocumentationVersions": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/documentation/versions", "DomainName": "arn:${Partition}:apigateway:${Region}::/domainnames/${DomainName}", "DomainNameAccessAssociation": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations/domainname/${DomainName}/${SourceType}/${SourceId}", "DomainNameAccessAssociations": "arn:${Partition}:apigateway:${Region}:${Account}:/domainnameaccessassociations", "DomainNames": "arn:${Partition}:apigateway:${Region}::/domainnames", "ExportedAPI": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/exports/${Specification}", "GatewayResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses/${ResponseType}", "GatewayResponses": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/gatewayresponses", "Integration": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}", "IntegrationResponse": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses/${IntegrationResponseId}", "IntegrationResponses": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations/${IntegrationId}/integrationresponses", "Integrations": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/integrations", "Method": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}", "MethodResponse": "arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}/resources/${ResourceId}/methods/${HttpMethodType}/responses/${StatusCode}", "Model": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}", "ModelTemplate": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models/${ModelId}/template", "Models": "arn:${Partition}:apigateway:${Region}::/apis/${ApiId}/models", "Portal": "arn:${Partition}:apigateway:${Region}:${Account}:/portals/${PortalId}", "PortalProduct": "arn:${Partition}:apigateway:${Region}:${Account}:/portalproducts/$Line truncated
|
||||||
"pathFormats": {"apigateway": {"/restapis/{restapi_id}/models/{model_name}/default_template (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/models/${ModelName}/default_template", "/restapis/{restapi_id}/stages/{stage_name}/cache/authorizers (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/cache/authorizers", "/restapis/{restapi_id}/stages/{stage_name}/cache/data (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/cache/data", "/restapis/{restapi_id}/stages/{stage_name}/exports/{export_type} (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/exports/${ExportType}", "/sdktypes (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/sdktypes", "/sdktypes/{sdktype_id} (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/sdktypes/${SdktypeId}", "/usageplans/{usageplanId}/keys/{keyId}/usage (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/usageplans/${UsageplanId}/keys/${KeyId}/usage", "/usageplans/{usageplanId}/usage (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/usageplans/${UsageplanId}/usage", "Authorizer (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/authorizers/${Id}", "Authorizers (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/authorizers", "Deployment (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/deployments/${Id}", "Deployments (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/deployments", "Integration (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/resources/${ResourceId}/methods/${HttpMethod}/integration", "IntegrationResponse (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/resources/${ResourceId}/methods/${HttpMethod}/integration/responses/${StatusCode}", "Model (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/models/${ModelName}", "Models (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/models", "Stage (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/stages/${StageName}", "Stages (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/stages"}},
|
"pathFormats": {"apigateway": {"/restapis/{restapi_id}/models/{model_name}/default_template (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/models/${ModelName}/default_template", "/restapis/{restapi_id}/stages/{stage_name}/cache/authorizers (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/cache/authorizers", "/restapis/{restapi_id}/stages/{stage_name}/cache/data (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/cache/data", "/restapis/{restapi_id}/stages/{stage_name}/exports/{export_type} (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/restapis/${RestapiId}/stages/${StageName}/exports/${ExportType}", "/sdktypes (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/sdktypes", "/sdktypes/{sdktype_id} (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/sdktypes/${SdktypeId}", "/usageplans/{usageplanId}/keys/{keyId}/usage (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/usageplans/${UsageplanId}/keys/${KeyId}/usage", "/usageplans/{usageplanId}/usage (resource-path-specifier)": "arn:${Partition}:apigateway:${Region}::/usageplans/${UsageplanId}/usage", "Authorizer (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/authorizers/${Id}", "Authorizers (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/authorizers", "Deployment (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/deployments/${Id}", "Deployments (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/deployments", "Integration (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/resources/${ResourceId}/methods/${HttpMethod}/integration", "IntegrationResponse (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/resources/${ResourceId}/methods/${HttpMethod}/integration/responses/${StatusCode}", "Model (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/models/${ModelName}", "Models (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/models", "Stage (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/stages/${StageName}", "Stages (REST API resources)": "arn:${Partition}:apigateway:${Region}::/restapis/${ApiId}/stages"}},
|
||||||
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "apigateway": {"AccessLogSettings": ["aws:ResourceTag/"], "Api": ["aws:ResourceTag/"], "ApiKey": ["aws:ResourceTag/"], "ApiKeys": ["aws:ResourceTag/"], "ApiMapping": ["aws:ResourceTag/"], "ApiMappings": ["aws:ResourceTag/"], "Apis": ["aws:ResourceTag/"], "Authorizer": ["aws:ResourceTag/"], "Authorizers": ["aws:ResourceTag/"], "AuthorizersCache": ["aws:ResourceTag/"], "BasePathMapping": ["aws:ResourceTag/"], "BasePathMappings": ["aws:ResourceTag/"], "ClientCertificate": ["aws:ResourceTag/"], "ClientCertificates": ["aws:ResourceTag/"], "Cors": ["aws:ResourceTag/"], "Deployment": ["aws:ResourceTag/"], "Deployments": ["aws:ResourceTag/"], "DocumentationPart": ["aws:ResourceTag/"], "DocumentationParts": ["aws:ResourceTag/"], "DocumentationVersion": ["aws:ResourceTag/"], "DocumentationVersions": ["aws:ResourceTag/"], "DomainName": ["aws:ResourceTag/"], "DomainNameAccessAssociations": ["aws:ResourceTag/"], "DomainNames": ["aws:ResourceTag/"], "ExportedAPI": ["aws:ResourceTag/"], "GatewayResponse": ["aws:ResourceTag/"], "GatewayResponses": ["aws:ResourceTag/"], "Integration": ["aws:ResourceTag/"], "IntegrationResponse": ["aws:ResourceTag/"], "IntegrationResponses": ["aws:ResourceTag/"], "Integrations": ["aws:ResourceTag/"], "Method": ["aws:ResourceTag/"], "MethodResponse": ["aws:ResourceTag/"], "Model": ["aws:ResourceTag/"], "ModelTemplate": ["aws:ResourceTag/"], "Models": ["aws:ResourceTag/"], "Portal": ["aws:ResourceTag/"], "PortalProduct": ["aws:ResourceTag/"], "PrivateBasePathMapping": ["aws:ResourceTag/"], "PrivateBasePathMappings": ["aws:ResourceTag/"], "PrivateDomainName": ["aws:ResourceTag/"], "ProductPage": ["aws:ResourceTag/"], "ProductRestEndpointPage": ["aws:ResourceTag/"], "RequestValidator": ["aws:ResourceTag/"], "RequestValidators": ["aws:ResourceTag/"], "Resource": ["aws:ResourceTag/"], "Resources": ["aws:ResourceTag/"], "RestApi": ["aws:ResourceTag/"], "RestApis": ["aws:ResourceTag/"], "Route": ["aws:ResourceTag/"], "RouteRequestParameter": ["aws:ResourceTag/"], "RouteResponse": ["aws:ResourceTag/"], "RouteResponses": ["aws:ResourceTag/"], "RouteSettings": ["aws:ResourceTag/"], "Routes": ["aws:ResourceTag/"], "RoutingRule": ["aws:ResourceTag/"], "Sdk": ["aws:ResourceTag/"], "Stage": ["aws:ResourceTag/"], "Stages": ["aws:ResourceTag/"], "Template": ["aws:ResourceTag/"], "UsagePlan": ["aws:ResourceTag/"], "UsagePlanKey": ["aws:ResourceTag/"], "UsagePlanKeys": ["aws:ResourceTag/"], "UsagePlans": ["aws:ResourceTag/"], "VpcLink": ["aws:ResourceTag/"], "VpcLinks": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "aps": {"anomalydetector": ["aws:ResourceTag/"], "cluster": ["aws:ResourceTag/"], "rulegroupsnamespace": ["aws:ResourceTag/"], "scraper": ["aws:ResourceTag/"], "workspace": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-estimate": ["aws:ResourceTag/"], "bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "bedrock": {"advanced-prompt-optimization-job": ["aws:ResourceTag/"], "agent": ["aws:ResourceTag/"], "agent-alias": ["aws:ResourceTag/"], "application-inference-profile": ["aws:ResourceTag/"], "async-invoke": ["aws:ResourceTag/"], "automated-reasoning-policy": ["aws:ResourceTag/"], "automated-reasoning-policy-version": ["aws:ResourceTag/"], "blueprint": ["aws:ResourceTag/"], "blueprint-optimization-invocation": ["aws:ResourceTag/"], "custom-model": ["aws:ResourceTag/"], "custom-model-deployment": ["aws:ResourceTag/"], "data-automation-invocation-job": ["aws:ResourceTag/"], "data-automation-library": ["aws:ResourceTag/"], "data-automation-library-ingestion-job": ["aws:ResourceTag/"], "data-automation-project": ["aws:ResourceTag/"], "evaluation-job": ["aws:ResourceTag/"], "flow": ["aws:ResourceTag/"], "flow-alias": ["aws:ResourceTag/"], "guardrail": ["aws:ResourceTag/"], "imported-model": ["aws:ResourceTag/"], "knowledge-base": ["aws:ResourceTag/"], "model-copy-job": ["aws:ResourceTag/"], "model-customization-job": ["aws:ResourceTag/"], "model-evaluation-job": ["aws:ResourceTag/"], "model-import-job": ["aws:ResourceTag/"], "model-invocation-job": ["aws:ResourceTag/"], "project": ["aws:ResourceTag/"], "prompt": ["aws:ResourceTag/"], "prompt-router": ["aws:ResourceTag/"], "prompt-version": ["aws:ResourceTag/"], "provisioned-model": ["aws:ResourceTag/"], "retrieval-instruction": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/Line truncated
|
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "apigateway": {"AccessLogSettings": ["aws:ResourceTag/"], "Api": ["aws:ResourceTag/"], "ApiKey": ["aws:ResourceTag/"], "ApiKeys": ["aws:ResourceTag/"], "ApiMapping": ["aws:ResourceTag/"], "ApiMappings": ["aws:ResourceTag/"], "Apis": ["aws:ResourceTag/"], "Authorizer": ["aws:ResourceTag/"], "Authorizers": ["aws:ResourceTag/"], "AuthorizersCache": ["aws:ResourceTag/"], "BasePathMapping": ["aws:ResourceTag/"], "BasePathMappings": ["aws:ResourceTag/"], "ClientCertificate": ["aws:ResourceTag/"], "ClientCertificates": ["aws:ResourceTag/"], "Cors": ["aws:ResourceTag/"], "Deployment": ["aws:ResourceTag/"], "Deployments": ["aws:ResourceTag/"], "DocumentationPart": ["aws:ResourceTag/"], "DocumentationParts": ["aws:ResourceTag/"], "DocumentationVersion": ["aws:ResourceTag/"], "DocumentationVersions": ["aws:ResourceTag/"], "DomainName": ["aws:ResourceTag/"], "DomainNameAccessAssociations": ["aws:ResourceTag/"], "DomainNames": ["aws:ResourceTag/"], "ExportedAPI": ["aws:ResourceTag/"], "GatewayResponse": ["aws:ResourceTag/"], "GatewayResponses": ["aws:ResourceTag/"], "Integration": ["aws:ResourceTag/"], "IntegrationResponse": ["aws:ResourceTag/"], "IntegrationResponses": ["aws:ResourceTag/"], "Integrations": ["aws:ResourceTag/"], "Method": ["aws:ResourceTag/"], "MethodResponse": ["aws:ResourceTag/"], "Model": ["aws:ResourceTag/"], "ModelTemplate": ["aws:ResourceTag/"], "Models": ["aws:ResourceTag/"], "Portal": ["aws:ResourceTag/"], "PortalProduct": ["aws:ResourceTag/"], "PrivateBasePathMapping": ["aws:ResourceTag/"], "PrivateBasePathMappings": ["aws:ResourceTag/"], "PrivateDomainName": ["aws:ResourceTag/"], "ProductPage": ["aws:ResourceTag/"], "ProductRestEndpointPage": ["aws:ResourceTag/"], "RequestValidator": ["aws:ResourceTag/"], "RequestValidators": ["aws:ResourceTag/"], "Resource": ["aws:ResourceTag/"], "Resources": ["aws:ResourceTag/"], "RestApi": ["aws:ResourceTag/"], "RestApis": ["aws:ResourceTag/"], "Route": ["aws:ResourceTag/"], "RouteRequestParameter": ["aws:ResourceTag/"], "RouteResponse": ["aws:ResourceTag/"], "RouteResponses": ["aws:ResourceTag/"], "RouteSettings": ["aws:ResourceTag/"], "Routes": ["aws:ResourceTag/"], "RoutingRule": ["aws:ResourceTag/"], "Sdk": ["aws:ResourceTag/"], "Stage": ["aws:ResourceTag/"], "Stages": ["aws:ResourceTag/"], "Template": ["aws:ResourceTag/"], "UsagePlan": ["aws:ResourceTag/"], "UsagePlanKey": ["aws:ResourceTag/"], "UsagePlanKeys": ["aws:ResourceTag/"], "UsagePlans": ["aws:ResourceTag/"], "VpcLink": ["aws:ResourceTag/"], "VpcLinks": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "aps": {"anomalydetector": ["aws:ResourceTag/"], "cluster": ["aws:ResourceTag/"], "rulegroupsnamespace": ["aws:ResourceTag/"], "scraper": ["aws:ResourceTag/"], "workspace": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-estimate": ["aws:ResourceTag/"], "bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "bedrock": {"advanced-prompt-optimization-job": ["aws:ResourceTag/"], "agent": ["aws:ResourceTag/"], "agent-alias": ["aws:ResourceTag/"], "application-inference-profile": ["aws:ResourceTag/"], "async-invoke": ["aws:ResourceTag/"], "automated-reasoning-policy": ["aws:ResourceTag/"], "automated-reasoning-policy-version": ["aws:ResourceTag/"], "blueprint": ["aws:ResourceTag/"], "blueprint-optimization-invocation": ["aws:ResourceTag/"], "custom-model": ["aws:ResourceTag/"], "custom-model-deployment": ["aws:ResourceTag/"], "data-automation-invocation-job": ["aws:ResourceTag/"], "data-automation-library": ["aws:ResourceTag/"], "data-automation-library-ingestion-job": ["aws:ResourceTag/"], "data-automation-project": ["aws:ResourceTag/"], "evaluation-job": ["aws:ResourceTag/"], "flow": ["aws:ResourceTag/"], "flow-alias": ["aws:ResourceTag/"], "guardrail": ["aws:ResourceTag/"], "imported-model": ["aws:ResourceTag/"], "knowledge-base": ["aws:ResourceTag/"], "model-copy-job": ["aws:ResourceTag/"], "model-customization-job": ["aws:ResourceTag/"], "model-evaluation-job": ["aws:ResourceTag/"], "model-import-job": ["aws:ResourceTag/"], "model-invocation-job": ["aws:ResourceTag/"], "project": ["aws:ResourceTag/"], "prompt": ["aws:ResourceTag/"], "prompt-router": ["aws:ResourceTag/"], "prompt-version": ["aws:ResourceTag/"], "provisioned-model": ["aws:ResourceTag/"], "retrieval-instruction": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/Line truncated
|
||||||
"resourceKeys": {"ec2": {"capacity-reservation": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:CapacityReservationFleet": {"member": "CapacityReservationFleetId", "arn": "capacity-reservation-fleet"}, "ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:EndDateType": {"member": "EndDateType"}, "ec2:EphemeralStorage": {"member": "EphemeralStorage"}, "ec2:InstanceMatchCriteria": {"member": "InstanceMatchCriteria"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:Tenancy": {"member": "Tenancy"}}, "carrier-gateway": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "dhcp-options": {"ec2:DhcpOptionsID": {"member": "DhcpOptionsId"}}, "fpga-image": {"ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}}, "image": {"ec2:ImageID": {"member": "ImageId"}, "ec2:ImageType": {"member": "ImageType"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "instance": {"ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:InstanceID": {"member": "InstanceId"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "internet-gateway": {"ec2:InternetGatewayID": {"member": "InternetGatewayId"}}, "launch-template": {"ec2:LaunchTemplate": {"member": "LaunchTemplateId", "arn": "launch-template"}}, "network-acl": {"ec2:NetworkAclID": {"member": "NetworkAclId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "network-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:NetworkInterfaceID": {"member": "NetworkInterfaceId"}, "ec2:Subnet": {"member": "SubnetId", "arn": "subnet"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "reserved-instances": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:InstanceType": {"member": "InstanceType"}}, "route-table": {"ec2:RouteTableID": {"member": "RouteTableId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "secondary-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}}, "security-group": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "snapshot": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:SnapshotID": {"member": "SnapshotId"}, "ec2:VolumeSize": {"member": "VolumeSize"}}, "subnet": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:SubnetID": {"member": "SubnetId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "transit-gateway": {"ec2:transitGatewayId": {"member": "TransitGatewayId"}}, "transit-gateway-attachment": {"ec2:transitGatewayAttachmentId": {"member": "TransitGatewayAttachmentId"}}, "transit-gateway-connect-peer": {"ec2:transitGatewayConnectPeerId": {"member": "TransitGatewayConnectPeerId"}}, "transit-gateway-metering-policy": {"ec2:transitGatewayMeteringPolicyId": {"member": "TransitGatewayMeteringPolicyId"}}, "transit-gateway-multicast-domain": {"ec2:transitGatewayMulticastDomainId": {"member": "TransitGatewayMulticastDomainId"}}, "transit-gateway-policy-table": {"ec2:transitGatewayPolicyTableId": {"member": "TransitGatewayPolicyTableId"}}, "transit-gateway-route-table": {"ec2:transitGatewayRouteTableId": {"member": "TransitGatewayRouteTableId"}}, "transit-gateway-route-table-announcement": {"ec2:transitGatewayRouteTableAnnouncementId": {"member": "TransitGatewayRouteTableAnnouncementId"}}, "volume": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:KmsKeyId": {"member": "KmsKeyId"}, "ec2:VolumeID": {"member": "VolumeId"}, "ec2:VolumeInitializationRate": {"member": "VolumeInitializationRate"}, "ec2:VolumeType": {"member": "VolumeType"}}, "vpc": {"ec2:VpcID": {"member": "VpcId"}}, "vpc-peering-connection": {"ec2:VpcPeeringConnectionID": {"member": "VpcPeeringConnectionId"}}}},
|
"resourceKeys": {"ec2": {"capacity-reservation": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:CapacityReservationFleet": {"member": "CapacityReservationFleetId", "arn": "capacity-reservation-fleet"}, "ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:EndDateType": {"member": "EndDateType"}, "ec2:EphemeralStorage": {"member": "EphemeralStorage"}, "ec2:InstanceMatchCriteria": {"member": "InstanceMatchCriteria"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:Tenancy": {"member": "Tenancy"}}, "carrier-gateway": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "dhcp-options": {"ec2:DhcpOptionsID": {"member": "DhcpOptionsId"}}, "fpga-image": {"ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}}, "image": {"ec2:ImageID": {"member": "ImageId"}, "ec2:ImageType": {"member": "ImageType"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "instance": {"ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:InstanceID": {"member": "InstanceId"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "internet-gateway": {"ec2:InternetGatewayID": {"member": "InternetGatewayId"}}, "launch-template": {"ec2:LaunchTemplate": {"member": "LaunchTemplateId", "arn": "launch-template"}}, "network-acl": {"ec2:NetworkAclID": {"member": "NetworkAclId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "network-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:NetworkInterfaceID": {"member": "NetworkInterfaceId"}, "ec2:Subnet": {"member": "SubnetId", "arn": "subnet"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "reserved-instances": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:InstanceType": {"member": "InstanceType"}}, "route-table": {"ec2:RouteTableID": {"member": "RouteTableId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "secondary-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}}, "security-group": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "snapshot": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:SnapshotID": {"member": "SnapshotId"}, "ec2:VolumeSize": {"member": "VolumeSize"}}, "subnet": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:SubnetID": {"member": "SubnetId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "transit-gateway": {"ec2:transitGatewayId": {"member": "TransitGatewayId"}}, "transit-gateway-attachment": {"ec2:transitGatewayAttachmentId": {"member": "TransitGatewayAttachmentId"}}, "transit-gateway-connect-peer": {"ec2:transitGatewayConnectPeerId": {"member": "TransitGatewayConnectPeerId"}}, "transit-gateway-metering-policy": {"ec2:transitGatewayMeteringPolicyId": {"member": "TransitGatewayMeteringPolicyId"}}, "transit-gateway-multicast-domain": {"ec2:transitGatewayMulticastDomainId": {"member": "TransitGatewayMulticastDomainId"}}, "transit-gateway-policy-table": {"ec2:transitGatewayPolicyTableId": {"member": "TransitGatewayPolicyTableId"}}, "transit-gateway-route-table": {"ec2:transitGatewayRouteTableId": {"member": "TransitGatewayRouteTableId"}}, "transit-gateway-route-table-announcement": {"ec2:transitGatewayRouteTableAnnouncementId": {"member": "TransitGatewayRouteTableAnnouncementId"}}, "volume": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:KmsKeyId": {"member": "KmsKeyId"}, "ec2:VolumeID": {"member": "VolumeId"}, "ec2:VolumeInitializationRate": {"member": "VolumeInitializationRate"}, "ec2:VolumeType": {"member": "VolumeType"}}, "vpc": {"ec2:VpcID": {"member": "VpcId"}}, "vpc-peering-connection": {"ec2:VpcPeeringConnectionID": {"member": "VpcPeeringConnectionId"}}}},
|
||||||
@@ -4256,6 +4256,28 @@
|
|||||||
"iam:UploadSSHPublicKey": {"action": "iam:UploadSSHPublicKey", "types": ["user"], "resources": [{"type": "user", "fill": {"UserNameWithPath": "UserName"}}]},
|
"iam:UploadSSHPublicKey": {"action": "iam:UploadSSHPublicKey", "types": ["user"], "resources": [{"type": "user", "fill": {"UserNameWithPath": "UserName"}}]},
|
||||||
"iam:UploadServerCertificate": {"action": "iam:UploadServerCertificate", "types": ["server-certificate"], "resources": [{"type": "server-certificate", "fill": {"CertificateNameWithPath": "ServerCertificateName"}, "path": "Path"}]},
|
"iam:UploadServerCertificate": {"action": "iam:UploadServerCertificate", "types": ["server-certificate"], "resources": [{"type": "server-certificate", "fill": {"CertificateNameWithPath": "ServerCertificateName"}, "path": "Path"}]},
|
||||||
"iam:UploadSigningCertificate": {"action": "iam:UploadSigningCertificate", "types": ["user"], "resources": [{"type": "user", "fill": {"UserNameWithPath": "UserName"}}, {"types": ["user"], "signer": true, "when": {"UserName": [null]}}]},
|
"iam:UploadSigningCertificate": {"action": "iam:UploadSigningCertificate", "types": ["user"], "resources": [{"type": "user", "fill": {"UserNameWithPath": "UserName"}}, {"types": ["user"], "signer": true, "when": {"UserName": [null]}}]},
|
||||||
|
"identitystore:CreateGroup": {"action": "identitystore:CreateGroup", "types": ["Identitystore"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:CreateGroupMembership": {"action": "identitystore:CreateGroupMembership", "types": ["Group", "Identitystore", "User"], "resources": [{"type": "Group", "fill": {"GroupId": "GroupId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "MemberId.UserId"}}]},
|
||||||
|
"identitystore:CreateUser": {"action": "identitystore:CreateUser", "types": ["Identitystore"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:DeleteGroup": {"action": "identitystore:DeleteGroup", "types": ["Group", "Identitystore"], "resources": [{"type": "Group", "fill": {"GroupId": "GroupId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:DeleteGroupMembership": {"action": "identitystore:DeleteGroupMembership", "types": ["Group", "GroupMembership", "Identitystore", "User"], "resources": [{"type": "GroupMembership", "fill": {"MembershipId": "MembershipId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"types": ["Group", "User"], "through": "MembershipId"}]},
|
||||||
|
"identitystore:DeleteUser": {"action": "identitystore:DeleteUser", "types": ["Identitystore", "User"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "UserId"}}]},
|
||||||
|
"identitystore:DescribeGroup": {"action": "identitystore:DescribeGroup", "types": ["Group", "Identitystore"], "resources": [{"type": "Group", "fill": {"GroupId": "GroupId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:DescribeGroupMembership": {"action": "identitystore:DescribeGroupMembership", "types": ["Group", "GroupMembership", "Identitystore", "User"], "resources": [{"type": "GroupMembership", "fill": {"MembershipId": "MembershipId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"types": ["Group", "User"], "through": "MembershipId"}]},
|
||||||
|
"identitystore:DescribeIdentityStore": {"action": "identitystore:DescribeIdentityStore", "types": ["Identitystore"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:DescribeUser": {"action": "identitystore:DescribeUser", "types": ["Identitystore", "User"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "UserId"}}]},
|
||||||
|
"identitystore:GetGroupId": {"action": "identitystore:GetGroupId", "types": ["Group", "Identitystore"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "Group", "fill": {}, "find": ["IdentityStoreId", "AlternateIdentifier.ExternalId.Issuer", "AlternateIdentifier.ExternalId.Id"]}, {"type": "Group", "fill": {}, "find": ["IdentityStoreId", "AlternateIdentifier.UniqueAttribute.AttributePath", "AlternateIdentifier.UniqueAttribute.AttributeValue"]}]},
|
||||||
|
"identitystore:GetGroupMembershipId": {"action": "identitystore:GetGroupMembershipId", "types": ["Group", "GroupMembership", "Identitystore", "User"], "resources": [{"type": "Group", "fill": {"GroupId": "GroupId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "MemberId.UserId"}}, {"type": "GroupMembership", "fill": {}, "find": ["IdentityStoreId", "GroupId", "MemberId.UserId"]}]},
|
||||||
|
"identitystore:GetUserId": {"action": "identitystore:GetUserId", "types": ["Identitystore", "User"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {}, "find": ["IdentityStoreId", "AlternateIdentifier.ExternalId.Issuer", "AlternateIdentifier.ExternalId.Id"]}, {"type": "User", "fill": {}, "find": ["IdentityStoreId", "AlternateIdentifier.UniqueAttribute.AttributePath", "AlternateIdentifier.UniqueAttribute.AttributeValue"]}]},
|
||||||
|
"identitystore:IsMemberInGroups": {"action": "identitystore:IsMemberInGroups", "types": ["AllGroupMemberships", "Group", "Identitystore", "User"], "resources": [{"type": "AllGroupMemberships", "fill": {}}, {"type": "Group", "fill": {"GroupId": "GroupIds[]"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "MemberId.UserId"}}]},
|
||||||
|
"identitystore:ListGroupMemberships": {"action": "identitystore:ListGroupMemberships", "types": ["AllGroupMemberships", "Group", "Identitystore"], "resources": [{"type": "AllGroupMemberships", "fill": {}}, {"type": "Group", "fill": {"GroupId": "GroupId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:ListGroupMembershipsForMember": {"action": "identitystore:ListGroupMembershipsForMember", "types": ["AllGroupMemberships", "Identitystore", "User"], "resources": [{"type": "AllGroupMemberships", "fill": {}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "MemberId.UserId"}}]},
|
||||||
|
"identitystore:ListGroups": {"action": "identitystore:ListGroups", "types": ["AllGroups", "Identitystore"], "resources": [{"type": "AllGroups", "fill": {}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:ListIdentityStores": {"action": "identitystore:ListIdentityStores", "types": [], "resources": []},
|
||||||
|
"identitystore:ListUsers": {"action": "identitystore:ListUsers", "types": ["AllUsers", "Identitystore"], "resources": [{"type": "AllUsers", "fill": {}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:UpdateGroup": {"action": "identitystore:UpdateGroup", "types": ["Group", "Identitystore"], "resources": [{"type": "Group", "fill": {"GroupId": "GroupId"}}, {"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:UpdateIdentityStore": {"action": "identitystore:UpdateIdentityStore", "types": ["Identitystore"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}]},
|
||||||
|
"identitystore:UpdateUser": {"action": "identitystore:UpdateUser", "types": ["Identitystore", "User"], "resources": [{"type": "Identitystore", "fill": {"IdentityStoreId": "IdentityStoreId"}, "arnOf": {"IdentityStoreId": "Identitystore"}}, {"type": "User", "fill": {"UserId": "UserId"}}]},
|
||||||
"inspector2:AssociateMember": {"action": "inspector2:AssociateMember", "types": [], "resources": []},
|
"inspector2:AssociateMember": {"action": "inspector2:AssociateMember", "types": [], "resources": []},
|
||||||
"inspector2:BatchAssociateCodeSecurityScanConfiguration": {"action": "inspector2:BatchAssociateCodeSecurityScanConfiguration", "types": [], "resources": []},
|
"inspector2:BatchAssociateCodeSecurityScanConfiguration": {"action": "inspector2:BatchAssociateCodeSecurityScanConfiguration", "types": [], "resources": []},
|
||||||
"inspector2:BatchDisassociateCodeSecurityScanConfiguration": {"action": "inspector2:BatchDisassociateCodeSecurityScanConfiguration", "types": [], "resources": []},
|
"inspector2:BatchDisassociateCodeSecurityScanConfiguration": {"action": "inspector2:BatchDisassociateCodeSecurityScanConfiguration", "types": [], "resources": []},
|
||||||
|
|||||||
@@ -795,7 +795,11 @@ class RequestResourceMembersTest {
|
|||||||
.noneMatch(unless -> unless.getValue().contains(values.getOrDefault(unless.getKey(), "")));
|
.noneMatch(unless -> unless.getValue().contains(values.getOrDefault(unless.getKey(), "")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The value at the member's path in a body: in its list's first element, and in its field's structure. */
|
/**
|
||||||
|
* The value at the member's path in a body: in its list's first element, and in its field's structure, which the
|
||||||
|
* other fields the request gives of it share ({@code AlternateIdentifier.ExternalId}'s {@code Issuer} and
|
||||||
|
* {@code Id}).
|
||||||
|
*/
|
||||||
private static void put(ObjectNode body, Member member, String value) {
|
private static void put(ObjectNode body, Member member, String value) {
|
||||||
if (member.field() == null) {
|
if (member.field() == null) {
|
||||||
if (member.map()) {
|
if (member.map()) {
|
||||||
@@ -807,8 +811,11 @@ class RequestResourceMembersTest {
|
|||||||
}
|
}
|
||||||
} else if (member.map()) {
|
} else if (member.map()) {
|
||||||
put(body.putObject(member.name()).putObject("table"), member.field(), value);
|
put(body.putObject(member.name()).putObject("table"), member.field(), value);
|
||||||
|
} else if (member.list()) {
|
||||||
|
put(body.putArray(member.name()).addObject(), member.field(), value);
|
||||||
} else {
|
} else {
|
||||||
put(member.list() ? body.putArray(member.name()).addObject() : body.putObject(member.name()), member.field(), value);
|
put(body.get(member.name()) instanceof ObjectNode shared ? shared : body.putObject(member.name()),
|
||||||
|
member.field(), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
@@ -55,6 +56,8 @@ class RequestResourcesTest {
|
|||||||
void detachFindsBothAttachmentEndpointsAndKeepsTypedMissingFallbacks() {
|
void detachFindsBothAttachmentEndpointsAndKeepsTypedMissingFallbacks() {
|
||||||
String prefix = "arn:aws:ec2:us-east-1:000000000000:";
|
String prefix = "arn:aws:ec2:us-east-1:000000000000:";
|
||||||
StoredResourceArns stored = mock(StoredResourceArns.class);
|
StoredResourceArns stored = mock(StoredResourceArns.class);
|
||||||
|
// The reader asks with the members' paths too, which a service finding by the values alone leaves to them.
|
||||||
|
when(stored.findByMembers(any(), any(), any(), any())).thenCallRealMethod();
|
||||||
when(stored.findByMembers("instance", List.of("eni-attach-one"), "us-east-1"))
|
when(stored.findByMembers("instance", List.of("eni-attach-one"), "us-east-1"))
|
||||||
.thenReturn(Optional.of(prefix + "instance/i-one"));
|
.thenReturn(Optional.of(prefix + "instance/i-one"));
|
||||||
when(stored.findByMembers("network-interface", List.of("eni-attach-one"), "us-east-1"))
|
when(stored.findByMembers("network-interface", List.of("eni-attach-one"), "us-east-1"))
|
||||||
|
|||||||
+116
@@ -3495,6 +3495,118 @@ class IamRequestResourceEnforcementIntegrationTest {
|
|||||||
.formParam("Description", "res").post("/").then();
|
.formParam("Description", "res").post("/").then();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An Identity Store user is checked on the identity store and on the user its id names, so a grant on both lets the
|
||||||
|
* caller read that user and not another.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void anIdentityStoreUserIsCheckedOnItsStoreAndItself() {
|
||||||
|
String store = "d-1234567890";
|
||||||
|
String allowed = identityStoreUser(store);
|
||||||
|
String other = identityStoreUser(store);
|
||||||
|
User user = user("res-identitystore");
|
||||||
|
user.policy(allowOn("identitystore:DescribeUser", "arn:aws:identitystore::" + ACCOUNT + ":identitystore/" + store)
|
||||||
|
+ "," + allowOn("identitystore:DescribeUser", "arn:aws:identitystore:::user/" + allowed));
|
||||||
|
send(user, "identitystore", "AWSIdentityStore.DescribeUser", "1.1",
|
||||||
|
"{\"IdentityStoreId\":\"" + store + "\",\"UserId\":\"" + allowed + "\"}").statusCode(200);
|
||||||
|
refusedJson(send(user, "identitystore", "AWSIdentityStore.DescribeUser", "1.1",
|
||||||
|
"{\"IdentityStoreId\":\"" + store + "\",\"UserId\":\"" + other + "\"}"),
|
||||||
|
"identitystore:DescribeUser");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An Identity Store membership is checked on its group and its user too, which the Service Authorization Reference
|
||||||
|
* requires its actions on and its record holds, so a deny on one group refuses reading a membership of it and not
|
||||||
|
* one of another group.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void anIdentityStoreMembershipIsCheckedOnItsGroupAndItsUser() {
|
||||||
|
String store = "d-1234567890";
|
||||||
|
String member = identityStoreUser(store);
|
||||||
|
String denied = identityStoreGroup(store, "res-denied-" + suffix());
|
||||||
|
String inDenied = identityStoreMembership(store, denied, member);
|
||||||
|
String inOther = identityStoreMembership(store, identityStoreGroup(store, "res-other-" + suffix()), member);
|
||||||
|
User user = user("res-identitystore-membership");
|
||||||
|
user.policy(allowOn("identitystore:DescribeGroupMembership", "*") + ","
|
||||||
|
+ denyOn("identitystore:DescribeGroupMembership", "arn:aws:identitystore:::group/" + denied));
|
||||||
|
refusedJson(send(user, "identitystore", "AWSIdentityStore.DescribeGroupMembership", "1.1",
|
||||||
|
"{\"IdentityStoreId\":\"" + store + "\",\"MembershipId\":\"" + inDenied + "\"}"),
|
||||||
|
"identitystore:DescribeGroupMembership");
|
||||||
|
send(user, "identitystore", "AWSIdentityStore.DescribeGroupMembership", "1.1",
|
||||||
|
"{\"IdentityStoreId\":\"" + store + "\",\"MembershipId\":\"" + inOther + "\"}").statusCode(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An Identity Store lookup is checked on what it finds, which the Service Authorization Reference requires it on:
|
||||||
|
* {@code GetUserId} on the user its alternate identifier names, {@code GetGroupMembershipId} on the membership of
|
||||||
|
* its group and member, so a deny on one refuses that lookup and not another's.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void anIdentityStoreLookupIsCheckedOnWhatItFinds() {
|
||||||
|
String store = "d-1234567890";
|
||||||
|
String deniedName = "res-denied-" + suffix();
|
||||||
|
String denied = identityStoreUser(store, deniedName);
|
||||||
|
String otherName = "res-other-" + suffix();
|
||||||
|
String other = identityStoreUser(store, otherName);
|
||||||
|
String group = identityStoreGroup(store, "res-group-" + suffix());
|
||||||
|
String deniedMembership = identityStoreMembership(store, group, denied);
|
||||||
|
identityStoreMembership(store, group, other);
|
||||||
|
User user = user("res-identitystore-lookup");
|
||||||
|
String membershipArn = "arn:aws:identitystore:::membership/" + deniedMembership;
|
||||||
|
user.policy(allowOn("identitystore:GetUserId", "*") + "," + allowOn("identitystore:GetGroupMembershipId", "*")
|
||||||
|
+ "," + denyOn("identitystore:GetUserId", "arn:aws:identitystore:::user/" + denied) + ","
|
||||||
|
+ denyOn("identitystore:GetGroupMembershipId", membershipArn));
|
||||||
|
refusedJson(getUserId(user, store, deniedName), "identitystore:GetUserId");
|
||||||
|
getUserId(user, store, otherName).statusCode(200).body("UserId", equalTo(other));
|
||||||
|
refusedJson(getGroupMembershipId(user, store, group, denied), "identitystore:GetGroupMembershipId");
|
||||||
|
getGroupMembershipId(user, store, group, other).statusCode(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ValidatableResponse getUserId(User user, String store, String userName) {
|
||||||
|
return send(user, "identitystore", "AWSIdentityStore.GetUserId", "1.1", "{\"IdentityStoreId\":\"" + store
|
||||||
|
+ "\",\"AlternateIdentifier\":{\"UniqueAttribute\":{\"AttributePath\":\"userName\","
|
||||||
|
+ "\"AttributeValue\":\"" + userName + "\"}}}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ValidatableResponse getGroupMembershipId(User user, String store, String group, String member) {
|
||||||
|
return send(user, "identitystore", "AWSIdentityStore.GetGroupMembershipId", "1.1", "{\"IdentityStoreId\":\""
|
||||||
|
+ store + "\",\"GroupId\":\"" + group + "\",\"MemberId\":{\"UserId\":\"" + member + "\"}}");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A group of the identity store, created as the admin and deleted after the test; its id. */
|
||||||
|
private String identityStoreGroup(String store, String displayName) {
|
||||||
|
String groupId = adminJson("identitystore", "AWSIdentityStore.CreateGroup")
|
||||||
|
.body("{\"IdentityStoreId\":\"" + store + "\",\"DisplayName\":\"" + displayName + "\"}")
|
||||||
|
.post("/").then().statusCode(200).extract().path("GroupId");
|
||||||
|
cleanup.register(() -> adminJson("identitystore", "AWSIdentityStore.DeleteGroup")
|
||||||
|
.body("{\"IdentityStoreId\":\"" + store + "\",\"GroupId\":\"" + groupId + "\"}").post("/"));
|
||||||
|
return groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The membership of a user in a group of the identity store, created as the admin; its id. */
|
||||||
|
private String identityStoreMembership(String store, String group, String member) {
|
||||||
|
return adminJson("identitystore", "AWSIdentityStore.CreateGroupMembership")
|
||||||
|
.body("{\"IdentityStoreId\":\"" + store + "\",\"GroupId\":\"" + group + "\",\"MemberId\":{"
|
||||||
|
+ "\"UserId\":\"" + member + "\"}}")
|
||||||
|
.post("/").then().statusCode(200).extract().path("MembershipId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A user of the identity store, created as the admin and deleted after the test; its id. */
|
||||||
|
private String identityStoreUser(String store) {
|
||||||
|
return identityStoreUser(store, "res-" + suffix());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A user of the identity store of that name, created as the admin and deleted after the test; its id. */
|
||||||
|
private String identityStoreUser(String store, String userName) {
|
||||||
|
String userId = adminJson("identitystore", "AWSIdentityStore.CreateUser")
|
||||||
|
.body("{\"IdentityStoreId\":\"" + store + "\",\"UserName\":\"" + userName + "\","
|
||||||
|
+ "\"DisplayName\":\"Res\"}")
|
||||||
|
.post("/").then().statusCode(200).extract().path("UserId");
|
||||||
|
cleanup.register(() -> adminJson("identitystore", "AWSIdentityStore.DeleteUser")
|
||||||
|
.body("{\"IdentityStoreId\":\"" + store + "\",\"UserId\":\"" + userId + "\"}").post("/"));
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
private static ValidatableResponse glue(String operation, String body) {
|
private static ValidatableResponse glue(String operation, String body) {
|
||||||
return adminJson("glue", "AWSGlue." + operation).body(body).post("/").then();
|
return adminJson("glue", "AWSGlue." + operation).body(body).post("/").then();
|
||||||
}
|
}
|
||||||
@@ -3777,6 +3889,10 @@ class IamRequestResourceEnforcementIntegrationTest {
|
|||||||
return "{\"Effect\":\"Allow\",\"Action\":\"" + action + "\",\"Resource\":\"" + resource + "\"}";
|
return "{\"Effect\":\"Allow\",\"Action\":\"" + action + "\",\"Resource\":\"" + resource + "\"}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String denyOn(String action, String resource) {
|
||||||
|
return "{\"Effect\":\"Deny\",\"Action\":\"" + action + "\",\"Resource\":\"" + resource + "\"}";
|
||||||
|
}
|
||||||
|
|
||||||
private User user(String name) {
|
private User user(String name) {
|
||||||
String userName = name + "-" + suffix();
|
String userName = name + "-" + suffix();
|
||||||
return new User(userName, EnforcementFixtures.createUser(cleanup, baseUri.getPort(), auth(ADMIN, "iam"),
|
return new User(userName, EnforcementFixtures.createUser(cleanup, baseUri.getPort(), auth(ADMIN, "iam"),
|
||||||
|
|||||||
@@ -1977,6 +1977,72 @@ class ResourceArnBuilderTest {
|
|||||||
builder.buildResources("elasticache", "elasticache:ModifyUserGroup", ctx, "us-west-2", ACCOUNT, "aws"));
|
builder.buildResources("elasticache", "elasticache:ModifyUserGroup", ctx, "us-west-2", ACCOUNT, "aws"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Identity Store ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An Identity Store request is checked on the identity store its IdentityStoreId names and on the user or group its
|
||||||
|
* id names, whose ARN has no Region and no account; a list is checked on every user, as the Service Reference gives
|
||||||
|
* it.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void identityStoreChecksTheStoreAndTheUserARequestNames() {
|
||||||
|
setJsonBody("{\"IdentityStoreId\":\"d-1234567890\",\"UserId\":\"1234567890-u1\"}");
|
||||||
|
assertEquals(List.of("arn:aws:identitystore::000000000000:identitystore/d-1234567890",
|
||||||
|
"arn:aws:identitystore:::user/1234567890-u1"),
|
||||||
|
builder.buildResources("identitystore", "identitystore:DescribeUser", ctx, "us-east-1", ACCOUNT, "aws"));
|
||||||
|
setJsonBody("{\"IdentityStoreId\":\"d-1234567890\"}");
|
||||||
|
assertEquals(List.of("arn:aws:identitystore:::user/*",
|
||||||
|
"arn:aws:identitystore::000000000000:identitystore/d-1234567890"),
|
||||||
|
builder.buildResources("identitystore", "identitystore:ListUsers", ctx, "us-east-1", ACCOUNT, "aws"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A required type an Identity Store request does not name is asked of the service: a membership's group and user
|
||||||
|
* through its id, and a lookup's user by the members of the one way its alternate identifier is given, with their
|
||||||
|
* paths, as the table writes them.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
void identityStoreAsksTheServiceForTheRequiredTypesARequestDoesNotName() {
|
||||||
|
List<List<String>> asked = new ArrayList<>();
|
||||||
|
ResourceArnBuilder reading = reading(new StoredResourceArns() {
|
||||||
|
@Override
|
||||||
|
public String namespace() {
|
||||||
|
return "identitystore";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<String> find(String type, List<String> names, String region) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<String> findByMembers(String type, List<String> members, List<String> names,
|
||||||
|
String region) {
|
||||||
|
asked.add(members);
|
||||||
|
return Optional.of("arn:aws:identitystore:::user/" + names.getLast());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> through(String member, String value, String region) {
|
||||||
|
return List.of("arn:aws:identitystore:::group/g-of-" + value,
|
||||||
|
"arn:aws:identitystore:::user/u-of-" + value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setJsonBody("{\"IdentityStoreId\":\"d-1234567890\",\"MembershipId\":\"m1\"}");
|
||||||
|
assertEquals(List.of("arn:aws:identitystore:::membership/m1",
|
||||||
|
"arn:aws:identitystore::000000000000:identitystore/d-1234567890",
|
||||||
|
"arn:aws:identitystore:::group/g-of-m1", "arn:aws:identitystore:::user/u-of-m1"),
|
||||||
|
reading.buildResources("identitystore", "identitystore:DeleteGroupMembership", ctx, "us-east-1",
|
||||||
|
ACCOUNT, "aws"));
|
||||||
|
setJsonBody("{\"IdentityStoreId\":\"d-1234567890\",\"AlternateIdentifier\":{\"UniqueAttribute\":"
|
||||||
|
+ "{\"AttributePath\":\"userName\",\"AttributeValue\":\"alice\"}}}");
|
||||||
|
assertEquals(List.of("arn:aws:identitystore::000000000000:identitystore/d-1234567890",
|
||||||
|
"arn:aws:identitystore:::user/alice"),
|
||||||
|
reading.buildResources("identitystore", "identitystore:GetUserId", ctx, "us-east-1", ACCOUNT, "aws"));
|
||||||
|
assertEquals(List.of(List.of("IdentityStoreId", "AlternateIdentifier.UniqueAttribute.AttributePath",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributeValue")), asked);
|
||||||
|
}
|
||||||
|
|
||||||
// ── S3 and S3 Control ───────────────────────────────────────────────────────
|
// ── S3 and S3 Control ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
/** The resources an S3 or S3 Control request names, read from the generated table on the route it matches. */
|
/** The resources an S3 or S3 Control request names, read from the generated table on the route it matches. */
|
||||||
|
|||||||
+87
@@ -0,0 +1,87 @@
|
|||||||
|
package io.floci.aws.services.identitystore;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import io.floci.aws.core.common.RegionResolver;
|
||||||
|
import io.floci.aws.core.storage.AccountAwareStorageBackend;
|
||||||
|
import io.floci.aws.services.identitystore.model.Group;
|
||||||
|
import io.floci.aws.services.identitystore.model.Membership;
|
||||||
|
import io.floci.aws.services.identitystore.model.User;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identity Store answers IAM with the group and the user of a membership its id names, and with the group, user or
|
||||||
|
* membership a lookup's members find, as its handlers find them.
|
||||||
|
*/
|
||||||
|
class IdentityStoreStoredResourceArnsTest {
|
||||||
|
|
||||||
|
private static final String STORE = "d-1234567890";
|
||||||
|
private static final String GLOBAL_PARTITION = "000000000000";
|
||||||
|
private static final String REGION = "us-east-1";
|
||||||
|
|
||||||
|
private final ObjectMapper mapper = new ObjectMapper();
|
||||||
|
private IdentityStoreService service;
|
||||||
|
private IdentityStoreStoredResourceArns stored;
|
||||||
|
private Group group;
|
||||||
|
private User user;
|
||||||
|
private Membership membership;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
service = new IdentityStoreService(AccountAwareStorageBackend.inMemory(GLOBAL_PARTITION),
|
||||||
|
AccountAwareStorageBackend.inMemory(GLOBAL_PARTITION),
|
||||||
|
AccountAwareStorageBackend.inMemory(GLOBAL_PARTITION), mapper);
|
||||||
|
stored = new IdentityStoreStoredResourceArns(service, new RegionResolver(REGION, GLOBAL_PARTITION));
|
||||||
|
group = service.createGroup(mapper.createObjectNode().put("IdentityStoreId", STORE)
|
||||||
|
.put("DisplayName", "Admins"));
|
||||||
|
user = service.createUser(mapper.createObjectNode().put("IdentityStoreId", STORE).put("UserName", "alice")
|
||||||
|
.put("DisplayName", "Alice"));
|
||||||
|
ObjectNode request = mapper.createObjectNode().put("IdentityStoreId", STORE).put("GroupId", group.groupId());
|
||||||
|
request.putObject("MemberId").put("UserId", user.userId());
|
||||||
|
membership = service.createMembership(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void aMembershipReachesItsGroupAndItsUser() {
|
||||||
|
assertEquals(List.of("arn:aws:identitystore:::group/" + group.groupId(),
|
||||||
|
"arn:aws:identitystore:::user/" + user.userId()),
|
||||||
|
stored.through("MembershipId", membership.membershipId(), REGION));
|
||||||
|
assertEquals(List.of(), stored.through("MembershipId", "1234567890-missing", REGION));
|
||||||
|
assertEquals(List.of(), stored.through("GroupId", group.groupId(), REGION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void aLookupFindsWhatItsHandlerFinds() {
|
||||||
|
assertEquals(Optional.of("arn:aws:identitystore:::membership/" + membership.membershipId()),
|
||||||
|
stored.findByMembers("GroupMembership", List.of("IdentityStoreId", "GroupId", "MemberId.UserId"),
|
||||||
|
List.of(STORE, group.groupId(), user.userId()), REGION));
|
||||||
|
assertEquals(Optional.of("arn:aws:identitystore:::user/" + user.userId()),
|
||||||
|
stored.findByMembers("User", List.of("IdentityStoreId",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributePath",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributeValue"),
|
||||||
|
List.of(STORE, "userName", "alice"), REGION));
|
||||||
|
assertEquals(Optional.of("arn:aws:identitystore:::group/" + group.groupId()),
|
||||||
|
stored.findByMembers("Group", List.of("IdentityStoreId",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributePath",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributeValue"),
|
||||||
|
List.of(STORE, "displayName", "Admins"), REGION));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void aLookupFindingNothingFindsNone() {
|
||||||
|
assertEquals(Optional.empty(), stored.findByMembers("User", List.of("IdentityStoreId",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributePath",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributeValue"),
|
||||||
|
List.of(STORE, "userName", "nobody"), REGION));
|
||||||
|
assertEquals(Optional.empty(), stored.findByMembers("Group", List.of("IdentityStoreId",
|
||||||
|
"AlternateIdentifier.ExternalId.Issuer", "AlternateIdentifier.ExternalId.Id"),
|
||||||
|
List.of(STORE, "issuer", "none"), REGION));
|
||||||
|
assertEquals(Optional.empty(), stored.find("User", List.of("alice"), REGION));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -414,6 +414,8 @@ class TaskPermissionsTest {
|
|||||||
void aRedshiftDataCallOnAWorkgroupIsEvaluatedOnTheOneItsNameFinds() throws Exception {
|
void aRedshiftDataCallOnAWorkgroupIsEvaluatedOnTheOneItsNameFinds() throws Exception {
|
||||||
String workgroup = "arn:aws:redshift-serverless:eu-west-1:" + ACCOUNT + ":workgroup/1234";
|
String workgroup = "arn:aws:redshift-serverless:eu-west-1:" + ACCOUNT + ":workgroup/1234";
|
||||||
StoredResourceArns stored = mock(StoredResourceArns.class);
|
StoredResourceArns stored = mock(StoredResourceArns.class);
|
||||||
|
// The reader asks with the members' paths too, which a service finding by the values alone leaves to them.
|
||||||
|
when(stored.findByMembers(any(), any(), any(), any())).thenCallRealMethod();
|
||||||
when(stored.findByMembers(eq("workgroup"), eq(List.of("analytics")), eq("eu-west-1"))).thenReturn(Optional.of(workgroup));
|
when(stored.findByMembers(eq("workgroup"), eq(List.of("analytics")), eq("eu-west-1"))).thenReturn(Optional.of(workgroup));
|
||||||
assertEquals(List.of(new Permission("redshift-data:ExecuteStatement", workgroup),
|
assertEquals(List.of(new Permission("redshift-data:ExecuteStatement", workgroup),
|
||||||
new Permission("redshift-serverless:GetCredentials", workgroup)),
|
new Permission("redshift-serverless:GetCredentials", workgroup)),
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Vendor which resource types the Service Authorization Reference marks required for each action of the namespaces
|
||||||
|
granted it into tools/aws/sources/required-resource-types.json, a source of the IAM tables.
|
||||||
|
|
||||||
|
The Service Reference gives each action the resource types it acts on, but not which of them it always acts on;
|
||||||
|
botocore does not say it either. Each service's page of the Service Authorization Reference does, by an asterisk on
|
||||||
|
the type in its actions table, whose column is headed "Resource types (*required)":
|
||||||
|
|
||||||
|
DeleteGroupMembership Grants permission to remove a member that is part of a group in the specified
|
||||||
|
IdentityStore Group* GroupMembership* Identitystore* User*
|
||||||
|
|
||||||
|
https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentitystore.html
|
||||||
|
|
||||||
|
A required type the request does not name is one the service finds from what it holds: a membership's group and user,
|
||||||
|
the group an alternate identifier names. This script copies each action's resource type cells, asterisks and all, as
|
||||||
|
they stand, for the namespaces in PAGES. Nothing in the output is written by hand, and the generator reads it against
|
||||||
|
the Service Reference's types.
|
||||||
|
|
||||||
|
Run from anywhere in the repo:
|
||||||
|
python3 tools/aws/fetch_required_resource_types.py # rewrite the vendored file from the pages
|
||||||
|
python3 tools/aws/fetch_required_resource_types.py --verify # online: the file still says what the pages do
|
||||||
|
"""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import html
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import urllib.request
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
# The namespaces the source is granted for, each with its page of the Service Authorization Reference.
|
||||||
|
PAGES = {
|
||||||
|
"identitystore": "https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentitystore.html",
|
||||||
|
}
|
||||||
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
OUTPUT = REPO_ROOT / "tools/aws/sources/required-resource-types.json"
|
||||||
|
|
||||||
|
REQUIRED_HEADING = "Resource types (*required)"
|
||||||
|
TABLE_RE = re.compile(r"<table[^>]*>\s*<thead>(.*?)</thead>(.*?)</table>", re.S)
|
||||||
|
ROW_RE = re.compile(r"<tr>(.*?)</tr>", re.S)
|
||||||
|
ACTION_RE = re.compile(r'<span id="list_[a-z0-9]+-action-([A-Za-z0-9]+)"></span>')
|
||||||
|
RESOURCE_RE = re.compile(r'<a href="#list_[a-z0-9]+-resource-[^"]*">(.*?)</a>', re.S)
|
||||||
|
|
||||||
|
|
||||||
|
def text(fragment: str) -> str:
|
||||||
|
"""A fragment of the page as text, spaces collapsed."""
|
||||||
|
return re.sub(r"\s+", " ", html.unescape(re.sub(r"<[^>]+>", " ", fragment))).strip()
|
||||||
|
|
||||||
|
|
||||||
|
def read_actions(url: str, page: str) -> dict[str, list[str]]:
|
||||||
|
"""Each action of the page's actions table with its resource type cells, as they stand."""
|
||||||
|
for table in TABLE_RE.finditer(page):
|
||||||
|
headings = [text(heading) for heading in re.findall(r"<th[^>]*>(.*?)</th>", table.group(1), re.S)]
|
||||||
|
if REQUIRED_HEADING not in headings:
|
||||||
|
continue
|
||||||
|
actions: dict[str, list[str]] = {}
|
||||||
|
current = None
|
||||||
|
for row in ROW_RE.findall(table.group(2)):
|
||||||
|
started = ACTION_RE.search(row)
|
||||||
|
if started:
|
||||||
|
current = started.group(1)
|
||||||
|
actions[current] = []
|
||||||
|
if current is not None:
|
||||||
|
actions[current] += [text(resource) for resource in RESOURCE_RE.findall(row)]
|
||||||
|
if not actions:
|
||||||
|
raise ValueError(f"{url}'s actions table names no action: its layout changed")
|
||||||
|
return actions
|
||||||
|
raise ValueError(f"{url} gives no table headed '{REQUIRED_HEADING}': its layout changed")
|
||||||
|
|
||||||
|
|
||||||
|
def build(pages: dict[str, str]) -> dict:
|
||||||
|
return {
|
||||||
|
"_source": {
|
||||||
|
"pages": [PAGES[namespace] for namespace in sorted(pages)],
|
||||||
|
"fetcher": str(Path(__file__).resolve().relative_to(REPO_ROOT)),
|
||||||
|
"retrieved": datetime.now(timezone.utc).strftime("%Y-%m-%d"),
|
||||||
|
"note": "Each action of each page's actions table with its resource type cells, an asterisk marking a "
|
||||||
|
"required type, copied as they stand.",
|
||||||
|
},
|
||||||
|
"namespaces": {namespace: {"page": PAGES[namespace], "actions": read_actions(PAGES[namespace], page)}
|
||||||
|
for namespace, page in sorted(pages.items())},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def fetch_url(url: str) -> str:
|
||||||
|
request = urllib.request.Request(url, headers={"User-Agent": "floci-tools"})
|
||||||
|
with urllib.request.urlopen(request, timeout=60) as response:
|
||||||
|
return response.read().decode("utf-8")
|
||||||
|
|
||||||
|
|
||||||
|
def fetch_all(fetch=fetch_url) -> tuple[dict[str, str]]:
|
||||||
|
"""Each granted namespace's page."""
|
||||||
|
return ({namespace: fetch(url) for namespace, url in PAGES.items()},)
|
||||||
|
|
||||||
|
|
||||||
|
def stale(vendored: dict, pages: dict[str, str]) -> bool:
|
||||||
|
"""Whether the pages now give something other than the vendored file, its date aside."""
|
||||||
|
built = build(pages)
|
||||||
|
return any(vendored.get(key) != built[key] for key in built if key != "_source")
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv: list[str] | None = None, fetch=fetch_url) -> int:
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||||
|
parser.add_argument("--verify", action="store_true", help="online: the vendored file matches the pages")
|
||||||
|
args = parser.parse_args(argv)
|
||||||
|
try:
|
||||||
|
(pages,) = fetch_all(fetch)
|
||||||
|
except OSError as e:
|
||||||
|
print(f"error: could not read the Service Authorization Reference ({e})", file=sys.stderr)
|
||||||
|
return 2
|
||||||
|
if args.verify:
|
||||||
|
vendored = json.loads(OUTPUT.read_text(encoding="utf-8"))
|
||||||
|
if stale(vendored, pages):
|
||||||
|
print(f"error: {OUTPUT.relative_to(REPO_ROOT)} no longer says what {', '.join(PAGES.values())} do: run "
|
||||||
|
f"tools/aws/fetch_required_resource_types.py and then make iam-request-resources-sync",
|
||||||
|
file=sys.stderr)
|
||||||
|
return 1
|
||||||
|
print(f"{OUTPUT.relative_to(REPO_ROOT)} matches {', '.join(PAGES.values())}")
|
||||||
|
return 0
|
||||||
|
built = build(pages)
|
||||||
|
OUTPUT.write_text(json.dumps(built, indent=2) + "\n", encoding="utf-8")
|
||||||
|
actions = sum(len(entry["actions"]) for entry in built["namespaces"].values())
|
||||||
|
print(f"wrote {OUTPUT.relative_to(REPO_ROOT)} ({actions} actions over {len(built['namespaces'])} namespaces)")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
sys.exit(main())
|
||||||
@@ -252,6 +252,14 @@ which the reader asks the service that holds the signing key for; a member whose
|
|||||||
resource's ARN names the resource by it (`with_same_as_arn`: TagMFADevice's `SerialNumber`); and a type the format of a
|
resource's ARN names the resource by it (`with_same_as_arn`: TagMFADevice's `SerialNumber`); and a type the format of a
|
||||||
member's identifier names is named through that member (`with_formats`: GetServiceLinkedRoleDeletionStatus's
|
member's identifier names is named through that member (`with_formats`: GetServiceLinkedRoleDeletionStatus's
|
||||||
`DeletionTaskId`, the role the task deleted).
|
`DeletionTaskId`, the role the task deleted).
|
||||||
|
Which types an action always acts on, which neither botocore nor the Service Reference says, comes from one more
|
||||||
|
source, granted for Identity Store alone: its page of the Service Authorization Reference, whose actions table marks
|
||||||
|
each required type with an asterisk, which its own script vendors as it stands (`REQUIRED_TYPE_SOURCE`). A required
|
||||||
|
type no member names is named through the id of the resource the request names, whose botocore record holds it
|
||||||
|
(`with_record_through`: DeleteGroupMembership's group and user, through its `MembershipId`), or found by the members
|
||||||
|
of a lookup returning its id, each way the request may give them apart (`with_lookup_find`: GetUserId's user, by its
|
||||||
|
`IdentityStoreId` and its `AlternateIdentifier`'s `ExternalId` or `UniqueAttribute`), which the reader asks the
|
||||||
|
service for.
|
||||||
A qualified type the reference gives an action, one whose format is another type's and one more `:${...}` (Lambda's
|
A qualified type the reference gives an action, one whose format is another type's and one more `:${...}` (Lambda's
|
||||||
`function alias` and `function version`), which no member fills alone, is named by that type's member and the
|
`function alias` and `function version`), which no member fills alone, is named by that type's member and the
|
||||||
request's one member documented as naming the qualified types ("The version number or alias name"): Lambda's
|
request's one member documented as naming the qualified types ("The version number or alias name"): Lambda's
|
||||||
@@ -322,6 +330,7 @@ import fetch_athena_glue_ddl_permissions
|
|||||||
import fetch_dynamodb_permissions
|
import fetch_dynamodb_permissions
|
||||||
import fetch_iam_identifiers
|
import fetch_iam_identifiers
|
||||||
import fetch_kms_api_permissions
|
import fetch_kms_api_permissions
|
||||||
|
import fetch_required_resource_types
|
||||||
from regen_iam_authorized_actions import (ROUTES as ROUTES_FILE, authorized_actions, fetch_references,
|
from regen_iam_authorized_actions import (ROUTES as ROUTES_FILE, authorized_actions, fetch_references,
|
||||||
load_s3_required, s3_query_parameters, s3_version_choices,
|
load_s3_required, s3_query_parameters, s3_version_choices,
|
||||||
vendored_sections)
|
vendored_sections)
|
||||||
@@ -353,7 +362,7 @@ NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "a
|
|||||||
"servicequotas", "ssm", "sso", "states", "textract", "timestream-influxdb", "translate", "signer", "xray",
|
"servicequotas", "ssm", "sso", "states", "textract", "timestream-influxdb", "translate", "signer", "xray",
|
||||||
"securityhub", "guardduty", "secretsmanager", "scheduler", "lambda", "cloudformation", "glue",
|
"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", "cloudwatch",
|
||||||
"comprehend", "config", "dms", "elasticache",
|
"comprehend", "config", "dms", "elasticache", "identitystore",
|
||||||
"ec2-instance-connect", "s3", "bedrock", "apigateway", "kms", "dynamodb", "iam")
|
"ec2-instance-connect", "s3", "bedrock", "apigateway", "kms", "dynamodb", "iam")
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -479,8 +488,8 @@ MEASURED: dict[str, tuple[list[dict], str]] = {
|
|||||||
# STATEMENT_SOURCES: the statements an operation's request carries that its service runs against another service as
|
# STATEMENT_SOURCES: the statements an operation's request carries that its service runs against another service as
|
||||||
# the caller, and the vendored page each one's permissions come from.
|
# the caller, and the vendored page each one's permissions come from.
|
||||||
#
|
#
|
||||||
# This is one of the file's sources besides botocore and the Service Reference (`PATH_SOURCES` and
|
# This is one of the file's sources besides botocore and the Service Reference (`PATH_SOURCES`,
|
||||||
# `PERMISSION_SOURCES` are the others),
|
# `PERMISSION_SOURCES` and `REQUIRED_TYPE_SOURCE` are the others),
|
||||||
# granted for Athena's DDL statements alone: it is not a place for any other table. Its file is written by its own
|
# granted for Athena's DDL statements alone: it is not a place for any other table. Its file is written by its own
|
||||||
# script from AWS's documentation, unchanged
|
# script from AWS's documentation, unchanged
|
||||||
# (tools/aws/fetch_athena_glue_ddl_permissions.py, with a prompt beside the file for rebuilding it when the page's
|
# (tools/aws/fetch_athena_glue_ddl_permissions.py, with a prompt beside the file for rebuilding it when the page's
|
||||||
@@ -544,6 +553,19 @@ PERMISSION_FETCHERS = {
|
|||||||
"dynamodb": fetch_dynamodb_permissions,
|
"dynamodb": fetch_dynamodb_permissions,
|
||||||
"iam": fetch_iam_identifiers,
|
"iam": fetch_iam_identifiers,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------------------------------------------------
|
||||||
|
# REQUIRED_TYPE_SOURCE: which resource types each action of a granted namespace always acts on, as its page of the
|
||||||
|
# Service Authorization Reference marks them ("Resource types (*required)": DeleteGroupMembership's `Group*`,
|
||||||
|
# `GroupMembership*`, `Identitystore*` and `User*`), which neither botocore nor the Service Reference says.
|
||||||
|
#
|
||||||
|
# Granted for Identity Store alone (tools/aws/fetch_required_resource_types.py's `PAGES`). Its file is written by its
|
||||||
|
# own script from those pages, unchanged, and the generator only reads it (`required_types`): a required type no
|
||||||
|
# member names is one the service finds from what it holds, through the record of the resource the request names
|
||||||
|
# (`with_record_through`) or by the members a lookup names it by (`with_lookup_find`). Nothing about an action is
|
||||||
|
# stated here.
|
||||||
|
# ---------------------------------------------------------------------------------------------------------------------
|
||||||
|
REQUIRED_TYPE_SOURCE = fetch_required_resource_types.OUTPUT
|
||||||
# A resource a permissions row's list names, after the action it is checked as when it names one: "kms:ReEncryptFrom
|
# A resource a permissions row's list names, after the action it is checked as when it names one: "kms:ReEncryptFrom
|
||||||
# on the KMS key used to decrypt", "The alias (in an IAM policy)"; an action checked on no resource names none ("in an
|
# on the KMS key used to decrypt", "The alias (in an IAM policy)"; an action checked on no resource names none ("in an
|
||||||
# IAM policy in the replica Region").
|
# IAM policy in the replica Region").
|
||||||
@@ -604,7 +626,6 @@ NOT_COVERED: dict[str, str] = {
|
|||||||
"or EnvironmentId alone, so reading it needs the stored environment those find",
|
"or EnvironmentId alone, so reading it needs the stored environment those find",
|
||||||
"elasticfilesystem": _REST,
|
"elasticfilesystem": _REST,
|
||||||
"execute-api": _REST,
|
"execute-api": _REST,
|
||||||
"identitystore": _LATER,
|
|
||||||
"iot": _LATER,
|
"iot": _LATER,
|
||||||
"kafka": _REST,
|
"kafka": _REST,
|
||||||
"lightsail": _LATER,
|
"lightsail": _LATER,
|
||||||
@@ -1972,6 +1993,125 @@ def with_change_lists(resources: list[dict], types: list[str], formats: dict[str
|
|||||||
return resources + added
|
return resources + added
|
||||||
|
|
||||||
|
|
||||||
|
def record_reached(models: dict[str, dict], operation: str, types: list[str]) -> dict[str, dict[str, list[str]]]:
|
||||||
|
"""Each top-level member of the request holding the id of one type the action acts on, named after the type, that
|
||||||
|
the type's botocore record (a structure named after it) holds, with that type and the other types the action acts
|
||||||
|
on the record names beside it, by an id field named after the type, or one of a structure it holds: Identity
|
||||||
|
Store's `GroupMembership` holds its `MembershipId` beside the `GroupId` and the `MemberId.UserId` of the group and
|
||||||
|
the user it links."""
|
||||||
|
request = _request_shapes(models, operation)
|
||||||
|
found: dict[str, dict[str, set[str]]] = {}
|
||||||
|
for model in models.values():
|
||||||
|
shapes = model["shapes"]
|
||||||
|
for shape_name, shape in shapes.items():
|
||||||
|
owners = [kind for kind in types if stem(shape_name) == stem(kind)]
|
||||||
|
if shape.get("type") != "structure" or len(owners) != 1:
|
||||||
|
continue
|
||||||
|
fields = shape.get("members", {})
|
||||||
|
for member in request:
|
||||||
|
if member not in fields or kind_of(member) != "id" or not related(stem(member), stem(owners[0])) \
|
||||||
|
or shapes[fields[member]["shape"]].get("type") != "string":
|
||||||
|
continue
|
||||||
|
reached: set[str] = set()
|
||||||
|
for field, spec in fields.items():
|
||||||
|
held = shapes[spec["shape"]]
|
||||||
|
names = [field] if held.get("type") == "string" else [
|
||||||
|
inner for inner, inner_spec in held.get("members", {}).items()
|
||||||
|
if shapes[inner_spec["shape"]].get("type") == "string"] if held.get("type") == "structure" \
|
||||||
|
else []
|
||||||
|
reached |= {kind for name in names if name != member and kind_of(name) == "id"
|
||||||
|
for kind in types if kind != owners[0] and stem(name) == stem(kind)}
|
||||||
|
if reached:
|
||||||
|
found.setdefault(member, {}).setdefault(owners[0], set()).update(reached)
|
||||||
|
return {member: {owner: sorted(kinds) for owner, kinds in sorted(by_owner.items())}
|
||||||
|
for member, by_owner in sorted(found.items())}
|
||||||
|
|
||||||
|
|
||||||
|
def with_record_through(resources: list[dict], formats: dict[str, str], reached: dict[str, dict[str, list[str]]],
|
||||||
|
required: set[str]) -> list[dict]:
|
||||||
|
"""The resources and, for each member filling the one variable of a type whose record names other types the action
|
||||||
|
acts on (`record_reached`), those of them the action requires (`required_types`) that no resource names yet, named
|
||||||
|
through that member: the reader asks the service for the ARNs of the resources the caller's record of that id
|
||||||
|
names (the group and the user of the membership `DeleteGroupMembership`'s `MembershipId` names)."""
|
||||||
|
named = {kind for resource in resources for kind in _kinds(resource)}
|
||||||
|
added = []
|
||||||
|
for member, by_owner in reached.items():
|
||||||
|
for owner, kinds in by_owner.items():
|
||||||
|
variables = [v for v in VARIABLE_RE.findall(formats.get(owner, "")) if v not in KNOWN_VARIABLES]
|
||||||
|
filled = any(resource.get("type") == owner and resource.get("fill") == {variables[0]: member}
|
||||||
|
for resource in resources) if len(variables) == 1 else False
|
||||||
|
left = [kind for kind in kinds if kind in required and kind not in named and kind in formats]
|
||||||
|
if filled and left:
|
||||||
|
added.append({"types": left, "through": member})
|
||||||
|
named.update(left)
|
||||||
|
return resources + added
|
||||||
|
|
||||||
|
|
||||||
|
def _key_paths(shapes: dict, shape_name: str, prefix: str, depth: int = 0) -> list[list[str]] | None:
|
||||||
|
"""The string paths of a request member a lookup reads, one list for each way the request may give it: a string's
|
||||||
|
own path; each member of a union's apart, as the request gives one (Identity Store's `AlternateIdentifier`, an
|
||||||
|
`ExternalId` or a `UniqueAttribute`); every member of another structure together; a document as itself. None for a
|
||||||
|
list, a map or anything else."""
|
||||||
|
shape = shapes[shape_name]
|
||||||
|
if shape.get("type") == "string" or shape.get("document"):
|
||||||
|
return [[prefix]]
|
||||||
|
if shape.get("type") != "structure" or depth > 2:
|
||||||
|
return None
|
||||||
|
parts = []
|
||||||
|
for name, spec in shape.get("members", {}).items():
|
||||||
|
paths = _key_paths(shapes, spec["shape"], f"{prefix}.{name}", depth + 1)
|
||||||
|
if paths is None:
|
||||||
|
return None
|
||||||
|
parts.append(paths)
|
||||||
|
if shape.get("union"):
|
||||||
|
return [path for paths in parts for path in paths]
|
||||||
|
combined = [[]]
|
||||||
|
for paths in parts:
|
||||||
|
combined = [done + path for done in combined for path in paths]
|
||||||
|
return combined
|
||||||
|
|
||||||
|
|
||||||
|
def lookup_keys(models: dict[str, dict], operation: str) -> dict[str, list[list[str]]]:
|
||||||
|
"""Each top-level id member of the operation's response that its request does not hold, which the operation looks
|
||||||
|
up, with the paths of the request it is looked up by (`_key_paths`), one list for each way the request may give
|
||||||
|
them: Identity Store's `GetGroupId` returns the `GroupId` of the group its `IdentityStoreId` and
|
||||||
|
`AlternateIdentifier` name. None for a request holding a list or a map."""
|
||||||
|
found: dict[str, list[list[str]]] = {}
|
||||||
|
for model in models.values():
|
||||||
|
spec = model["operations"].get(operation)
|
||||||
|
if spec is None or "input" not in spec or "output" not in spec or _reading(model) != "all":
|
||||||
|
continue
|
||||||
|
shapes = model["shapes"]
|
||||||
|
request = shapes[spec["input"]["shape"]].get("members", {})
|
||||||
|
combined = [[]]
|
||||||
|
for name, member in request.items():
|
||||||
|
paths = _key_paths(shapes, member["shape"], name)
|
||||||
|
if paths is None:
|
||||||
|
return {}
|
||||||
|
combined = [done + path for done in combined for path in paths]
|
||||||
|
for name, member in shapes[spec["output"]["shape"]].get("members", {}).items():
|
||||||
|
if name not in request and kind_of(name) == "id" and shapes[member["shape"]].get("type") == "string" \
|
||||||
|
and combined != [[]]:
|
||||||
|
found.setdefault(name, combined)
|
||||||
|
return found
|
||||||
|
|
||||||
|
|
||||||
|
def with_lookup_find(resources: list[dict], types: list[str], formats: dict[str, str],
|
||||||
|
keys: dict[str, list[list[str]]], required: set[str]) -> list[dict]:
|
||||||
|
"""The resources and, for each type the action requires (`required_types`) that no resource names yet whose format
|
||||||
|
has one variable of its own the operation looks up (`lookup_keys`), that type found by the members the request
|
||||||
|
looks it up by, once for each way it may give them: `GetGroupMembershipId` finds the membership of its `GroupId`
|
||||||
|
and `MemberId.UserId` in its `IdentityStoreId`."""
|
||||||
|
named = {kind for resource in resources for kind in _kinds(resource)}
|
||||||
|
added = []
|
||||||
|
for kind in types:
|
||||||
|
variables = [v for v in VARIABLE_RE.findall(formats.get(kind, "")) if v not in KNOWN_VARIABLES]
|
||||||
|
if kind not in required or kind in named or len(variables) != 1 or variables[0] not in keys:
|
||||||
|
continue
|
||||||
|
added.extend({"type": kind, "fill": {}, "find": paths} for paths in keys[variables[0]])
|
||||||
|
return resources + added
|
||||||
|
|
||||||
|
|
||||||
def structure_name_fields(models: dict[str, dict], operation: str, types: list[str]) -> dict[str, str]:
|
def structure_name_fields(models: dict[str, dict], operation: str, types: list[str]) -> dict[str, str]:
|
||||||
"""By type, the `name` field of the operation's request's top-level structure member named after the type
|
"""By type, the `name` field of the operation's request's top-level structure member named after the type
|
||||||
(PutConfigurationRecorder's `ConfigurationRecorder.name`), the name the structure gives the resource; a type with
|
(PutConfigurationRecorder's `ConfigurationRecorder.name`), the name the structure gives the resource; a type with
|
||||||
@@ -2605,6 +2745,11 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: d
|
|||||||
resources = by_client(operation, models, lambda read: read_resources(operation, types, formats, read), formats)
|
resources = by_client(operation, models, lambda read: read_resources(operation, types, formats, read), formats)
|
||||||
resources = with_documented_creation(resources, operation, types, formats, models)
|
resources = with_documented_creation(resources, operation, types, formats, models)
|
||||||
resources = with_made(resources, operation, formats)
|
resources = with_made(resources, operation, formats)
|
||||||
|
required = required_types(upstream["action"], types)
|
||||||
|
if required:
|
||||||
|
name = operation.split(":", 1)[1]
|
||||||
|
resources = with_record_through(resources, formats, record_reached(models, name, types), required)
|
||||||
|
resources = with_lookup_find(resources, types, formats, lookup_keys(models, name), required)
|
||||||
source = load_permission_source(namespace_of(operation))
|
source = load_permission_source(namespace_of(operation))
|
||||||
known = {upstream["action"]: types, **(upstream.get("actions") or {})}
|
known = {upstream["action"]: types, **(upstream.get("actions") or {})}
|
||||||
if source is not None and "permissions" in source:
|
if source is not None and "permissions" in source:
|
||||||
@@ -3100,6 +3245,24 @@ def namespace_routed(operations: dict[str, dict], formats: dict[str, dict[str, s
|
|||||||
return resources, needed
|
return resources, needed
|
||||||
|
|
||||||
|
|
||||||
|
_REQUIRED_TYPES: dict | None = None
|
||||||
|
|
||||||
|
|
||||||
|
def required_types(action: str, types: list[str]) -> set[str]:
|
||||||
|
"""The resource types the vendored Service Authorization Reference (`REQUIRED_TYPE_SOURCE`) marks the action as
|
||||||
|
requiring, each one of `types`, the Service Reference's; empty for an action of a namespace it is not granted."""
|
||||||
|
global _REQUIRED_TYPES
|
||||||
|
if _REQUIRED_TYPES is None:
|
||||||
|
_REQUIRED_TYPES = json.loads(REQUIRED_TYPE_SOURCE.read_text(encoding="utf-8"))["namespaces"]
|
||||||
|
namespace, name = action.split(":", 1)
|
||||||
|
cells = _REQUIRED_TYPES.get(namespace, {}).get("actions", {}).get(name, [])
|
||||||
|
required = {cell.removesuffix("*") for cell in cells if cell.endswith("*")}
|
||||||
|
if required - set(types):
|
||||||
|
raise ValueError(f"{action}: the Service Authorization Reference requires {sorted(required - set(types))}, "
|
||||||
|
f"which the Service Reference does not give it")
|
||||||
|
return required
|
||||||
|
|
||||||
|
|
||||||
def load_permission_source(namespace: str) -> dict | None:
|
def load_permission_source(namespace: str) -> dict | None:
|
||||||
"""The namespace's vendored permission source (`PERMISSION_SOURCES`), or None for a namespace it is not granted."""
|
"""The namespace's vendored permission source (`PERMISSION_SOURCES`), or None for a namespace it is not granted."""
|
||||||
path = PERMISSION_SOURCES.get(namespace)
|
path = PERMISSION_SOURCES.get(namespace)
|
||||||
@@ -4555,6 +4718,9 @@ def render(document: dict) -> str:
|
|||||||
# Gates
|
# Gates
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[])?$")
|
PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[])?$")
|
||||||
|
# A member a service finds a resource by: one list, or a value at any depth of structures
|
||||||
|
# (`AlternateIdentifier.ExternalId.Id`).
|
||||||
|
FIND_PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[]|(\.[A-Za-z][A-Za-z0-9_]*)*)$")
|
||||||
# A member of a request's body at any depth, as `body_only_identifiers` writes it: `Delete.Objects[].Key`.
|
# A member of a request's body at any depth, as `body_only_identifiers` writes it: `Delete.Objects[].Key`.
|
||||||
BODY_PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[])?(\.[A-Za-z][A-Za-z0-9_]*(\[])?)*$")
|
BODY_PATH_RE = re.compile(r"^[A-Za-z][A-Za-z0-9_]*(\[])?(\.[A-Za-z][A-Za-z0-9_]*(\[])?)*$")
|
||||||
# A member filling a variable may also be a field of a structure, or of each element of a list of structures, one
|
# A member filling a variable may also be a field of a structure, or of each element of a list of structures, one
|
||||||
@@ -4834,8 +5000,8 @@ def _resource_problems(operation: str, resource: object, types: set[str], format
|
|||||||
fill = resource["fill"]
|
fill = resource["fill"]
|
||||||
find = resource.get("find", [])
|
find = resource.get("find", [])
|
||||||
if not isinstance(find, list) or ("find" in resource and (not find or fill or set(resource) & FOUND_ONLY)) \
|
if not isinstance(find, list) or ("find" in resource and (not find or fill or set(resource) & FOUND_ONLY)) \
|
||||||
or not all(isinstance(path, str) and PATH_RE.match(path) and (not path.endswith("[]") or len(find) == 1)
|
or not all(isinstance(path, str) and FIND_PATH_RE.match(path)
|
||||||
for path in find):
|
and (not path.endswith("[]") or len(find) == 1) for path in find):
|
||||||
return [f"{operation} finds {kinds[0]} by {find!r}, which are no members of one value each or one list, or "
|
return [f"{operation} finds {kinds[0]} by {find!r}, which are no members of one value each or one list, or "
|
||||||
f"beside a fill or members reading it otherwise"]
|
f"beside a fill or members reading it otherwise"]
|
||||||
variables = set(VARIABLE_RE.findall(formats[kinds[0]])) - KNOWN_VARIABLES
|
variables = set(VARIABLE_RE.findall(formats[kinds[0]])) - KNOWN_VARIABLES
|
||||||
@@ -5088,6 +5254,17 @@ def verify_permission_sources() -> list[str]:
|
|||||||
return untrue
|
return untrue
|
||||||
|
|
||||||
|
|
||||||
|
def verify_required_type_source() -> list[str]:
|
||||||
|
"""The vendored required types (`REQUIRED_TYPE_SOURCE`) when the pages they come from now say otherwise."""
|
||||||
|
source = json.loads(REQUIRED_TYPE_SOURCE.read_text(encoding="utf-8"))
|
||||||
|
try:
|
||||||
|
changed = fetch_required_resource_types.stale(source, *fetch_required_resource_types.fetch_all())
|
||||||
|
except (OSError, ValueError) as e:
|
||||||
|
raise OSError(f"could not read {' and '.join(source['_source']['pages'])} ({e})") from e
|
||||||
|
return [f"{' and '.join(source['_source']['pages'])} no longer give what {REQUIRED_TYPE_SOURCE.name} holds: run "
|
||||||
|
f"{source['_source']['fetcher']}"] if changed else []
|
||||||
|
|
||||||
|
|
||||||
def verify_permission_actions(vendored: dict, documents: list[dict]) -> list[str]:
|
def verify_permission_actions(vendored: dict, documents: list[dict]) -> list[str]:
|
||||||
"""An operation checked as several actions whose actions the Service Reference no longer gives those types."""
|
"""An operation checked as several actions whose actions the Service Reference no longer gives those types."""
|
||||||
actions = {f"{document['Name']}:{action['Name']}": [resource["Name"] for resource in action.get("Resources") or []]
|
actions = {f"{document['Name']}:{action['Name']}": [resource["Name"] for resource in action.get("Resources") or []]
|
||||||
@@ -5174,6 +5351,7 @@ def main(argv: list[str] | None = None) -> int:
|
|||||||
untrue += verify_statements(document, documents)
|
untrue += verify_statements(document, documents)
|
||||||
untrue += verify_path_sources()
|
untrue += verify_path_sources()
|
||||||
untrue += verify_permission_sources()
|
untrue += verify_permission_sources()
|
||||||
|
untrue += verify_required_type_source()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print(f"error: {e}", file=sys.stderr)
|
print(f"error: {e}", file=sys.stderr)
|
||||||
return 2
|
return 2
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
{
|
||||||
|
"_source": {
|
||||||
|
"pages": [
|
||||||
|
"https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentitystore.html"
|
||||||
|
],
|
||||||
|
"fetcher": "tools/aws/fetch_required_resource_types.py",
|
||||||
|
"retrieved": "2026-11-24",
|
||||||
|
"note": "Each action of each page's actions table with its resource type cells, an asterisk marking a required type, copied as they stand."
|
||||||
|
},
|
||||||
|
"namespaces": {
|
||||||
|
"identitystore": {
|
||||||
|
"page": "https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentitystore.html",
|
||||||
|
"actions": {
|
||||||
|
"AddRegion": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"CreateGroup": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"CreateGroupMembership": [
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"CreateIdentityStore": [],
|
||||||
|
"CreateUser": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"DeleteGroup": [
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"DeleteGroupMembership": [
|
||||||
|
"Group*",
|
||||||
|
"GroupMembership*",
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"DeleteIdentityStore": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"DeleteUser": [
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"DescribeGroup": [
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"DescribeGroupMembership": [
|
||||||
|
"Group*",
|
||||||
|
"GroupMembership*",
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"DescribeIdentityStore": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"DescribeRegion": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"DescribeUser": [
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"GetGroupId": [
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"GetGroupMembershipId": [
|
||||||
|
"Group*",
|
||||||
|
"GroupMembership*",
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"GetUserId": [
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"IsMemberInGroups": [
|
||||||
|
"AllGroupMemberships*",
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"ListGroupMemberships": [
|
||||||
|
"AllGroupMemberships*",
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"ListGroupMembershipsForMember": [
|
||||||
|
"AllGroupMemberships*",
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
],
|
||||||
|
"ListGroups": [
|
||||||
|
"AllGroups*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"ListIdentityStores": [],
|
||||||
|
"ListRegions": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"ListUsers": [
|
||||||
|
"AllUsers*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"RemoveRegion": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"ReserveUser": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"UpdateGroup": [
|
||||||
|
"Group*",
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"UpdateIdentityStore": [
|
||||||
|
"Identitystore*"
|
||||||
|
],
|
||||||
|
"UpdateUser": [
|
||||||
|
"Identitystore*",
|
||||||
|
"User*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Tests for fetch_required_resource_types.py, on a page in the Service Authorization Reference's markup."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
import fetch_required_resource_types as f
|
||||||
|
|
||||||
|
|
||||||
|
def action(name: str, resources: list[str]) -> str:
|
||||||
|
"""An action's rows, one for each resource type cell, as the reference lays them out."""
|
||||||
|
cells = [f'<td tabindex="-1"><p><a href="#list_identitystore-resource-{kind.rstrip("*")}">{kind}</a></p></td>'
|
||||||
|
for kind in resources] or ['<td tabindex="-1"><p></p></td>']
|
||||||
|
keys = '<td tabindex="-1"><p><a href="#list_identitystore-identitystore_PrimaryRegion">PrimaryRegion</a></p></td>'
|
||||||
|
rows = [f'<tr><td rowspan="{len(cells)}" tabindex="-1"><p><span id="list_identitystore-action-{name}"></span>'
|
||||||
|
f'<a href="https://docs.aws.amazon.com/x.html">{name}</a></p></td><td rowspan="{len(cells)}">'
|
||||||
|
f'<p>Grants permission</p></td>{cells[0]}{keys}<td rowspan="{len(cells)}"><p>Write</p></td></tr>']
|
||||||
|
rows += [f"<tr>{cell}{keys}</tr>" for cell in cells[1:]]
|
||||||
|
return "".join(rows)
|
||||||
|
|
||||||
|
|
||||||
|
OPERATIONS = ('<table id="d0e1"><thead><tr><th>Operation</th><th>IAM action</th></tr></thead><tr><td>'
|
||||||
|
'<span id="list_identitystore-operation-CreateGroup"></span>CreateGroup</td></tr></table>')
|
||||||
|
PAGE = ('<html><body>' + OPERATIONS + '<table id="w1"><thead><tr><th>Actions</th><th>Description</th>'
|
||||||
|
'<th>Resource types (*required)</th><th>Condition keys</th><th>Access level</th></tr></thead>'
|
||||||
|
+ action("CreateGroup", ["Identitystore*"])
|
||||||
|
+ action("DeleteGroupMembership", ["Group*", "GroupMembership*", "Identitystore*", "User*"])
|
||||||
|
+ action("ListIdentityStores", [])
|
||||||
|
+ action("CreateCacheCluster", ["cluster", "parametergroup*"])
|
||||||
|
+ '</table><table><thead><tr><th>Resource types</th><th>ARN</th></tr></thead></table></body></html>')
|
||||||
|
|
||||||
|
|
||||||
|
def test_each_action_keeps_its_resource_type_cells_as_they_stand():
|
||||||
|
assert f.read_actions("page", PAGE) == {
|
||||||
|
"CreateGroup": ["Identitystore*"],
|
||||||
|
"DeleteGroupMembership": ["Group*", "GroupMembership*", "Identitystore*", "User*"],
|
||||||
|
"ListIdentityStores": [],
|
||||||
|
"CreateCacheCluster": ["cluster", "parametergroup*"]}
|
||||||
|
|
||||||
|
|
||||||
|
def test_a_page_whose_layout_changed_is_refused():
|
||||||
|
with pytest.raises(ValueError, match="no table headed"):
|
||||||
|
f.read_actions("page", "<html><body>" + OPERATIONS + "</body></html>")
|
||||||
|
with pytest.raises(ValueError, match="names no action"):
|
||||||
|
f.read_actions("page", PAGE.replace('<span id="list_identitystore-action-', '<span id="other-'))
|
||||||
|
|
||||||
|
|
||||||
|
def test_the_file_is_stale_when_a_page_says_something_else():
|
||||||
|
vendored = f.build({"identitystore": PAGE})
|
||||||
|
assert vendored["namespaces"]["identitystore"]["page"] == f.PAGES["identitystore"]
|
||||||
|
assert not f.stale(vendored, {"identitystore": PAGE})
|
||||||
|
assert f.stale(vendored, {"identitystore": PAGE.replace(">User*<", ">User<")})
|
||||||
@@ -586,6 +586,89 @@ def test_lists_a_request_adds_or_removes_name_a_type_no_resource_names_yet():
|
|||||||
assert r.with_change_lists(resources, ["group", "user"], formats, {"TagsToAdd": "TagsToAdd[]"}) == resources
|
assert r.with_change_lists(resources, ["group", "user"], formats, {"TagsToAdd": "TagsToAdd[]"}) == resources
|
||||||
|
|
||||||
|
|
||||||
|
def membership_model() -> dict:
|
||||||
|
"""A model of Identity Store's memberships: a record of the membership's group and member, a call naming it by its
|
||||||
|
id, and lookups returning the id of a membership, a group or a user its request names otherwise."""
|
||||||
|
service = model({"DeleteMembership": {"StoreId": "String", "MembershipId": "String"},
|
||||||
|
"GetMembershipId": {"StoreId": "String", "GroupId": "String", "MemberId": "MemberId"},
|
||||||
|
"GetGroupId": {"StoreId": "String", "AlternateIdentifier": "AlternateIdentifier"},
|
||||||
|
"ListMembers": {"StoreId": "String", "GroupIds": "Strings"}})
|
||||||
|
service["shapes"].update({
|
||||||
|
"GroupMembership": {"type": "structure", "members": {"StoreId": {"shape": "String"},
|
||||||
|
"MembershipId": {"shape": "String"},
|
||||||
|
"GroupId": {"shape": "String"},
|
||||||
|
"MemberId": {"shape": "MemberId"}}},
|
||||||
|
"MemberId": {"type": "structure", "union": True, "members": {"UserId": {"shape": "String"}}},
|
||||||
|
"AlternateIdentifier": {"type": "structure", "union": True,
|
||||||
|
"members": {"ExternalId": {"shape": "ExternalId"},
|
||||||
|
"UniqueAttribute": {"shape": "UniqueAttribute"}}},
|
||||||
|
"ExternalId": {"type": "structure", "members": {"Issuer": {"shape": "String"}, "Id": {"shape": "String"}}},
|
||||||
|
"UniqueAttribute": {"type": "structure", "members": {"AttributePath": {"shape": "String"},
|
||||||
|
"AttributeValue": {"shape": "Document"}}},
|
||||||
|
"Document": {"type": "structure", "members": {}, "document": True},
|
||||||
|
"GetMembershipIdOut": {"type": "structure", "members": {"StoreId": {"shape": "String"},
|
||||||
|
"MembershipId": {"shape": "String"}}},
|
||||||
|
"GetGroupIdOut": {"type": "structure", "members": {"StoreId": {"shape": "String"},
|
||||||
|
"GroupId": {"shape": "String"}}},
|
||||||
|
"ListMembersOut": {"type": "structure", "members": {"MembershipId": {"shape": "String"}}}})
|
||||||
|
for name in ("GetMembershipId", "GetGroupId", "ListMembers"):
|
||||||
|
service["operations"][name]["output"] = {"shape": name + "Out"}
|
||||||
|
return service
|
||||||
|
|
||||||
|
|
||||||
|
MEMBERSHIP_FORMATS = {"Group": "arn:${Partition}:svc:::group/${GroupId}",
|
||||||
|
"GroupMembership": "arn:${Partition}:svc:::membership/${MembershipId}",
|
||||||
|
"User": "arn:${Partition}:svc:::user/${UserId}"}
|
||||||
|
|
||||||
|
|
||||||
|
def test_a_record_names_the_types_it_links_beside_the_id_a_request_names_it_by(tmp_path):
|
||||||
|
# Identity Store's DeleteGroupMembership names the membership, whose record holds its group and its member.
|
||||||
|
write_models(tmp_path, {"svc": membership_model()})
|
||||||
|
models = r.load_models(tmp_path, {"svc"})
|
||||||
|
types = ["Group", "GroupMembership", "User"]
|
||||||
|
reached = r.record_reached(models, "DeleteMembership", types)
|
||||||
|
assert reached == {"MembershipId": {"GroupMembership": ["Group", "User"]}}
|
||||||
|
named = [{"type": "GroupMembership", "fill": {"MembershipId": "MembershipId"}}]
|
||||||
|
assert r.with_record_through(named, MEMBERSHIP_FORMATS, reached, {"Group", "GroupMembership", "User"}) == named + [
|
||||||
|
{"types": ["Group", "User"], "through": "MembershipId"}]
|
||||||
|
# Only a type the action requires is named so, and only through the member that names the record's own type.
|
||||||
|
assert r.with_record_through(named, MEMBERSHIP_FORMATS, reached, {"GroupMembership", "User"}) == named + [
|
||||||
|
{"types": ["User"], "through": "MembershipId"}]
|
||||||
|
assert r.with_record_through(named, MEMBERSHIP_FORMATS, reached, set()) == named
|
||||||
|
assert r.with_record_through([], MEMBERSHIP_FORMATS, reached, {"Group", "User"}) == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_a_lookup_finds_the_type_whose_id_it_returns_by_what_its_request_names(tmp_path):
|
||||||
|
# GetGroupMembershipId returns the id of the membership of its GroupId and MemberId.UserId.
|
||||||
|
write_models(tmp_path, {"svc": membership_model()})
|
||||||
|
models = r.load_models(tmp_path, {"svc"})
|
||||||
|
keys = r.lookup_keys(models, "GetMembershipId")
|
||||||
|
assert keys == {"MembershipId": [["StoreId", "GroupId", "MemberId.UserId"]]}
|
||||||
|
named = [{"type": "Group", "fill": {"GroupId": "GroupId"}}]
|
||||||
|
types = ["Group", "GroupMembership", "User"]
|
||||||
|
assert r.with_lookup_find(named, types, MEMBERSHIP_FORMATS, keys, {"Group", "GroupMembership"}) == named + [
|
||||||
|
{"type": "GroupMembership", "fill": {}, "find": ["StoreId", "GroupId", "MemberId.UserId"]}]
|
||||||
|
# A union is given one way at a time, so each way finds the type apart; a document is one value.
|
||||||
|
assert r.lookup_keys(models, "GetGroupId") == {"GroupId": [
|
||||||
|
["StoreId", "AlternateIdentifier.ExternalId.Issuer", "AlternateIdentifier.ExternalId.Id"],
|
||||||
|
["StoreId", "AlternateIdentifier.UniqueAttribute.AttributePath",
|
||||||
|
"AlternateIdentifier.UniqueAttribute.AttributeValue"]]}
|
||||||
|
# A request holding a list looks nothing up, and a type the action does not require is not found.
|
||||||
|
assert r.lookup_keys(models, "ListMembers") == {}
|
||||||
|
assert r.with_lookup_find(named, types, MEMBERSHIP_FORMATS, keys, {"Group"}) == named
|
||||||
|
|
||||||
|
|
||||||
|
def test_the_vendored_reference_gives_the_types_an_action_requires():
|
||||||
|
assert r.required_types("identitystore:DeleteGroupMembership", ["Group", "GroupMembership", "Identitystore",
|
||||||
|
"User"]) == {"Group", "GroupMembership",
|
||||||
|
"Identitystore", "User"}
|
||||||
|
# A namespace the source is not granted for requires nothing it says.
|
||||||
|
assert r.required_types("elasticache:CreateCacheCluster", ["cluster", "parametergroup"]) == set()
|
||||||
|
# A required type the Service Reference does not give the action is refused.
|
||||||
|
with pytest.raises(ValueError, match="does not give it"):
|
||||||
|
r.required_types("identitystore:DeleteGroupMembership", ["Group", "GroupMembership", "Identitystore"])
|
||||||
|
|
||||||
|
|
||||||
def test_a_structure_named_after_the_type_gives_its_name_to_a_type_named_by_nothing_else(tmp_path):
|
def test_a_structure_named_after_the_type_gives_its_name_to_a_type_named_by_nothing_else(tmp_path):
|
||||||
# Config's PutConfigurationRecorder names its recorder in ConfigurationRecorder.name.
|
# Config's PutConfigurationRecorder names its recorder in ConfigurationRecorder.name.
|
||||||
service = model({"PutRecorder": {"Recorder": "Recorder"}})
|
service = model({"PutRecorder": {"Recorder": "Recorder"}})
|
||||||
@@ -1324,6 +1407,18 @@ def test_the_vendored_file_is_well_formed():
|
|||||||
assert operations["elasticache:ModifyUserGroup"]["resources"] == [
|
assert operations["elasticache:ModifyUserGroup"]["resources"] == [
|
||||||
{"type": "usergroup", "fill": {"UserGroupId": "UserGroupId"}},
|
{"type": "usergroup", "fill": {"UserGroupId": "UserGroupId"}},
|
||||||
{"type": "user", "fill": {"UserId": "UserIdsToAdd[]"}}, {"type": "user", "fill": {"UserId": "UserIdsToRemove[]"}}]
|
{"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.
|
||||||
|
assert "identitystore" in document["namespaces"] and "identitystore" not in document["notCovered"]
|
||||||
|
assert {"type": "User", "fill": {"UserId": "UserId"}} in operations["identitystore:DescribeUser"]["resources"]
|
||||||
|
# A membership's group and user are read through its id, and a lookup's group, user or membership found by what
|
||||||
|
# its request names, as the vendored reference requires those types.
|
||||||
|
assert {"types": ["Group", "User"], "through": "MembershipId"} in operations[
|
||||||
|
"identitystore:DeleteGroupMembership"]["resources"]
|
||||||
|
assert {"type": "GroupMembership", "fill": {}, "find": ["IdentityStoreId", "GroupId", "MemberId.UserId"]} in \
|
||||||
|
operations["identitystore:GetGroupMembershipId"]["resources"]
|
||||||
|
assert {"type": "User", "fill": {}, "find": ["IdentityStoreId", "AlternateIdentifier.ExternalId.Issuer",
|
||||||
|
"AlternateIdentifier.ExternalId.Id"]} in \
|
||||||
|
operations["identitystore:GetUserId"]["resources"]
|
||||||
# A scalable target is found by the three members naming it, its ARN ending in the id the service mints.
|
# 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 operations["application-autoscaling:DeregisterScalableTarget"]["resources"] == [
|
||||||
{"type": "ScalableTarget", "fill": {}, "find": ["ServiceNamespace", "ResourceId", "ScalableDimension"]}]
|
{"type": "ScalableTarget", "fill": {}, "find": ["ServiceNamespace", "ResourceId", "ScalableDimension"]}]
|
||||||
|
|||||||
Reference in new issue
Block a user