mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
feat(organizations): add AWS Organizations service (#2489)
* feat(organizations): add AWS Organizations service Implements the AWS Organizations control plane over JSON 1.1 (AWSOrganizationsV20161128.*): organizations and roots, the OU tree, member accounts, all policy types, tags, trusted service access, delegated administrators, the organization resource policy, and the invitation/handshake flow. Organizations is global and cross-account, so records are addressed through the explicit *ForAccount methods on AccountAwareStorageBackend rather than the request-context-derived get/put: a member account calling DescribeOrganization has a different request account than the one owning the data. The caller account is used for authorization instead — mutations are management-account only, members get read access to their own organization, and outsiders get AWSOrganizationsNotInUseException. Because Floci already resolves a 12-digit access key id to an account, an account created by CreateAccount is immediately usable as a caller identity against every other service. * fix(organizations): emit only AWS's handshake resource types Review feedback on #2489. The ORGANIZATION resource on an INVITE handshake was carrying a MASTER_ACCOUNT_ID child. HandshakeResourceType is a closed enum and that value is not in it, so the AWS SDK deserializes it as UNKNOWN_TO_SDK_VERSION rather than failing loudly. AWS's documented children are MASTER_EMAIL and MASTER_NAME; emit those instead. The javadoc already described the correct pair, so it was the code that deviated. Adds an integration test pinning the resource types against the enum so this cannot regress. Also from review: - POLICY_TYPES and EFFECTIVE_POLICY_TYPES are rendered into validation messages, but Set.of's iteration order is unspecified and salted per JVM run, so the same rejection could read differently between runs. Declare them as ordered Lists with companion Sets for O(1) membership. - listHandshakesForAccount called organizationById — itself a full scan — once per handshake. Build the orgId to management-account map once.
This commit is contained in:
1 parent
56e74d64c6
commit
87e804492a
30 files changed
+5343
-2
No files matched your search
@@ -634,6 +634,7 @@ public interface EmulatorConfig {
|
||||
IotServiceConfig iot();
|
||||
IotDataServiceConfig iotdata();
|
||||
CloudHsmV2ServiceConfig cloudhsmv2();
|
||||
OrganizationsServiceConfig organizations();
|
||||
RumServiceConfig rum();
|
||||
GuardDutyServiceConfig guardduty();
|
||||
EmrServerlessServiceConfig emrserverless();
|
||||
@@ -1205,6 +1206,11 @@ public interface EmulatorConfig {
|
||||
boolean enabled();
|
||||
}
|
||||
|
||||
interface OrganizationsServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
}
|
||||
|
||||
interface AthenaServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
@@ -40,6 +40,7 @@ import io.github.hectorvent.floci.services.kinesis.KinesisJsonHandler;
|
||||
import io.github.hectorvent.floci.services.kinesisanalytics.KinesisAnalyticsV2JsonHandler;
|
||||
import io.github.hectorvent.floci.services.kms.KmsJsonHandler;
|
||||
import io.github.hectorvent.floci.services.secretsmanager.SecretsManagerJsonHandler;
|
||||
import io.github.hectorvent.floci.services.organizations.OrganizationsJsonHandler;
|
||||
import io.github.hectorvent.floci.services.ssm.Ec2MessagesJsonHandler;
|
||||
import io.github.hectorvent.floci.services.ssm.SsmJsonHandler;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -105,6 +106,7 @@ public class AwsJson11Controller {
|
||||
private final CloudControlJsonHandler cloudControlJsonHandler;
|
||||
private final ApplicationAutoScalingJsonHandler applicationAutoScalingJsonHandler;
|
||||
private final CloudHsmV2JsonHandler cloudHsmV2JsonHandler;
|
||||
private final OrganizationsJsonHandler organizationsJsonHandler;
|
||||
|
||||
@Inject
|
||||
public AwsJson11Controller(ObjectMapper objectMapper, ResolvedServiceCatalog catalog,
|
||||
@@ -141,7 +143,8 @@ public class AwsJson11Controller {
|
||||
LightsailJsonHandler lightsailJsonHandler,
|
||||
CloudControlJsonHandler cloudControlJsonHandler,
|
||||
ApplicationAutoScalingJsonHandler applicationAutoScalingJsonHandler,
|
||||
CloudHsmV2JsonHandler cloudHsmV2JsonHandler){
|
||||
CloudHsmV2JsonHandler cloudHsmV2JsonHandler,
|
||||
OrganizationsJsonHandler organizationsJsonHandler){
|
||||
this.objectMapper = objectMapper;
|
||||
this.strictBodyReader = objectMapper.reader().with(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);
|
||||
this.catalog = catalog;
|
||||
@@ -183,6 +186,7 @@ public class AwsJson11Controller {
|
||||
this.cloudControlJsonHandler = cloudControlJsonHandler;
|
||||
this.applicationAutoScalingJsonHandler = applicationAutoScalingJsonHandler;
|
||||
this.cloudHsmV2JsonHandler = cloudHsmV2JsonHandler;
|
||||
this.organizationsJsonHandler = organizationsJsonHandler;
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -255,6 +259,10 @@ public class AwsJson11Controller {
|
||||
case "lightsail" -> lightsailJsonHandler.handle(action, request, region);
|
||||
case "cloudcontrol" -> cloudControlJsonHandler.handle(action, request, region);
|
||||
case "cloudhsmv2" -> cloudHsmV2JsonHandler.handle(action, request, region);
|
||||
// Organizations is global and account-scoped rather than region-scoped: every
|
||||
// action is authorized against the calling account, so pass that instead of region.
|
||||
case "organizations" ->
|
||||
organizationsJsonHandler.handle(action, request, regionResolver.getAccountId());
|
||||
default -> null;
|
||||
};
|
||||
// catalog.matchTarget is protocol-agnostic: a JSON 1.0 target
|
||||
|
||||
@@ -476,6 +476,10 @@ public class ResolvedServiceCatalog {
|
||||
"cloudhsmv2", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
|
||||
protocols(ServiceProtocol.JSON),
|
||||
Set.of("BaldrApiService."), Set.of("cloudhsm"), Set.of(), Set.of()),
|
||||
descriptor("organizations", "organizations", config.services().organizations().enabled(), true,
|
||||
"organizations", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
|
||||
protocols(ServiceProtocol.JSON),
|
||||
Set.of("AWSOrganizationsV20161128."), Set.of("organizations"), Set.of(), Set.of()),
|
||||
descriptor("rum", "rum", config.services().rum().enabled(), true,
|
||||
"rum", storageMode(config.storage().services().rum().mode(), config.storage().mode()),
|
||||
config.storage().services().rum().flushIntervalMs(), null, ServiceProtocol.REST_JSON,
|
||||
|
||||
+756
@@ -0,0 +1,756 @@
|
||||
package io.github.hectorvent.floci.services.organizations;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.JsonErrorResponseUtils;
|
||||
import io.github.hectorvent.floci.core.common.PaginatedResult;
|
||||
import io.github.hectorvent.floci.core.common.Pagination;
|
||||
import io.github.hectorvent.floci.services.organizations.model.CreateAccountStatus;
|
||||
import io.github.hectorvent.floci.services.organizations.model.Handshake;
|
||||
import io.github.hectorvent.floci.services.organizations.model.HandshakeParty;
|
||||
import io.github.hectorvent.floci.services.organizations.model.HandshakeResource;
|
||||
import io.github.hectorvent.floci.services.organizations.model.Organization;
|
||||
import io.github.hectorvent.floci.services.organizations.model.OrganizationAccount;
|
||||
import io.github.hectorvent.floci.services.organizations.model.OrganizationPolicy;
|
||||
import io.github.hectorvent.floci.services.organizations.model.OrganizationalUnit;
|
||||
import io.github.hectorvent.floci.services.organizations.model.PolicyTypeSummary;
|
||||
import io.github.hectorvent.floci.services.organizations.model.Root;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* AWS Organizations JSON 1.1 handler. Dispatched from
|
||||
* {@link io.github.hectorvent.floci.core.common.AwsJson11Controller} under the
|
||||
* {@code AWSOrganizationsV20161128.} target prefix.
|
||||
*
|
||||
* <p>The handler is deliberately thin: it parses the request, delegates to
|
||||
* {@link OrganizationsService}, and renders the AWS response shape. All validation and
|
||||
* authorization lives in the service.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class OrganizationsJsonHandler {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(OrganizationsJsonHandler.class);
|
||||
|
||||
/** AWS caps MaxResults at 20 across the Organizations list operations. */
|
||||
private static final int MAX_PAGE = 20;
|
||||
|
||||
private static final String PAGINATION_ERROR = "InvalidInputException";
|
||||
|
||||
private final OrganizationsService service;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
@Inject
|
||||
public OrganizationsJsonHandler(OrganizationsService service, ObjectMapper objectMapper) {
|
||||
this.service = service;
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
public Response handle(String action, JsonNode request, String callerAccountId) {
|
||||
LOG.debugv("Organizations action: {0}", action);
|
||||
try {
|
||||
return switch (action) {
|
||||
case "CreateOrganization" -> createOrganization(request, callerAccountId);
|
||||
case "DescribeOrganization" -> describeOrganization(callerAccountId);
|
||||
case "DeleteOrganization" -> deleteOrganization(callerAccountId);
|
||||
case "EnableAllFeatures" -> enableAllFeatures(callerAccountId);
|
||||
case "ListRoots" -> listRoots(request, callerAccountId);
|
||||
case "CreateOrganizationalUnit" -> createOrganizationalUnit(request, callerAccountId);
|
||||
case "UpdateOrganizationalUnit" -> updateOrganizationalUnit(request, callerAccountId);
|
||||
case "DeleteOrganizationalUnit" -> deleteOrganizationalUnit(request, callerAccountId);
|
||||
case "DescribeOrganizationalUnit" -> describeOrganizationalUnit(request, callerAccountId);
|
||||
case "ListOrganizationalUnitsForParent" -> listOrganizationalUnitsForParent(request, callerAccountId);
|
||||
case "ListParents" -> listParents(request, callerAccountId);
|
||||
case "ListChildren" -> listChildren(request, callerAccountId);
|
||||
case "CreateAccount" -> createAccount(request, callerAccountId, false);
|
||||
case "CreateGovCloudAccount" -> createAccount(request, callerAccountId, true);
|
||||
case "DescribeCreateAccountStatus" -> describeCreateAccountStatus(request, callerAccountId);
|
||||
case "ListCreateAccountStatus" -> listCreateAccountStatus(request, callerAccountId);
|
||||
case "DescribeAccount" -> describeAccount(request, callerAccountId);
|
||||
case "ListAccounts" -> listAccounts(request, callerAccountId);
|
||||
case "ListAccountsForParent" -> listAccountsForParent(request, callerAccountId);
|
||||
case "MoveAccount" -> moveAccount(request, callerAccountId);
|
||||
case "RemoveAccountFromOrganization" -> removeAccountFromOrganization(request, callerAccountId);
|
||||
case "LeaveOrganization" -> leaveOrganization(callerAccountId);
|
||||
case "CloseAccount" -> closeAccount(request, callerAccountId);
|
||||
case "CreatePolicy" -> createPolicy(request, callerAccountId);
|
||||
case "UpdatePolicy" -> updatePolicy(request, callerAccountId);
|
||||
case "DeletePolicy" -> deletePolicy(request, callerAccountId);
|
||||
case "DescribePolicy" -> describePolicy(request, callerAccountId);
|
||||
case "ListPolicies" -> listPolicies(request, callerAccountId);
|
||||
case "AttachPolicy" -> attachPolicy(request, callerAccountId);
|
||||
case "DetachPolicy" -> detachPolicy(request, callerAccountId);
|
||||
case "ListPoliciesForTarget" -> listPoliciesForTarget(request, callerAccountId);
|
||||
case "ListTargetsForPolicy" -> listTargetsForPolicy(request, callerAccountId);
|
||||
case "EnablePolicyType" -> enablePolicyType(request, callerAccountId);
|
||||
case "DisablePolicyType" -> disablePolicyType(request, callerAccountId);
|
||||
case "DescribeEffectivePolicy" -> describeEffectivePolicy(request, callerAccountId);
|
||||
case "TagResource" -> tagResource(request, callerAccountId);
|
||||
case "UntagResource" -> untagResource(request, callerAccountId);
|
||||
case "ListTagsForResource" -> listTagsForResource(request, callerAccountId);
|
||||
case "EnableAWSServiceAccess" -> enableAwsServiceAccess(request, callerAccountId);
|
||||
case "DisableAWSServiceAccess" -> disableAwsServiceAccess(request, callerAccountId);
|
||||
case "ListAWSServiceAccessForOrganization" ->
|
||||
listAwsServiceAccessForOrganization(request, callerAccountId);
|
||||
case "RegisterDelegatedAdministrator" -> registerDelegatedAdministrator(request, callerAccountId);
|
||||
case "DeregisterDelegatedAdministrator" -> deregisterDelegatedAdministrator(request, callerAccountId);
|
||||
case "ListDelegatedAdministrators" -> listDelegatedAdministrators(request, callerAccountId);
|
||||
case "ListDelegatedServicesForAccount" -> listDelegatedServicesForAccount(request, callerAccountId);
|
||||
case "PutResourcePolicy" -> putResourcePolicy(request, callerAccountId);
|
||||
case "DescribeResourcePolicy" -> describeResourcePolicy(callerAccountId);
|
||||
case "DeleteResourcePolicy" -> deleteResourcePolicy(callerAccountId);
|
||||
case "InviteAccountToOrganization" -> inviteAccountToOrganization(request, callerAccountId);
|
||||
case "AcceptHandshake" -> acceptHandshake(request, callerAccountId);
|
||||
case "DeclineHandshake" -> declineHandshake(request, callerAccountId);
|
||||
case "CancelHandshake" -> cancelHandshake(request, callerAccountId);
|
||||
case "DescribeHandshake" -> describeHandshake(request, callerAccountId);
|
||||
case "ListHandshakesForAccount" -> listHandshakesForAccount(request, callerAccountId);
|
||||
case "ListHandshakesForOrganization" -> listHandshakesForOrganization(request, callerAccountId);
|
||||
default -> JsonErrorResponseUtils.createUnknownOperationErrorResponse(
|
||||
"AWSOrganizationsV20161128." + action);
|
||||
};
|
||||
} catch (AwsException e) {
|
||||
return JsonErrorResponseUtils.createErrorResponse(e);
|
||||
} catch (Exception e) {
|
||||
LOG.errorf(e, "Organizations error processing action %s", action);
|
||||
return JsonErrorResponseUtils.createErrorResponse(e);
|
||||
}
|
||||
}
|
||||
|
||||
// ──────────────────────────── Organization lifecycle ────────────────────────────
|
||||
|
||||
private Response createOrganization(JsonNode request, String caller) {
|
||||
Organization organization = service.createOrganization(caller, text(request, "FeatureSet"));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("Organization", organizationNode(organization));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response describeOrganization(String caller) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("Organization", organizationNode(service.describeOrganization(caller)));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response deleteOrganization(String caller) {
|
||||
service.deleteOrganization(caller);
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response enableAllFeatures(String caller) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("Handshake", handshakeNode(service.enableAllFeatures(caller)));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listRoots(JsonNode request, String caller) {
|
||||
PaginatedResult<Root> page = page(service.listRoots(caller), Root::getId, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode roots = response.putArray("Roots");
|
||||
page.items().forEach(root -> roots.add(rootNode(root)));
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Organizational units ────────────────────────────
|
||||
|
||||
private Response createOrganizationalUnit(JsonNode request, String caller) {
|
||||
OrganizationalUnit unit = service.createOrganizationalUnit(caller,
|
||||
text(request, "ParentId"), text(request, "Name"), parseTags(request.path("Tags")));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("OrganizationalUnit", organizationalUnitNode(unit));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response updateOrganizationalUnit(JsonNode request, String caller) {
|
||||
OrganizationalUnit unit = service.updateOrganizationalUnit(caller,
|
||||
text(request, "OrganizationalUnitId"), text(request, "Name"));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("OrganizationalUnit", organizationalUnitNode(unit));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response deleteOrganizationalUnit(JsonNode request, String caller) {
|
||||
service.deleteOrganizationalUnit(caller, text(request, "OrganizationalUnitId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response describeOrganizationalUnit(JsonNode request, String caller) {
|
||||
OrganizationalUnit unit = service.describeOrganizationalUnit(caller, text(request, "OrganizationalUnitId"));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("OrganizationalUnit", organizationalUnitNode(unit));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listOrganizationalUnitsForParent(JsonNode request, String caller) {
|
||||
List<OrganizationalUnit> all = service.listOrganizationalUnitsForParent(caller, text(request, "ParentId"));
|
||||
PaginatedResult<OrganizationalUnit> page = page(all, OrganizationalUnit::getId, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode units = response.putArray("OrganizationalUnits");
|
||||
page.items().forEach(unit -> units.add(organizationalUnitNode(unit)));
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listParents(JsonNode request, String caller) {
|
||||
List<OrganizationsService.ParentRef> all = service.listParents(caller, text(request, "ChildId"));
|
||||
PaginatedResult<OrganizationsService.ParentRef> page =
|
||||
page(all, OrganizationsService.ParentRef::id, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode parents = response.putArray("Parents");
|
||||
page.items().forEach(parent -> {
|
||||
ObjectNode node = parents.addObject();
|
||||
node.put("Id", parent.id());
|
||||
node.put("Type", parent.type());
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listChildren(JsonNode request, String caller) {
|
||||
List<OrganizationsService.ChildRef> all =
|
||||
service.listChildren(caller, text(request, "ParentId"), text(request, "ChildType"));
|
||||
PaginatedResult<OrganizationsService.ChildRef> page = page(all, OrganizationsService.ChildRef::id, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode children = response.putArray("Children");
|
||||
page.items().forEach(child -> {
|
||||
ObjectNode node = children.addObject();
|
||||
node.put("Id", child.id());
|
||||
node.put("Type", child.type());
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Accounts ────────────────────────────
|
||||
|
||||
private Response createAccount(JsonNode request, String caller, boolean govCloud) {
|
||||
CreateAccountStatus status = service.createAccount(caller,
|
||||
text(request, "Email"), text(request, "AccountName"), parseTags(request.path("Tags")), govCloud);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("CreateAccountStatus", createAccountStatusNode(status));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response describeCreateAccountStatus(JsonNode request, String caller) {
|
||||
CreateAccountStatus status =
|
||||
service.describeCreateAccountStatus(caller, text(request, "CreateAccountRequestId"));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("CreateAccountStatus", createAccountStatusNode(status));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listCreateAccountStatus(JsonNode request, String caller) {
|
||||
List<CreateAccountStatus> all = service.listCreateAccountStatus(caller, parseStringList(request.path("States")));
|
||||
PaginatedResult<CreateAccountStatus> page = page(all, CreateAccountStatus::getId, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode statuses = response.putArray("CreateAccountStatuses");
|
||||
page.items().forEach(status -> statuses.add(createAccountStatusNode(status)));
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response describeAccount(JsonNode request, String caller) {
|
||||
OrganizationAccount account = service.describeAccount(caller, text(request, "AccountId"));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("Account", accountNode(account));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listAccounts(JsonNode request, String caller) {
|
||||
PaginatedResult<OrganizationAccount> page =
|
||||
page(service.listAccounts(caller), OrganizationAccount::getId, request);
|
||||
return accountsResponse(page);
|
||||
}
|
||||
|
||||
private Response listAccountsForParent(JsonNode request, String caller) {
|
||||
List<OrganizationAccount> all = service.listAccountsForParent(caller, text(request, "ParentId"));
|
||||
return accountsResponse(page(all, OrganizationAccount::getId, request));
|
||||
}
|
||||
|
||||
private Response accountsResponse(PaginatedResult<OrganizationAccount> page) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode accounts = response.putArray("Accounts");
|
||||
page.items().forEach(account -> accounts.add(accountNode(account)));
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response moveAccount(JsonNode request, String caller) {
|
||||
service.moveAccount(caller, text(request, "AccountId"),
|
||||
text(request, "SourceParentId"), text(request, "DestinationParentId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response removeAccountFromOrganization(JsonNode request, String caller) {
|
||||
service.removeAccountFromOrganization(caller, text(request, "AccountId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response leaveOrganization(String caller) {
|
||||
service.leaveOrganization(caller);
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response closeAccount(JsonNode request, String caller) {
|
||||
service.closeAccount(caller, text(request, "AccountId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Policies ────────────────────────────
|
||||
|
||||
private Response createPolicy(JsonNode request, String caller) {
|
||||
OrganizationPolicy policy = service.createPolicy(caller,
|
||||
text(request, "Content"), text(request, "Description"), text(request, "Name"),
|
||||
text(request, "Type"), parseTags(request.path("Tags")));
|
||||
return policyResponse(policy);
|
||||
}
|
||||
|
||||
private Response updatePolicy(JsonNode request, String caller) {
|
||||
OrganizationPolicy policy = service.updatePolicy(caller, text(request, "PolicyId"),
|
||||
text(request, "Name"), text(request, "Description"), text(request, "Content"));
|
||||
return policyResponse(policy);
|
||||
}
|
||||
|
||||
private Response deletePolicy(JsonNode request, String caller) {
|
||||
service.deletePolicy(caller, text(request, "PolicyId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response describePolicy(JsonNode request, String caller) {
|
||||
return policyResponse(service.describePolicy(caller, text(request, "PolicyId")));
|
||||
}
|
||||
|
||||
private Response policyResponse(OrganizationPolicy policy) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ObjectNode node = response.putObject("Policy");
|
||||
node.set("PolicySummary", policySummaryNode(policy));
|
||||
node.put("Content", policy.getContent());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listPolicies(JsonNode request, String caller) {
|
||||
List<OrganizationPolicy> all = service.listPolicies(caller, text(request, "Filter"));
|
||||
return policiesResponse(page(all, OrganizationPolicy::getId, request));
|
||||
}
|
||||
|
||||
private Response listPoliciesForTarget(JsonNode request, String caller) {
|
||||
List<OrganizationPolicy> all =
|
||||
service.listPoliciesForTarget(caller, text(request, "TargetId"), text(request, "Filter"));
|
||||
return policiesResponse(page(all, OrganizationPolicy::getId, request));
|
||||
}
|
||||
|
||||
private Response policiesResponse(PaginatedResult<OrganizationPolicy> page) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode policies = response.putArray("Policies");
|
||||
page.items().forEach(policy -> policies.add(policySummaryNode(policy)));
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response attachPolicy(JsonNode request, String caller) {
|
||||
service.attachPolicy(caller, text(request, "PolicyId"), text(request, "TargetId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response detachPolicy(JsonNode request, String caller) {
|
||||
service.detachPolicy(caller, text(request, "PolicyId"), text(request, "TargetId"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response listTargetsForPolicy(JsonNode request, String caller) {
|
||||
List<OrganizationsService.PolicyTarget> all =
|
||||
service.listTargetsForPolicy(caller, text(request, "PolicyId"));
|
||||
PaginatedResult<OrganizationsService.PolicyTarget> page =
|
||||
page(all, OrganizationsService.PolicyTarget::targetId, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode targets = response.putArray("Targets");
|
||||
page.items().forEach(target -> {
|
||||
ObjectNode node = targets.addObject();
|
||||
node.put("TargetId", target.targetId());
|
||||
node.put("Arn", target.arn());
|
||||
node.put("Name", target.name());
|
||||
node.put("Type", target.type());
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response enablePolicyType(JsonNode request, String caller) {
|
||||
Root root = service.enablePolicyType(caller, text(request, "RootId"), text(request, "PolicyType"));
|
||||
return rootResponse(root);
|
||||
}
|
||||
|
||||
private Response disablePolicyType(JsonNode request, String caller) {
|
||||
Root root = service.disablePolicyType(caller, text(request, "RootId"), text(request, "PolicyType"));
|
||||
return rootResponse(root);
|
||||
}
|
||||
|
||||
private Response rootResponse(Root root) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("Root", rootNode(root));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response describeEffectivePolicy(JsonNode request, String caller) {
|
||||
OrganizationsService.EffectivePolicy effective =
|
||||
service.describeEffectivePolicy(caller, text(request, "PolicyType"), text(request, "TargetId"));
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ObjectNode node = response.putObject("EffectivePolicy");
|
||||
node.put("PolicyContent", effective.policyContent());
|
||||
node.put("PolicyType", effective.policyType());
|
||||
node.put("TargetId", effective.targetId());
|
||||
putTimestamp(node, "LastUpdatedTimestamp", effective.lastUpdatedTimestamp());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Tags ────────────────────────────
|
||||
|
||||
private Response tagResource(JsonNode request, String caller) {
|
||||
service.tagResource(caller, text(request, "ResourceId"), parseTags(request.path("Tags")));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response untagResource(JsonNode request, String caller) {
|
||||
service.untagResource(caller, text(request, "ResourceId"), parseStringList(request.path("TagKeys")));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response listTagsForResource(JsonNode request, String caller) {
|
||||
Map<String, String> tags = service.listTagsForResource(caller, text(request, "ResourceId"));
|
||||
List<Map.Entry<String, String>> entries = new ArrayList<>(tags.entrySet());
|
||||
PaginatedResult<Map.Entry<String, String>> page = page(entries, Map.Entry::getKey, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode array = response.putArray("Tags");
|
||||
page.items().forEach(entry -> {
|
||||
ObjectNode node = array.addObject();
|
||||
node.put("Key", entry.getKey());
|
||||
node.put("Value", entry.getValue());
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Trusted access and delegation ────────────────────────────
|
||||
|
||||
private Response enableAwsServiceAccess(JsonNode request, String caller) {
|
||||
service.enableAWSServiceAccess(caller, text(request, "ServicePrincipal"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response disableAwsServiceAccess(JsonNode request, String caller) {
|
||||
service.disableAWSServiceAccess(caller, text(request, "ServicePrincipal"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response listAwsServiceAccessForOrganization(JsonNode request, String caller) {
|
||||
List<OrganizationsService.EnabledServicePrincipal> all =
|
||||
service.listAWSServiceAccessForOrganization(caller);
|
||||
PaginatedResult<OrganizationsService.EnabledServicePrincipal> page =
|
||||
page(all, OrganizationsService.EnabledServicePrincipal::servicePrincipal, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode principals = response.putArray("EnabledServicePrincipals");
|
||||
page.items().forEach(principal -> {
|
||||
ObjectNode node = principals.addObject();
|
||||
node.put("ServicePrincipal", principal.servicePrincipal());
|
||||
putTimestamp(node, "DateEnabled", principal.dateEnabled());
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response registerDelegatedAdministrator(JsonNode request, String caller) {
|
||||
service.registerDelegatedAdministrator(caller, text(request, "AccountId"), text(request, "ServicePrincipal"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response deregisterDelegatedAdministrator(JsonNode request, String caller) {
|
||||
service.deregisterDelegatedAdministrator(caller, text(request, "AccountId"), text(request, "ServicePrincipal"));
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response listDelegatedAdministrators(JsonNode request, String caller) {
|
||||
String servicePrincipal = text(request, "ServicePrincipal");
|
||||
List<OrganizationAccount> all = service.listDelegatedAdministrators(caller, servicePrincipal);
|
||||
PaginatedResult<OrganizationAccount> page = page(all, OrganizationAccount::getId, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode administrators = response.putArray("DelegatedAdministrators");
|
||||
page.items().forEach(account -> {
|
||||
ObjectNode node = accountNode(account);
|
||||
Instant enabled = servicePrincipal != null
|
||||
? account.getDelegatedServices().get(servicePrincipal)
|
||||
: account.getDelegatedServices().values().stream().findFirst().orElse(null);
|
||||
putTimestamp(node, "DelegationEnabledDate", enabled);
|
||||
administrators.add(node);
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listDelegatedServicesForAccount(JsonNode request, String caller) {
|
||||
List<OrganizationsService.DelegatedService> all =
|
||||
service.listDelegatedServicesForAccount(caller, text(request, "AccountId"));
|
||||
PaginatedResult<OrganizationsService.DelegatedService> page =
|
||||
page(all, OrganizationsService.DelegatedService::servicePrincipal, request);
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode services = response.putArray("DelegatedServices");
|
||||
page.items().forEach(delegated -> {
|
||||
ObjectNode node = services.addObject();
|
||||
node.put("ServicePrincipal", delegated.servicePrincipal());
|
||||
putTimestamp(node, "DelegationEnabledDate", delegated.delegationEnabledDate());
|
||||
});
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Resource policy ────────────────────────────
|
||||
|
||||
private Response putResourcePolicy(JsonNode request, String caller) {
|
||||
OrganizationsService.ResourcePolicyView policy =
|
||||
service.putResourcePolicy(caller, text(request, "Content"), parseTags(request.path("Tags")));
|
||||
return resourcePolicyResponse(policy);
|
||||
}
|
||||
|
||||
private Response describeResourcePolicy(String caller) {
|
||||
return resourcePolicyResponse(service.describeResourcePolicy(caller));
|
||||
}
|
||||
|
||||
private Response deleteResourcePolicy(String caller) {
|
||||
service.deleteResourcePolicy(caller);
|
||||
return empty();
|
||||
}
|
||||
|
||||
private Response resourcePolicyResponse(OrganizationsService.ResourcePolicyView policy) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ObjectNode node = response.putObject("ResourcePolicy");
|
||||
ObjectNode summary = node.putObject("ResourcePolicySummary");
|
||||
summary.put("Id", policy.id());
|
||||
summary.put("Arn", policy.arn());
|
||||
node.put("Content", policy.content());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Handshakes ────────────────────────────
|
||||
|
||||
private Response inviteAccountToOrganization(JsonNode request, String caller) {
|
||||
JsonNode target = request.path("Target");
|
||||
Handshake handshake = service.inviteAccountToOrganization(caller,
|
||||
text(target, "Id"), text(target, "Type"), text(request, "Notes"));
|
||||
return handshakeResponse(handshake);
|
||||
}
|
||||
|
||||
private Response acceptHandshake(JsonNode request, String caller) {
|
||||
return handshakeResponse(service.acceptHandshake(caller, text(request, "HandshakeId")));
|
||||
}
|
||||
|
||||
private Response declineHandshake(JsonNode request, String caller) {
|
||||
return handshakeResponse(service.declineHandshake(caller, text(request, "HandshakeId")));
|
||||
}
|
||||
|
||||
private Response cancelHandshake(JsonNode request, String caller) {
|
||||
return handshakeResponse(service.cancelHandshake(caller, text(request, "HandshakeId")));
|
||||
}
|
||||
|
||||
private Response describeHandshake(JsonNode request, String caller) {
|
||||
return handshakeResponse(service.describeHandshake(caller, text(request, "HandshakeId")));
|
||||
}
|
||||
|
||||
private Response handshakeResponse(Handshake handshake) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
response.set("Handshake", handshakeNode(handshake));
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
private Response listHandshakesForAccount(JsonNode request, String caller) {
|
||||
JsonNode filter = request.path("Filter");
|
||||
List<Handshake> all = service.listHandshakesForAccount(caller,
|
||||
parseStringList(filter.path("States")), text(filter, "ActionType"));
|
||||
return handshakesResponse(page(all, Handshake::getId, request));
|
||||
}
|
||||
|
||||
private Response listHandshakesForOrganization(JsonNode request, String caller) {
|
||||
JsonNode filter = request.path("Filter");
|
||||
List<Handshake> all = service.listHandshakesForOrganization(caller,
|
||||
parseStringList(filter.path("States")), text(filter, "ActionType"));
|
||||
return handshakesResponse(page(all, Handshake::getId, request));
|
||||
}
|
||||
|
||||
private Response handshakesResponse(PaginatedResult<Handshake> page) {
|
||||
ObjectNode response = objectMapper.createObjectNode();
|
||||
ArrayNode handshakes = response.putArray("Handshakes");
|
||||
page.items().forEach(handshake -> handshakes.add(handshakeNode(handshake)));
|
||||
putNextToken(response, page.nextToken());
|
||||
return Response.ok(response).build();
|
||||
}
|
||||
|
||||
// ──────────────────────────── Response shapes ────────────────────────────
|
||||
|
||||
private ObjectNode organizationNode(Organization organization) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", organization.getId());
|
||||
node.put("Arn", organization.getArn());
|
||||
node.put("FeatureSet", organization.getFeatureSet());
|
||||
node.put("MasterAccountArn", organization.getMasterAccountArn());
|
||||
node.put("MasterAccountId", organization.getMasterAccountId());
|
||||
node.put("MasterAccountEmail", organization.getMasterAccountEmail());
|
||||
ArrayNode policyTypes = node.putArray("AvailablePolicyTypes");
|
||||
organization.getRoot().getPolicyTypes().forEach(summary -> policyTypes.add(policyTypeNode(summary)));
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode rootNode(Root root) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", root.getId());
|
||||
node.put("Arn", root.getArn());
|
||||
node.put("Name", root.getName());
|
||||
ArrayNode policyTypes = node.putArray("PolicyTypes");
|
||||
root.getPolicyTypes().forEach(summary -> policyTypes.add(policyTypeNode(summary)));
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode policyTypeNode(PolicyTypeSummary summary) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Type", summary.getType());
|
||||
node.put("Status", summary.getStatus());
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode organizationalUnitNode(OrganizationalUnit unit) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", unit.getId());
|
||||
node.put("Arn", unit.getArn());
|
||||
node.put("Name", unit.getName());
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode accountNode(OrganizationAccount account) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", account.getId());
|
||||
node.put("Arn", account.getArn());
|
||||
node.put("Email", account.getEmail());
|
||||
node.put("Name", account.getName());
|
||||
node.put("Status", account.getStatus());
|
||||
node.put("JoinedMethod", account.getJoinedMethod());
|
||||
putTimestamp(node, "JoinedTimestamp", account.getJoinedTimestamp());
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode policySummaryNode(OrganizationPolicy policy) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", policy.getId());
|
||||
node.put("Arn", policy.getArn());
|
||||
node.put("Name", policy.getName());
|
||||
node.put("Description", policy.getDescription() == null ? "" : policy.getDescription());
|
||||
node.put("Type", policy.getType());
|
||||
node.put("AwsManaged", policy.isAwsManaged());
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode createAccountStatusNode(CreateAccountStatus status) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", status.getId());
|
||||
node.put("AccountName", status.getAccountName());
|
||||
node.put("State", status.getState());
|
||||
putTimestamp(node, "RequestedTimestamp", status.getRequestedTimestamp());
|
||||
putTimestamp(node, "CompletedTimestamp", status.getCompletedTimestamp());
|
||||
if (status.getAccountId() != null) {
|
||||
node.put("AccountId", status.getAccountId());
|
||||
}
|
||||
if (status.getGovCloudAccountId() != null) {
|
||||
node.put("GovCloudAccountId", status.getGovCloudAccountId());
|
||||
}
|
||||
if (status.getFailureReason() != null) {
|
||||
node.put("FailureReason", status.getFailureReason());
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode handshakeNode(Handshake handshake) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Id", handshake.getId());
|
||||
node.put("Arn", handshake.getArn());
|
||||
node.put("State", handshake.getState());
|
||||
node.put("Action", handshake.getAction());
|
||||
putTimestamp(node, "RequestedTimestamp", handshake.getRequestedTimestamp());
|
||||
putTimestamp(node, "ExpirationTimestamp", handshake.getExpirationTimestamp());
|
||||
ArrayNode parties = node.putArray("Parties");
|
||||
for (HandshakeParty party : handshake.getParties()) {
|
||||
ObjectNode partyNode = parties.addObject();
|
||||
partyNode.put("Id", party.getId());
|
||||
partyNode.put("Type", party.getType());
|
||||
}
|
||||
ArrayNode resources = node.putArray("Resources");
|
||||
handshake.getResources().forEach(resource -> resources.add(handshakeResourceNode(resource)));
|
||||
return node;
|
||||
}
|
||||
|
||||
private ObjectNode handshakeResourceNode(HandshakeResource resource) {
|
||||
ObjectNode node = objectMapper.createObjectNode();
|
||||
node.put("Value", resource.getValue());
|
||||
node.put("Type", resource.getType());
|
||||
if (!resource.getResources().isEmpty()) {
|
||||
ArrayNode nested = node.putArray("Resources");
|
||||
resource.getResources().forEach(child -> nested.add(handshakeResourceNode(child)));
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
// ──────────────────────────── Parsing helpers ────────────────────────────
|
||||
|
||||
private <T> PaginatedResult<T> page(List<T> all, Function<T, String> cursorOf, JsonNode request) {
|
||||
Integer maxResults = request.hasNonNull("MaxResults") ? request.get("MaxResults").asInt() : null;
|
||||
return Pagination.paginate(all, cursorOf, maxResults, text(request, "NextToken"), MAX_PAGE, PAGINATION_ERROR);
|
||||
}
|
||||
|
||||
private void putNextToken(ObjectNode response, String nextToken) {
|
||||
if (nextToken != null) {
|
||||
response.put("NextToken", nextToken);
|
||||
}
|
||||
}
|
||||
|
||||
private void putTimestamp(ObjectNode node, String field, Instant timestamp) {
|
||||
if (timestamp != null) {
|
||||
node.put(field, timestamp.toEpochMilli() / 1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
private Response empty() {
|
||||
return Response.ok(objectMapper.createObjectNode()).build();
|
||||
}
|
||||
|
||||
private static String text(JsonNode node, String field) {
|
||||
JsonNode value = node.path(field);
|
||||
return value.isMissingNode() || value.isNull() ? null : value.asText();
|
||||
}
|
||||
|
||||
/** Organizations sends tags as a list of {@code {Key, Value}} objects, not a map. */
|
||||
private static Map<String, String> parseTags(JsonNode node) {
|
||||
if (node == null || !node.isArray()) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> tags = new LinkedHashMap<>();
|
||||
node.forEach(entry -> tags.put(entry.path("Key").asText(), entry.path("Value").asText("")));
|
||||
return tags;
|
||||
}
|
||||
|
||||
private static List<String> parseStringList(JsonNode node) {
|
||||
if (node == null || !node.isArray()) {
|
||||
return null;
|
||||
}
|
||||
List<String> values = new ArrayList<>();
|
||||
node.forEach(entry -> values.add(entry.asText()));
|
||||
return values;
|
||||
}
|
||||
}
|
||||
+1667
File diff suppressed because it is too large.
Load diff
+98
@@ -0,0 +1,98 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Tracks an asynchronous {@code CreateAccount} or {@code CreateGovCloudAccount} request.
|
||||
*
|
||||
* <p>AWS returns this in {@code IN_PROGRESS} and the caller polls
|
||||
* {@code DescribeCreateAccountStatus}. Floci completes the account synchronously but keeps the
|
||||
* record so SDK code written against the real polling contract works unchanged.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class CreateAccountStatus {
|
||||
|
||||
private String id;
|
||||
private String accountName;
|
||||
private String state;
|
||||
private Instant requestedTimestamp;
|
||||
private Instant completedTimestamp;
|
||||
private String accountId;
|
||||
private String govCloudAccountId;
|
||||
private String failureReason;
|
||||
private String organizationId;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Instant getRequestedTimestamp() {
|
||||
return requestedTimestamp;
|
||||
}
|
||||
|
||||
public void setRequestedTimestamp(Instant requestedTimestamp) {
|
||||
this.requestedTimestamp = requestedTimestamp;
|
||||
}
|
||||
|
||||
public Instant getCompletedTimestamp() {
|
||||
return completedTimestamp;
|
||||
}
|
||||
|
||||
public void setCompletedTimestamp(Instant completedTimestamp) {
|
||||
this.completedTimestamp = completedTimestamp;
|
||||
}
|
||||
|
||||
public String getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setAccountId(String accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public String getGovCloudAccountId() {
|
||||
return govCloudAccountId;
|
||||
}
|
||||
|
||||
public void setGovCloudAccountId(String govCloudAccountId) {
|
||||
this.govCloudAccountId = govCloudAccountId;
|
||||
}
|
||||
|
||||
public String getFailureReason() {
|
||||
return failureReason;
|
||||
}
|
||||
|
||||
public void setFailureReason(String failureReason) {
|
||||
this.failureReason = failureReason;
|
||||
}
|
||||
|
||||
public String getOrganizationId() {
|
||||
return organizationId;
|
||||
}
|
||||
|
||||
public void setOrganizationId(String organizationId) {
|
||||
this.organizationId = organizationId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Domain model for a handshake — the two-party exchange behind
|
||||
* {@code InviteAccountToOrganization} and {@code EnableAllFeatures}.
|
||||
*
|
||||
* <p>{@code targetAccountId} and {@code targetEmail} are Floci bookkeeping, not part of the
|
||||
* AWS wire shape: they record which account (or email) the invitation was addressed to so
|
||||
* {@code ListHandshakesForAccount} can answer for a caller that has not joined yet.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class Handshake {
|
||||
|
||||
private String id;
|
||||
private String arn;
|
||||
private String state;
|
||||
private String action;
|
||||
private Instant requestedTimestamp;
|
||||
private Instant expirationTimestamp;
|
||||
private List<HandshakeParty> parties = new ArrayList<>();
|
||||
private List<HandshakeResource> resources = new ArrayList<>();
|
||||
private String organizationId;
|
||||
private String targetAccountId;
|
||||
private String targetEmail;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getArn() {
|
||||
return arn;
|
||||
}
|
||||
|
||||
public void setArn(String arn) {
|
||||
this.arn = arn;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public Instant getRequestedTimestamp() {
|
||||
return requestedTimestamp;
|
||||
}
|
||||
|
||||
public void setRequestedTimestamp(Instant requestedTimestamp) {
|
||||
this.requestedTimestamp = requestedTimestamp;
|
||||
}
|
||||
|
||||
public Instant getExpirationTimestamp() {
|
||||
return expirationTimestamp;
|
||||
}
|
||||
|
||||
public void setExpirationTimestamp(Instant expirationTimestamp) {
|
||||
this.expirationTimestamp = expirationTimestamp;
|
||||
}
|
||||
|
||||
public List<HandshakeParty> getParties() {
|
||||
return parties;
|
||||
}
|
||||
|
||||
public void setParties(List<HandshakeParty> parties) {
|
||||
this.parties = parties;
|
||||
}
|
||||
|
||||
public List<HandshakeResource> getResources() {
|
||||
return resources;
|
||||
}
|
||||
|
||||
public void setResources(List<HandshakeResource> resources) {
|
||||
this.resources = resources;
|
||||
}
|
||||
|
||||
public String getOrganizationId() {
|
||||
return organizationId;
|
||||
}
|
||||
|
||||
public void setOrganizationId(String organizationId) {
|
||||
this.organizationId = organizationId;
|
||||
}
|
||||
|
||||
public String getTargetAccountId() {
|
||||
return targetAccountId;
|
||||
}
|
||||
|
||||
public void setTargetAccountId(String targetAccountId) {
|
||||
this.targetAccountId = targetAccountId;
|
||||
}
|
||||
|
||||
public String getTargetEmail() {
|
||||
return targetEmail;
|
||||
}
|
||||
|
||||
public void setTargetEmail(String targetEmail) {
|
||||
this.targetEmail = targetEmail;
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
/**
|
||||
* One side of a handshake. {@code type} is {@code ACCOUNT}, {@code ORGANIZATION} or
|
||||
* {@code EMAIL}, and {@code id} is interpreted accordingly.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class HandshakeParty {
|
||||
|
||||
private String id;
|
||||
private String type;
|
||||
|
||||
public HandshakeParty() {
|
||||
}
|
||||
|
||||
public HandshakeParty(String id, String type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A piece of information attached to a handshake. AWS nests these — the {@code ORGANIZATION}
|
||||
* resource carries {@code MASTER_EMAIL} and {@code MASTER_NAME} children — so the shape is
|
||||
* recursive.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class HandshakeResource {
|
||||
|
||||
private String value;
|
||||
private String type;
|
||||
private List<HandshakeResource> resources = new ArrayList<>();
|
||||
|
||||
public HandshakeResource() {
|
||||
}
|
||||
|
||||
public HandshakeResource(String value, String type) {
|
||||
this.value = value;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public List<HandshakeResource> getResources() {
|
||||
return resources;
|
||||
}
|
||||
|
||||
public void setResources(List<HandshakeResource> resources) {
|
||||
this.resources = resources;
|
||||
}
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Domain model for an AWS Organization.
|
||||
*
|
||||
* <p>The organization is the anchor for every other Organizations resource: accounts, OUs and
|
||||
* policies all carry its id, which is what lets a member account resolve the organization it
|
||||
* belongs to without knowing the management account up front.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class Organization {
|
||||
|
||||
private String id;
|
||||
private String arn;
|
||||
private String featureSet;
|
||||
private String masterAccountId;
|
||||
private String masterAccountArn;
|
||||
private String masterAccountEmail;
|
||||
private Instant createdTimestamp;
|
||||
private Root root = new Root();
|
||||
|
||||
/** Service principal to the timestamp trusted access was enabled, in insertion order. */
|
||||
private Map<String, Instant> enabledServicePrincipals = new LinkedHashMap<>();
|
||||
|
||||
private String resourcePolicyId;
|
||||
private String resourcePolicyArn;
|
||||
private String resourcePolicyContent;
|
||||
private Map<String, String> resourcePolicyTags = new LinkedHashMap<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getArn() {
|
||||
return arn;
|
||||
}
|
||||
|
||||
public void setArn(String arn) {
|
||||
this.arn = arn;
|
||||
}
|
||||
|
||||
public String getFeatureSet() {
|
||||
return featureSet;
|
||||
}
|
||||
|
||||
public void setFeatureSet(String featureSet) {
|
||||
this.featureSet = featureSet;
|
||||
}
|
||||
|
||||
public String getMasterAccountId() {
|
||||
return masterAccountId;
|
||||
}
|
||||
|
||||
public void setMasterAccountId(String masterAccountId) {
|
||||
this.masterAccountId = masterAccountId;
|
||||
}
|
||||
|
||||
public String getMasterAccountArn() {
|
||||
return masterAccountArn;
|
||||
}
|
||||
|
||||
public void setMasterAccountArn(String masterAccountArn) {
|
||||
this.masterAccountArn = masterAccountArn;
|
||||
}
|
||||
|
||||
public String getMasterAccountEmail() {
|
||||
return masterAccountEmail;
|
||||
}
|
||||
|
||||
public void setMasterAccountEmail(String masterAccountEmail) {
|
||||
this.masterAccountEmail = masterAccountEmail;
|
||||
}
|
||||
|
||||
public Instant getCreatedTimestamp() {
|
||||
return createdTimestamp;
|
||||
}
|
||||
|
||||
public void setCreatedTimestamp(Instant createdTimestamp) {
|
||||
this.createdTimestamp = createdTimestamp;
|
||||
}
|
||||
|
||||
public Root getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
public void setRoot(Root root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
public Map<String, Instant> getEnabledServicePrincipals() {
|
||||
return enabledServicePrincipals;
|
||||
}
|
||||
|
||||
public void setEnabledServicePrincipals(Map<String, Instant> enabledServicePrincipals) {
|
||||
this.enabledServicePrincipals = enabledServicePrincipals;
|
||||
}
|
||||
|
||||
public String getResourcePolicyId() {
|
||||
return resourcePolicyId;
|
||||
}
|
||||
|
||||
public void setResourcePolicyId(String resourcePolicyId) {
|
||||
this.resourcePolicyId = resourcePolicyId;
|
||||
}
|
||||
|
||||
public String getResourcePolicyArn() {
|
||||
return resourcePolicyArn;
|
||||
}
|
||||
|
||||
public void setResourcePolicyArn(String resourcePolicyArn) {
|
||||
this.resourcePolicyArn = resourcePolicyArn;
|
||||
}
|
||||
|
||||
public String getResourcePolicyContent() {
|
||||
return resourcePolicyContent;
|
||||
}
|
||||
|
||||
public void setResourcePolicyContent(String resourcePolicyContent) {
|
||||
this.resourcePolicyContent = resourcePolicyContent;
|
||||
}
|
||||
|
||||
public Map<String, String> getResourcePolicyTags() {
|
||||
return resourcePolicyTags;
|
||||
}
|
||||
|
||||
public void setResourcePolicyTags(Map<String, String> resourcePolicyTags) {
|
||||
this.resourcePolicyTags = resourcePolicyTags;
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Domain model for an account that belongs to an organization.
|
||||
*
|
||||
* <p>The account id doubles as a Floci account: {@code AccountResolver} treats any 12-digit
|
||||
* access key id as an account, so an account created here can immediately be used as a caller
|
||||
* identity against every other Floci service.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class OrganizationAccount {
|
||||
|
||||
private String id;
|
||||
private String arn;
|
||||
private String email;
|
||||
private String name;
|
||||
private String status;
|
||||
private String joinedMethod;
|
||||
private Instant joinedTimestamp;
|
||||
private String organizationId;
|
||||
private String parentId;
|
||||
private Map<String, String> tags = new LinkedHashMap<>();
|
||||
|
||||
/** Service principal to the timestamp this account was registered as a delegated admin. */
|
||||
private Map<String, Instant> delegatedServices = new LinkedHashMap<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getArn() {
|
||||
return arn;
|
||||
}
|
||||
|
||||
public void setArn(String arn) {
|
||||
this.arn = arn;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getJoinedMethod() {
|
||||
return joinedMethod;
|
||||
}
|
||||
|
||||
public void setJoinedMethod(String joinedMethod) {
|
||||
this.joinedMethod = joinedMethod;
|
||||
}
|
||||
|
||||
public Instant getJoinedTimestamp() {
|
||||
return joinedTimestamp;
|
||||
}
|
||||
|
||||
public void setJoinedTimestamp(Instant joinedTimestamp) {
|
||||
this.joinedTimestamp = joinedTimestamp;
|
||||
}
|
||||
|
||||
public String getOrganizationId() {
|
||||
return organizationId;
|
||||
}
|
||||
|
||||
public void setOrganizationId(String organizationId) {
|
||||
this.organizationId = organizationId;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(Map<String, String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public Map<String, Instant> getDelegatedServices() {
|
||||
return delegatedServices;
|
||||
}
|
||||
|
||||
public void setDelegatedServices(Map<String, Instant> delegatedServices) {
|
||||
this.delegatedServices = delegatedServices;
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Domain model for an organization policy (SCP, tag policy, backup policy, and peers).
|
||||
*
|
||||
* <p>Attachments are held on the policy rather than on the target so that
|
||||
* {@code ListTargetsForPolicy} and {@code DetachPolicy} stay a single lookup; the reverse
|
||||
* direction ({@code ListPoliciesForTarget}) scans the org's policies.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class OrganizationPolicy {
|
||||
|
||||
private String id;
|
||||
private String arn;
|
||||
private String name;
|
||||
private String description;
|
||||
private String type;
|
||||
private boolean awsManaged;
|
||||
private String content;
|
||||
private String organizationId;
|
||||
|
||||
/** Root, OU and account ids this policy is attached to, in attachment order. */
|
||||
private Set<String> targets = new LinkedHashSet<>();
|
||||
|
||||
private Map<String, String> tags = new LinkedHashMap<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getArn() {
|
||||
return arn;
|
||||
}
|
||||
|
||||
public void setArn(String arn) {
|
||||
this.arn = arn;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isAwsManaged() {
|
||||
return awsManaged;
|
||||
}
|
||||
|
||||
public void setAwsManaged(boolean awsManaged) {
|
||||
this.awsManaged = awsManaged;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getOrganizationId() {
|
||||
return organizationId;
|
||||
}
|
||||
|
||||
public void setOrganizationId(String organizationId) {
|
||||
this.organizationId = organizationId;
|
||||
}
|
||||
|
||||
public Set<String> getTargets() {
|
||||
return targets;
|
||||
}
|
||||
|
||||
public void setTargets(Set<String> targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(Map<String, String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Domain model for an organizational unit. {@code parentId} is either the root id or
|
||||
* another OU id, which is what makes the hierarchy arbitrarily deep.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class OrganizationalUnit {
|
||||
|
||||
private String id;
|
||||
private String arn;
|
||||
private String name;
|
||||
private String organizationId;
|
||||
private String parentId;
|
||||
private Map<String, String> tags = new LinkedHashMap<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getArn() {
|
||||
return arn;
|
||||
}
|
||||
|
||||
public void setArn(String arn) {
|
||||
this.arn = arn;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getOrganizationId() {
|
||||
return organizationId;
|
||||
}
|
||||
|
||||
public void setOrganizationId(String organizationId) {
|
||||
this.organizationId = organizationId;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(Map<String, String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
/**
|
||||
* A policy type and its enablement status on a root, as returned inside
|
||||
* {@code ListRoots} and {@code DescribeOrganization}.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class PolicyTypeSummary {
|
||||
|
||||
private String type;
|
||||
private String status;
|
||||
|
||||
public PolicyTypeSummary() {
|
||||
}
|
||||
|
||||
public PolicyTypeSummary(String type, String status) {
|
||||
this.type = type;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package io.github.hectorvent.floci.services.organizations.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The root of an organization's OU hierarchy. An organization has exactly one root,
|
||||
* so it is stored inside {@link Organization} rather than in its own backend.
|
||||
*/
|
||||
@RegisterForReflection
|
||||
public class Root {
|
||||
|
||||
private String id;
|
||||
private String arn;
|
||||
private String name = "Root";
|
||||
private List<PolicyTypeSummary> policyTypes = new ArrayList<>();
|
||||
private Map<String, String> tags = new LinkedHashMap<>();
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getArn() {
|
||||
return arn;
|
||||
}
|
||||
|
||||
public void setArn(String arn) {
|
||||
this.arn = arn;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<PolicyTypeSummary> getPolicyTypes() {
|
||||
return policyTypes;
|
||||
}
|
||||
|
||||
public void setPolicyTypes(List<PolicyTypeSummary> policyTypes) {
|
||||
this.policyTypes = policyTypes;
|
||||
}
|
||||
|
||||
public Map<String, String> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(Map<String, String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user