mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner (#3164)
* refactor(cloudformation): move Cognito UserPool and UserPoolClient to CognitoCfnProvisioner
Batch 3 of the CloudFormationResourceProvisioner split. AWS::Cognito::UserPool and
AWS::Cognito::UserPoolClient join the provisioner that already owns UserPoolDomain;
the two arms, their switch cases, the type-list entries, the Cognito-only
resolveStringMapOrNull helper and the CognitoService dependency leave the monolith.
Behaviour is preserved except for what the split's conventions require:
- the create/update branch reads ctx.isUpdate() instead of the resource's physical
id, which provision overwrites as it runs
- deletes go through CfnDeletes.safeDelete tolerating only ResourceNotFoundException;
a pool that still has a domain keeps failing the stack delete with
InvalidParameterException, as on AWS
- the client also exposes Name, the read-only attribute the registry schema declares
(ClientName stays for now), so CfnSchemaCoverageTest needs no gaps row
- the ReplacementCleanup hooks are wired for both types; nothing replaces yet, so
they are inert until create-only properties are honoured
The unit test covers both types with a mocked service: request map and generated
names, update carrying the prior id, the exact attribute sets, positional client
arguments, and delete tolerance. The domain delete path now branches on type first,
since a pool resource also carries a UserPoolId attribute.
* fix(cloudformation): replace a Cognito user pool client when its create-only properties change
UserPoolId and GenerateSecret are createOnlyProperties in the AWS::Cognito::UserPoolClient
registry schema: on AWS a change to either creates a new client and deletes the old one
after the update commits. The provisioner passed the new pool id to UpdateUserPoolClient,
which fails with ResourceNotFoundException because a client is only found through the
pool that owns it, and a changed GenerateSecret was silently ignored since the update
call has no such parameter.
The provisioner now looks the prior client up by id, updates in place only when both
create-only properties are unchanged, and otherwise creates the replacement; the
ReplacementCleanup record deletes the displaced client once the update completes or
restores it on rollback. A prior client that is already gone is created anew. The by-id
describeUserPoolClient overload is new on CognitoService, mirroring its delete pair.
* fix(cloudformation): resolve Cognito UserPoolTags as the map the schema declares
AWS::Cognito::UserPool.UserPoolTags is an object (the type's tagProperty), not the
[{Key, Value}] list most types carry. The provisioner parsed it with the list helper,
which yields nothing for a map, so the tags only reached the service through the raw
property map, where a non-string tag value arrives as a number. The tags are now
resolved as a string map and put explicitly, on create and on update.
* fix(cloudformation): give Fn::GetAtt ProviderName on a Cognito user pool AWS's shape
The attribute returned the pool name. On AWS it is cognito-idp.<region>.amazonaws.com/<pool id>,
the value templates feed into an identity pool's CognitoIdentityProviders (CDK derives the
same string in UserPool.fromUserPoolArn). ProviderURL deliberately stays Floci's local
issuer, <base-url>/<pool id>, since that is the iss of the tokens Floci mints and a template
wiring it into a JWT authorizer must validate locally; the generated resource-type table
now says so.
* fix(cognito): apply PoolName on UpdateUserPool so a CloudFormation rename takes effect
UpdateUserPoolRequest carries PoolName in the service model and AWS::Cognito::UserPool
lists UserPoolName as updatable in place, but updateUserPool only ran populateUserPool,
which never sets the name, so a renamed pool kept its old name through both the API and
a stack update. The service now applies a non-blank PoolName.
The provisioner sends PoolName on update only when the template names the pool: an
unnamed pool keeps the name its first execution generated instead of being renamed to a
freshly generated one on every update.
* fix(cloudformation): expose only the schema's attributes on a Cognito user pool client
The AWS::Cognito::UserPoolClient registry schema declares ClientId, Name and ClientSecret
as its read-only properties. ClientName is a request property, not an attribute; on AWS
Fn::GetAtt Client.ClientName fails template validation, so no working template depends on
it. It is dropped in favour of Name.
* fix(cloudformation): validate Cognito user pool client properties instead of dropping them
A non-integer AccessTokenValidity, IdTokenValidity or RefreshTokenValidity was parsed to
null and silently ignored, so the template's intent was lost without a word. The
provisioner now fails the resource with ValidationError "Value of property X must be an
integer.", as the ECS provisioner does for DesiredCount. UserPoolId, the schema's one
required property, is likewise rejected when missing rather than passed through as null.
* test(cloudformation): cover Cognito user pool client replacement end to end
Through the CloudFormation API: a client moved to another pool and one whose
GenerateSecret flips are each replaced, with the displaced client gone once the update
completes; a rename updates the client in place; Fn::GetAtt Name and the pool's
ProviderName carry their AWS shapes; deleting the stack removes client and pools.
* fix(cloudformation): drop a stale ClientSecret attribute when a replacement client has none
The engine hands an update the prior attributes, and the provisioner only wrote
ClientSecret when the new client had one, so replacing a secret-bearing client with
GenerateSecret: false left the displaced client's secret readable through Fn::GetAtt.
The attribute is now removed when the client has no secret; rollback still restores it
from the cleanup record's snapshot.
* fix(cloudformation): refuse a Cognito client replacement that would reuse the prior client id
AWS client ids are random, so a replacement never collides with the client it replaces.
Under Floci's floci:override-cognito-client-id tag the id follows the client name, and a
replacement that kept the name (a GenerateSecret flip, or a move to a pool with the same
override) was created under the prior id: the store overwrote the prior client, the cleanup
record saw an unchanged id and recorded nothing, and the update could not be rolled back.
Neither overwriting nor delete-then-create can preserve the prior client, so the update is
now refused with ValidationError before anything changes and the stack rolls back intact.
CognitoService gains deterministicClientIdFor(userPoolId, clientName), sharing the id rule
with createUserPoolClient; the provisioner compares it with the prior id in the replacement
branch only.
* fix(cloudformation): refuse a Cognito client whose derived id another client already holds
The round-1 guard compared the derived id only with the client being replaced. Under
floci:override-cognito-client-id the store is keyed by client id alone, so a name whose
derived id belongs to any other client, in this pool or another, would overwrite that client
on create, and neither the cleanup record nor rollback knows about it. The guard now refuses
whenever an existing client holds the derived id, on a fresh create as well as a replacement.
* fix(cloudformation): make the deterministic Cognito client-id guard atomic and ignore orphaned records
Two gaps in the round-2 guard. CloudFormationService runs stack operations on a cached
thread pool and CognitoService's client store write is unconditional, so two stacks could
both find a derived id free and the later create overwrote the earlier stack's client; the
existence check and the create now run under one lock whenever the id is derived from the
name. And deleting a user pool does not remove its clients yet (#2949 adds that), so a client
of a deleted pool kept its derived id and the guard refused a legitimate create in another
pool; a holder whose pool no longer exists is now treated as a stale record the create may
take over. Random ids take neither path.
This commit is contained in:
1 parent
3bd1be3d42
commit
0321ae0ac8
10 files changed
+1259
-153
No files matched your search
-118
@@ -87,9 +87,6 @@ import io.github.hectorvent.floci.services.stepfunctions.model.StateMachine;
|
||||
import io.github.hectorvent.floci.services.apigateway.ApiGatewayService;
|
||||
import io.github.hectorvent.floci.services.apigatewayv2.ApiGatewayV2Service;
|
||||
import io.github.hectorvent.floci.services.apigatewayv2.model.*;
|
||||
import io.github.hectorvent.floci.services.cognito.CognitoService;
|
||||
import io.github.hectorvent.floci.services.cognito.model.UserPool;
|
||||
import io.github.hectorvent.floci.services.cognito.model.UserPoolClient;
|
||||
import io.github.hectorvent.floci.config.EmulatorConfig;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerReachableEndpoint;
|
||||
@@ -213,8 +210,6 @@ public class CloudFormationResourceProvisioner {
|
||||
"AWS::Batch::JobQueue",
|
||||
"AWS::CloudFormation::CustomResource",
|
||||
"AWS::CloudFront::Distribution",
|
||||
"AWS::Cognito::UserPool",
|
||||
"AWS::Cognito::UserPoolClient",
|
||||
"AWS::DynamoDB::GlobalTable",
|
||||
"AWS::DynamoDB::Table",
|
||||
"AWS::EC2::EIP",
|
||||
@@ -272,7 +267,6 @@ public class CloudFormationResourceProvisioner {
|
||||
private final EventBridgeService eventBridgeService;
|
||||
private final ApiGatewayService apiGatewayService;
|
||||
private final ApiGatewayV2Service apiGatewayV2Service;
|
||||
private final CognitoService cognitoService;
|
||||
private final LambdaLayerService lambdaLayerService;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final CustomResourceResponseStore customResourceResponseStore;
|
||||
@@ -304,7 +298,6 @@ public class CloudFormationResourceProvisioner {
|
||||
ApiGatewayV2Service apiGatewayV2Service,
|
||||
EcrService ecrService,
|
||||
PipesService pipesService,
|
||||
CognitoService cognitoService,
|
||||
LambdaLayerService lambdaLayerService,
|
||||
ObjectMapper objectMapper,
|
||||
CustomResourceResponseStore customResourceResponseStore,
|
||||
@@ -334,7 +327,6 @@ public class CloudFormationResourceProvisioner {
|
||||
this.eventBridgeService = eventBridgeService;
|
||||
this.apiGatewayService = apiGatewayService;
|
||||
this.apiGatewayV2Service = apiGatewayV2Service;
|
||||
this.cognitoService = cognitoService;
|
||||
this.lambdaLayerService = lambdaLayerService;
|
||||
this.objectMapper = objectMapper;
|
||||
this.customResourceResponseStore = customResourceResponseStore;
|
||||
@@ -430,10 +422,6 @@ public class CloudFormationResourceProvisioner {
|
||||
region,
|
||||
accountId,
|
||||
stackName);
|
||||
case "AWS::Cognito::UserPool" ->
|
||||
provisionCognitoUserPool(resource, properties, engine, region, accountId, stackName);
|
||||
case "AWS::Cognito::UserPoolClient" ->
|
||||
provisionCognitoUserPoolClient(resource, properties, engine, region, accountId, stackName);
|
||||
case "AWS::CloudFormation::CustomResource" ->
|
||||
provisionCustomResource(resource, properties, engine, region, accountId, stackName);
|
||||
case "Custom::DynamoDBReplica" -> provisionDynamoDbReplica(resource, properties, engine, region);
|
||||
@@ -718,8 +706,6 @@ public class CloudFormationResourceProvisioner {
|
||||
case "AWS::ApiGatewayV2::Api" -> apiGatewayV2Service.deleteApi(region, physicalId);
|
||||
case "AWS::StepFunctions::StateMachine" -> stepFunctionsService.deleteStateMachine(physicalId);
|
||||
case "AWS::Lambda::LayerVersion" -> deleteLambdaLayerVersion(physicalId, region);
|
||||
case "AWS::Cognito::UserPool" -> cognitoService.deleteUserPool(physicalId);
|
||||
case "AWS::Cognito::UserPoolClient" -> cognitoService.deleteUserPoolClient(physicalId);
|
||||
case "AWS::ElasticLoadBalancingV2::LoadBalancer" -> elbV2Service.deleteLoadBalancer(region, physicalId);
|
||||
case "AWS::ElasticLoadBalancingV2::TargetGroup" -> elbV2Service.deleteTargetGroup(region, physicalId);
|
||||
case "AWS::ElasticLoadBalancingV2::Listener" -> elbV2Service.deleteListener(region, physicalId);
|
||||
@@ -5770,97 +5756,6 @@ public class CloudFormationResourceProvisioner {
|
||||
r.setPhysicalId(deployment.getDeploymentId());
|
||||
}
|
||||
|
||||
// ── Cognito ──────────────────────────────────────────────────────────────
|
||||
|
||||
private void provisionCognitoUserPool(StackResource r, JsonNode props, CloudFormationTemplateEngine engine,
|
||||
String region, String accountId, String stackName) {
|
||||
String poolName = resolveOptional(props, "UserPoolName", engine);
|
||||
if (poolName == null || poolName.isBlank()) {
|
||||
poolName = generatePhysicalName(stackName, r.getLogicalId(), 128, false);
|
||||
}
|
||||
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
if (props != null) {
|
||||
req.putAll(jsonObjectToMap(engine.resolveNode(props)));
|
||||
}
|
||||
req.put("PoolName", poolName);
|
||||
|
||||
// Handle Tags
|
||||
Map<String, String> tags = parseCfnTags(props != null ? props.get("UserPoolTags") : null, engine);
|
||||
if (!tags.isEmpty()) {
|
||||
req.put("UserPoolTags", tags);
|
||||
}
|
||||
|
||||
UserPool pool;
|
||||
if (r.getPhysicalId() == null) {
|
||||
pool = cognitoService.createUserPool(req, region);
|
||||
} else {
|
||||
req.put("UserPoolId", r.getPhysicalId());
|
||||
pool = cognitoService.updateUserPool(req, region);
|
||||
}
|
||||
|
||||
r.setPhysicalId(pool.getId());
|
||||
r.getAttributes().put("Arn", pool.getArn());
|
||||
r.getAttributes().put("UserPoolId", pool.getId());
|
||||
r.getAttributes().put("ProviderName", pool.getName());
|
||||
r.getAttributes().put("ProviderURL", cognitoService.getIssuer(pool.getId()));
|
||||
}
|
||||
|
||||
private void provisionCognitoUserPoolClient(StackResource r, JsonNode props, CloudFormationTemplateEngine engine,
|
||||
String region, String accountId, String stackName) {
|
||||
String userPoolId = resolveOptional(props, "UserPoolId", engine);
|
||||
String clientName = resolveOptional(props, "ClientName", engine);
|
||||
if (clientName == null || clientName.isBlank()) {
|
||||
clientName = generatePhysicalName(stackName, r.getLogicalId(), 128, false);
|
||||
}
|
||||
boolean generateSecret = Boolean.parseBoolean(resolveOrDefault(props, "GenerateSecret", engine, "false"));
|
||||
boolean allowedOAuthFlowsUserPoolClient = Boolean.parseBoolean(resolveOrDefault(props, "AllowedOAuthFlowsUserPoolClient", engine, "false"));
|
||||
List<String> allowedOAuthFlows = resolveStringListOrEmpty(props, "AllowedOAuthFlows", engine);
|
||||
List<String> allowedOAuthScopes = resolveStringListOrEmpty(props, "AllowedOAuthScopes", engine);
|
||||
|
||||
Map<String, Object> analyticsConfiguration = resolveMapOrDefault(props, "AnalyticsConfiguration", engine, null);
|
||||
List<String> callbackURLs = resolveStringListOrEmpty(props, "CallbackURLs", engine);
|
||||
String defaultRedirectURI = resolveOptional(props, "DefaultRedirectURI", engine);
|
||||
List<String> explicitAuthFlows = resolveStringListOrEmpty(props, "ExplicitAuthFlows", engine);
|
||||
Integer accessTokenValidity = parseIntegerPropOrNull(props, "AccessTokenValidity", engine);
|
||||
Integer idTokenValidity = parseIntegerPropOrNull(props, "IdTokenValidity", engine);
|
||||
List<String> logoutURLs = resolveStringListOrEmpty(props, "LogoutURLs", engine);
|
||||
String preventUserExistenceErrors = resolveOptional(props, "PreventUserExistenceErrors", engine);
|
||||
List<String> readAttributes = resolveStringListOrEmpty(props, "ReadAttributes", engine);
|
||||
Integer refreshTokenValidity = parseIntegerPropOrNull(props, "RefreshTokenValidity", engine);
|
||||
List<String> supportedIdentityProviders = resolveStringListOrEmpty(props, "SupportedIdentityProviders", engine);
|
||||
Map<String, String> tokenValidityUnits = resolveStringMapOrNull(props, "TokenValidityUnits", engine);
|
||||
List<String> writeAttributes = resolveStringListOrEmpty(props, "WriteAttributes", engine);
|
||||
Map<String, Object> refreshTokenRotation = resolveMapOrDefault(props, "RefreshTokenRotation", engine, null);
|
||||
Boolean enableTokenRevocation = parseBooleanOrNull(resolveOptional(props, "EnableTokenRevocation", engine));
|
||||
|
||||
UserPoolClient client;
|
||||
if (r.getPhysicalId() == null) {
|
||||
client = cognitoService.createUserPoolClient(
|
||||
userPoolId, clientName, generateSecret, allowedOAuthFlowsUserPoolClient,
|
||||
allowedOAuthFlows, allowedOAuthScopes, analyticsConfiguration, callbackURLs,
|
||||
defaultRedirectURI, explicitAuthFlows, accessTokenValidity, idTokenValidity,
|
||||
logoutURLs, preventUserExistenceErrors, readAttributes, refreshTokenValidity,
|
||||
supportedIdentityProviders, tokenValidityUnits, writeAttributes,
|
||||
refreshTokenRotation, enableTokenRevocation);
|
||||
} else {
|
||||
client = cognitoService.updateUserPoolClient(
|
||||
userPoolId, r.getPhysicalId(), clientName, allowedOAuthFlowsUserPoolClient,
|
||||
allowedOAuthFlows, allowedOAuthScopes, analyticsConfiguration, callbackURLs,
|
||||
defaultRedirectURI, explicitAuthFlows, accessTokenValidity, idTokenValidity,
|
||||
logoutURLs, preventUserExistenceErrors, readAttributes, refreshTokenValidity,
|
||||
supportedIdentityProviders, tokenValidityUnits, writeAttributes,
|
||||
refreshTokenRotation, enableTokenRevocation);
|
||||
}
|
||||
|
||||
r.setPhysicalId(client.getClientId());
|
||||
r.getAttributes().put("ClientId", client.getClientId());
|
||||
r.getAttributes().put("ClientName", client.getClientName());
|
||||
if (client.getClientSecret() != null) {
|
||||
r.getAttributes().put("ClientSecret", client.getClientSecret());
|
||||
}
|
||||
}
|
||||
|
||||
private Integer parseIntegerPropOrNull(JsonNode props, String name, CloudFormationTemplateEngine engine) {
|
||||
String value = resolveOptional(props, name, engine);
|
||||
if (value == null || value.isBlank()) {
|
||||
@@ -5873,19 +5768,6 @@ public class CloudFormationResourceProvisioner {
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, String> resolveStringMapOrNull(JsonNode props, String source, CloudFormationTemplateEngine engine) {
|
||||
if (props == null || !props.has(source) || props.get(source).isNull()) {
|
||||
return null;
|
||||
}
|
||||
JsonNode resolved = engine.resolveNode(props.get(source));
|
||||
if (resolved == null || !resolved.isObject()) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> out = new LinkedHashMap<>();
|
||||
resolved.fields().forEachRemaining(e -> out.put(e.getKey(), e.getValue().asText()));
|
||||
return out;
|
||||
}
|
||||
|
||||
// ── Lambda LayerVersion ──────────────────────────────────────────────────
|
||||
//
|
||||
// Without this, layer versions (e.g. CDK's AwsCliLayer) fall through to the stub, so the
|
||||
|
||||
+364
-19
@@ -4,22 +4,39 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.services.cloudformation.model.StackResource;
|
||||
import io.github.hectorvent.floci.services.cognito.CognitoService;
|
||||
import io.github.hectorvent.floci.services.cognito.model.UserPool;
|
||||
import io.github.hectorvent.floci.services.cognito.model.UserPoolClient;
|
||||
import io.github.hectorvent.floci.services.cognito.model.UserPoolDomain;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Provisions {@code AWS::Cognito::UserPoolDomain}. The physical id is the domain name, as in AWS,
|
||||
* and {@code Fn::GetAtt CloudFrontDistribution} is the CloudFront name a custom domain's DNS alias
|
||||
* Provisions the Cognito user pool types.
|
||||
*
|
||||
* <p>{@code AWS::Cognito::UserPool}: the physical id is the pool id, the whole resolved property
|
||||
* set is handed to the service as the API request, and the pool name falls back to a generated one.
|
||||
* {@code Fn::GetAtt ProviderName} has AWS's shape, {@code cognito-idp.<region>.amazonaws.com/<id>},
|
||||
* while {@code ProviderURL} is the issuer of the tokens Floci mints, {@code <base-url>/<id>}.
|
||||
* {@code AWS::Cognito::UserPoolClient}: the physical id is the client id and {@code ClientSecret}
|
||||
* is only an attribute when the client has one, as on AWS. A pool is updated in place. A client is
|
||||
* updated in place unless {@code UserPoolId} or {@code GenerateSecret}, its create-only properties,
|
||||
* changed, in which case a new client is created and the {@link ReplacementCleanup} record deletes
|
||||
* the displaced one once the update commits or restores it on rollback, as CloudFormation does.
|
||||
*
|
||||
* <p>{@code AWS::Cognito::UserPoolDomain}: the physical id is the domain name, as in AWS, and
|
||||
* {@code Fn::GetAtt CloudFrontDistribution} is the CloudFront name a custom domain's DNS alias
|
||||
* points at. A prefix domain has no distribution of its own in Floci, so for one the attribute is
|
||||
* empty rather than the literal {@code LogicalId.CloudFrontDistribution} an unset attribute yields.
|
||||
*
|
||||
* <p>{@code Routing} (regional failover) is accepted and ignored; nothing in the emulator fails
|
||||
* over. {@code AWS::Cognito::UserPool} and {@code UserPoolClient} still live in the legacy switch.
|
||||
* {@code Routing} (regional failover) is accepted and ignored; nothing in the emulator fails over.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class CognitoCfnProvisioner implements CfnResourceProvisioner {
|
||||
@@ -27,6 +44,19 @@ public class CognitoCfnProvisioner implements CfnResourceProvisioner {
|
||||
private static final Logger LOG = Logger.getLogger(CognitoCfnProvisioner.class);
|
||||
private static final String NOT_FOUND = "ResourceNotFoundException";
|
||||
|
||||
private static final String USER_POOL = "AWS::Cognito::UserPool";
|
||||
private static final String USER_POOL_CLIENT = "AWS::Cognito::UserPoolClient";
|
||||
private static final String USER_POOL_DOMAIN = "AWS::Cognito::UserPoolDomain";
|
||||
|
||||
/**
|
||||
* Serialises the existence check and the create of a client whose id is derived from its name.
|
||||
* The service's store write is unconditional and the engine runs stack operations on a thread
|
||||
* pool, so two stacks could otherwise both find the id free and the later create would
|
||||
* overwrite the earlier stack's client. Static so every instance, the CDI bean and the test
|
||||
* fixture's, shares it.
|
||||
*/
|
||||
private static final Object DETERMINISTIC_CLIENT_ID_LOCK = new Object();
|
||||
|
||||
private final CognitoService cognitoService;
|
||||
|
||||
public CognitoCfnProvisioner(CognitoService cognitoService) {
|
||||
@@ -35,11 +65,220 @@ public class CognitoCfnProvisioner implements CfnResourceProvisioner {
|
||||
|
||||
@Override
|
||||
public Set<String> resourceTypes() {
|
||||
return Set.of("AWS::Cognito::UserPoolDomain");
|
||||
return Set.of(USER_POOL, USER_POOL_CLIENT, USER_POOL_DOMAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provision(StackResource r, JsonNode props, ProvisionContext ctx) {
|
||||
switch (r.getResourceType()) {
|
||||
case USER_POOL -> {
|
||||
Map<String, String> attributesBefore = Map.copyOf(r.getAttributes());
|
||||
provisionUserPool(r, props, ctx);
|
||||
ReplacementCleanup.record(r, ctx, attributesBefore);
|
||||
}
|
||||
case USER_POOL_CLIENT -> {
|
||||
Map<String, String> attributesBefore = Map.copyOf(r.getAttributes());
|
||||
provisionUserPoolClient(r, props, ctx);
|
||||
ReplacementCleanup.record(r, ctx, attributesBefore);
|
||||
}
|
||||
// The domain replaces and removes its predecessor within the provision itself, since the
|
||||
// domain name is unique across pools, so it keeps no cleanup record.
|
||||
case USER_POOL_DOMAIN -> provisionUserPoolDomain(r, props, ctx);
|
||||
default -> throw new IllegalStateException("CognitoCfnProvisioner cannot handle " + r.getResourceType());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A user pool domain deletes from the pool recorded at create time, since DeleteUserPoolDomain
|
||||
* needs both; without that record it looks the pool up. The other types delete by id.
|
||||
*/
|
||||
@Override
|
||||
public void delete(StackResource resource, String region) {
|
||||
if (!USER_POOL_DOMAIN.equals(resource.getResourceType())) {
|
||||
delete(resource.getResourceType(), resource.getPhysicalId(), region);
|
||||
return;
|
||||
}
|
||||
String userPoolId = resource.getAttributes() == null ? null : resource.getAttributes().get("UserPoolId");
|
||||
if (userPoolId == null || userPoolId.isBlank()) {
|
||||
delete(resource.getResourceType(), resource.getPhysicalId(), region);
|
||||
return;
|
||||
}
|
||||
deleteDomain(resource.getPhysicalId(), userPoolId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String resourceType, String physicalId, String region) {
|
||||
if (physicalId == null || physicalId.isBlank()) {
|
||||
return;
|
||||
}
|
||||
switch (resourceType) {
|
||||
// Only the service's own not-found code is tolerated. A pool that still has a domain is
|
||||
// refused with InvalidParameterException, and that must fail the stack delete as it does
|
||||
// on AWS; in a stack the domain resource depends on the pool, so it is deleted first.
|
||||
case USER_POOL -> CfnDeletes.safeDelete("user pool", physicalId,
|
||||
() -> cognitoService.deleteUserPool(physicalId), NOT_FOUND);
|
||||
case USER_POOL_CLIENT -> CfnDeletes.safeDelete("user pool client", physicalId,
|
||||
() -> cognitoService.deleteUserPoolClient(physicalId), NOT_FOUND);
|
||||
// Only the domain itself can say which pool owns it here; one already gone needs nothing.
|
||||
case USER_POOL_DOMAIN -> {
|
||||
UserPoolDomain existing = findExisting(physicalId);
|
||||
if (existing != null) {
|
||||
deleteDomain(physicalId, existing.getUserPoolId());
|
||||
}
|
||||
}
|
||||
default -> { }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasReplacementUpdate(StackResource resource) {
|
||||
return ReplacementCleanup.hasReplacement(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateCleanupPhysicalId(StackResource resource) {
|
||||
return ReplacementCleanup.cleanupPhysicalId(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UpdateCleanupResult completeUpdate(StackResource resource) {
|
||||
return ReplacementCleanup.complete(resource, this::delete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearUpdate(StackResource resource) {
|
||||
ReplacementCleanup.clear(resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* A replacement is undone through the cleanup record. Without one the entity was updated in
|
||||
* place, and putting that back needs a snapshot this provisioner does not keep, so the engine
|
||||
* reports it as not rolled back, as it did for the switch.
|
||||
*/
|
||||
@Override
|
||||
public boolean rollbackUpdate(StackResource resource) {
|
||||
return ReplacementCleanup.rollback(resource, this::delete);
|
||||
}
|
||||
|
||||
private void provisionUserPool(StackResource r, JsonNode props, ProvisionContext ctx) {
|
||||
Map<String, Object> req = new HashMap<>();
|
||||
if (props != null) {
|
||||
req.putAll(jsonObjectToMap(ctx.engine().resolveNode(props)));
|
||||
}
|
||||
// UserPoolName is updatable in place. A pool the template does not name keeps the name its
|
||||
// first execution generated: sending a fresh generated name on every update would rename it.
|
||||
String poolName = ctx.resolveOptional(props, "UserPoolName");
|
||||
if (poolName != null && !poolName.isBlank()) {
|
||||
req.put("PoolName", poolName);
|
||||
} else if (!ctx.isUpdate()) {
|
||||
req.put("PoolName", ctx.generatePhysicalName(r.getLogicalId(), 128, false));
|
||||
}
|
||||
|
||||
Map<String, String> tags = resolveUserPoolTags(props, ctx);
|
||||
if (tags != null) {
|
||||
req.put("UserPoolTags", tags);
|
||||
}
|
||||
|
||||
UserPool pool;
|
||||
if (ctx.isUpdate()) {
|
||||
req.put("UserPoolId", ctx.priorPhysicalId());
|
||||
pool = cognitoService.updateUserPool(req, ctx.region());
|
||||
} else {
|
||||
pool = cognitoService.createUserPool(req, ctx.region());
|
||||
}
|
||||
|
||||
r.setPhysicalId(pool.getId());
|
||||
r.getAttributes().put("Arn", pool.getArn());
|
||||
r.getAttributes().put("UserPoolId", pool.getId());
|
||||
// ProviderName is what a template feeds into an identity pool's CognitoIdentityProviders,
|
||||
// cognito-idp.<region>.amazonaws.com/<pool id> on AWS. ProviderURL stays the issuer Floci
|
||||
// mints tokens with, so a template wiring it into a JWT authorizer validates locally.
|
||||
r.getAttributes().put("ProviderName", "cognito-idp." + ctx.region() + ".amazonaws.com/" + pool.getId());
|
||||
r.getAttributes().put("ProviderURL", cognitoService.getIssuer(pool.getId()));
|
||||
}
|
||||
|
||||
private void provisionUserPoolClient(StackResource r, JsonNode props, ProvisionContext ctx) {
|
||||
String userPoolId = ctx.resolveOptional(props, "UserPoolId");
|
||||
if (userPoolId == null || userPoolId.isBlank()) {
|
||||
throw new AwsException("ValidationError", "AWS::Cognito::UserPoolClient requires UserPoolId", 400);
|
||||
}
|
||||
String requestedClientName = ctx.resolveOptional(props, "ClientName");
|
||||
String clientName = requestedClientName == null || requestedClientName.isBlank()
|
||||
? ctx.generatePhysicalName(r.getLogicalId(), 128, false)
|
||||
: requestedClientName;
|
||||
boolean generateSecret = Boolean.parseBoolean(resolveOrDefault(props, "GenerateSecret", ctx, "false"));
|
||||
boolean allowedOAuthFlowsUserPoolClient =
|
||||
Boolean.parseBoolean(resolveOrDefault(props, "AllowedOAuthFlowsUserPoolClient", ctx, "false"));
|
||||
List<String> allowedOAuthFlows = ctx.resolveStringList(props, "AllowedOAuthFlows");
|
||||
List<String> allowedOAuthScopes = ctx.resolveStringList(props, "AllowedOAuthScopes");
|
||||
|
||||
Map<String, Object> analyticsConfiguration = resolveMapOrNull(props, "AnalyticsConfiguration", ctx);
|
||||
List<String> callbackURLs = ctx.resolveStringList(props, "CallbackURLs");
|
||||
String defaultRedirectURI = ctx.resolveOptional(props, "DefaultRedirectURI");
|
||||
List<String> explicitAuthFlows = ctx.resolveStringList(props, "ExplicitAuthFlows");
|
||||
Integer accessTokenValidity = parseInteger(props, "AccessTokenValidity", ctx);
|
||||
Integer idTokenValidity = parseInteger(props, "IdTokenValidity", ctx);
|
||||
List<String> logoutURLs = ctx.resolveStringList(props, "LogoutURLs");
|
||||
String preventUserExistenceErrors = ctx.resolveOptional(props, "PreventUserExistenceErrors");
|
||||
List<String> readAttributes = ctx.resolveStringList(props, "ReadAttributes");
|
||||
Integer refreshTokenValidity = parseInteger(props, "RefreshTokenValidity", ctx);
|
||||
List<String> supportedIdentityProviders = ctx.resolveStringList(props, "SupportedIdentityProviders");
|
||||
Map<String, String> tokenValidityUnits = resolveStringMapOrNull(props, "TokenValidityUnits", ctx);
|
||||
List<String> writeAttributes = ctx.resolveStringList(props, "WriteAttributes");
|
||||
Map<String, Object> refreshTokenRotation = resolveMapOrNull(props, "RefreshTokenRotation", ctx);
|
||||
Boolean enableTokenRevocation = parseBooleanOrNull(ctx.resolveOptional(props, "EnableTokenRevocation"));
|
||||
|
||||
// UserPoolId and GenerateSecret are createOnly in the schema: a change to either replaces
|
||||
// the client, as on AWS, and the service's own update would refuse the pool move anyway,
|
||||
// since a client is only found through the pool that owns it.
|
||||
UserPoolClient prior = ctx.isUpdate() ? findClient(ctx.priorPhysicalId()) : null;
|
||||
UserPoolClient client;
|
||||
if (prior != null && Objects.equals(userPoolId, prior.getUserPoolId())
|
||||
&& generateSecret == prior.isGenerateSecret()) {
|
||||
client = cognitoService.updateUserPoolClient(
|
||||
userPoolId, prior.getClientId(), clientName, allowedOAuthFlowsUserPoolClient,
|
||||
allowedOAuthFlows, allowedOAuthScopes, analyticsConfiguration, callbackURLs,
|
||||
defaultRedirectURI, explicitAuthFlows, accessTokenValidity, idTokenValidity,
|
||||
logoutURLs, preventUserExistenceErrors, readAttributes, refreshTokenValidity,
|
||||
supportedIdentityProviders, tokenValidityUnits, writeAttributes,
|
||||
refreshTokenRotation, enableTokenRevocation);
|
||||
} else {
|
||||
Supplier<UserPoolClient> create = () -> cognitoService.createUserPoolClient(
|
||||
userPoolId, clientName, generateSecret, allowedOAuthFlowsUserPoolClient,
|
||||
allowedOAuthFlows, allowedOAuthScopes, analyticsConfiguration, callbackURLs,
|
||||
defaultRedirectURI, explicitAuthFlows, accessTokenValidity, idTokenValidity,
|
||||
logoutURLs, preventUserExistenceErrors, readAttributes, refreshTokenValidity,
|
||||
supportedIdentityProviders, tokenValidityUnits, writeAttributes,
|
||||
refreshTokenRotation, enableTokenRevocation);
|
||||
// AWS client ids are random, so a create never collides with an existing client. Under
|
||||
// Floci's floci:override-cognito-client-id tag the id follows the name, and the store
|
||||
// would overwrite whichever client already holds it, the one being replaced or any
|
||||
// other, with no way back; so the create is refused before anything changes, and the
|
||||
// check and the create happen under one lock so a concurrent stack cannot slip between.
|
||||
String derivedId = cognitoService.deterministicClientIdFor(userPoolId, clientName);
|
||||
if (derivedId == null) {
|
||||
client = create.get();
|
||||
} else {
|
||||
synchronized (DETERMINISTIC_CLIENT_ID_LOCK) {
|
||||
refuseIfALiveClientHolds(derivedId);
|
||||
client = create.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
r.setPhysicalId(client.getClientId());
|
||||
r.getAttributes().put("ClientId", client.getClientId());
|
||||
r.getAttributes().put("Name", client.getClientName());
|
||||
// The engine hands an update the prior attributes, so a replacement without a secret must
|
||||
// drop the displaced client's, or Fn::GetAtt ClientSecret keeps serving it.
|
||||
if (client.getClientSecret() != null) {
|
||||
r.getAttributes().put("ClientSecret", client.getClientSecret());
|
||||
} else {
|
||||
r.getAttributes().remove("ClientSecret");
|
||||
}
|
||||
}
|
||||
|
||||
private void provisionUserPoolDomain(StackResource r, JsonNode props, ProvisionContext ctx) {
|
||||
String domain = ctx.resolveOptional(props, "Domain");
|
||||
String userPoolId = ctx.resolveOptional(props, "UserPoolId");
|
||||
if (domain == null || domain.isBlank() || userPoolId == null || userPoolId.isBlank()) {
|
||||
@@ -71,23 +310,40 @@ public class CognitoCfnProvisioner implements CfnResourceProvisioner {
|
||||
provisioned.getCloudFrontDistribution() == null ? "" : provisioned.getCloudFrontDistribution());
|
||||
}
|
||||
|
||||
/** Deletes the domain from the pool recorded at create time; without that record, looks the pool up. */
|
||||
@Override
|
||||
public void delete(StackResource resource, String region) {
|
||||
String userPoolId = resource.getAttributes() == null ? null : resource.getAttributes().get("UserPoolId");
|
||||
if (userPoolId == null || userPoolId.isBlank()) {
|
||||
delete(resource.getResourceType(), resource.getPhysicalId(), region);
|
||||
/**
|
||||
* A record whose pool no longer exists is an orphan of a deleted pool (the pool delete does not
|
||||
* cascade to clients yet, see #2949), not a live client: the create may take its id over.
|
||||
*/
|
||||
private void refuseIfALiveClientHolds(String derivedId) {
|
||||
UserPoolClient holder = findClient(derivedId);
|
||||
if (holder == null) {
|
||||
return;
|
||||
}
|
||||
deleteDomain(resource.getPhysicalId(), userPoolId);
|
||||
try {
|
||||
cognitoService.describeUserPool(holder.getUserPoolId());
|
||||
} catch (AwsException e) {
|
||||
if (!NOT_FOUND.equals(e.getErrorCode())) {
|
||||
throw e;
|
||||
}
|
||||
LOG.debugv("User pool client {0} belongs to deleted pool {1}; treating the record as stale",
|
||||
derivedId, holder.getUserPoolId());
|
||||
return;
|
||||
}
|
||||
throw new AwsException("ValidationError", "User pool client id " + derivedId
|
||||
+ ", derived from ClientName under the pool's floci:override-cognito-client-id override,"
|
||||
+ " already belongs to an existing client; give the client a different ClientName"
|
||||
+ " or remove the override.", 400);
|
||||
}
|
||||
|
||||
/** Only the domain itself can say which pool owns it here; one that is already gone needs nothing. */
|
||||
@Override
|
||||
public void delete(String resourceType, String physicalId, String region) {
|
||||
UserPoolDomain existing = findExisting(physicalId);
|
||||
if (existing != null) {
|
||||
deleteDomain(physicalId, existing.getUserPoolId());
|
||||
private UserPoolClient findClient(String clientId) {
|
||||
try {
|
||||
return cognitoService.describeUserPoolClient(clientId);
|
||||
} catch (AwsException e) {
|
||||
if (!NOT_FOUND.equals(e.getErrorCode())) {
|
||||
throw e;
|
||||
}
|
||||
LOG.debugv("User pool client {0} does not exist", clientId);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +364,23 @@ public class CognitoCfnProvisioner implements CfnResourceProvisioner {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* UserPoolTags is a map in the schema (the type's tagProperty), not the Key/Value list most types
|
||||
* carry, so it is resolved as one; through the raw property map a numeric tag value would reach
|
||||
* the service as a number. The list shape, which hand-written templates sometimes use and which
|
||||
* the switch accepted, is still taken.
|
||||
*/
|
||||
private static Map<String, String> resolveUserPoolTags(JsonNode props, ProvisionContext ctx) {
|
||||
if (props == null || !props.has("UserPoolTags") || props.get("UserPoolTags").isNull()) {
|
||||
return null;
|
||||
}
|
||||
JsonNode resolved = ctx.engine().resolveNode(props.get("UserPoolTags"));
|
||||
if (resolved != null && resolved.isArray()) {
|
||||
return ctx.resolveTags(props, "UserPoolTags");
|
||||
}
|
||||
return resolveStringMapOrNull(props, "UserPoolTags", ctx);
|
||||
}
|
||||
|
||||
private static Map<String, Object> resolveCustomDomainConfig(JsonNode props, ProvisionContext ctx) {
|
||||
if (props == null || !props.hasNonNull("CustomDomainConfig")) {
|
||||
return null;
|
||||
@@ -138,4 +411,76 @@ public class CognitoCfnProvisioner implements CfnResourceProvisioner {
|
||||
"AWS::Cognito::UserPoolDomain ManagedLoginVersion must be an integer, got: " + value, e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String resolveOrDefault(JsonNode props, String name, ProvisionContext ctx, String defaultValue) {
|
||||
String value = ctx.resolveOptional(props, name);
|
||||
return (value != null && !value.isBlank()) ? value : defaultValue;
|
||||
}
|
||||
|
||||
private static Integer parseInteger(JsonNode props, String name, ProvisionContext ctx) {
|
||||
String value = ctx.resolveOptional(props, name);
|
||||
if (value == null || value.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Integer.valueOf(value.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
throw new AwsException("ValidationError", "Value of property " + name + " must be an integer.", 400);
|
||||
}
|
||||
}
|
||||
|
||||
private static Boolean parseBooleanOrNull(String value) {
|
||||
return (value == null || value.isBlank()) ? null : Boolean.valueOf(value);
|
||||
}
|
||||
|
||||
private static Map<String, Object> resolveMapOrNull(JsonNode props, String name, ProvisionContext ctx) {
|
||||
if (props == null || !props.has(name) || props.get(name).isNull()) {
|
||||
return null;
|
||||
}
|
||||
JsonNode resolved = ctx.engine().resolveNode(props.get(name));
|
||||
return resolved != null && resolved.isObject() ? jsonObjectToMap(resolved) : null;
|
||||
}
|
||||
|
||||
private static Map<String, String> resolveStringMapOrNull(JsonNode props, String name, ProvisionContext ctx) {
|
||||
if (props == null || !props.has(name) || props.get(name).isNull()) {
|
||||
return null;
|
||||
}
|
||||
JsonNode resolved = ctx.engine().resolveNode(props.get(name));
|
||||
if (resolved == null || !resolved.isObject()) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> out = new LinkedHashMap<>();
|
||||
resolved.fields().forEachRemaining(e -> out.put(e.getKey(), e.getValue().asText()));
|
||||
return out;
|
||||
}
|
||||
|
||||
private static Map<String, Object> jsonObjectToMap(JsonNode node) {
|
||||
Map<String, Object> out = new LinkedHashMap<>();
|
||||
node.fields().forEachRemaining(e -> out.put(e.getKey(), jsonNodeToValue(e.getValue())));
|
||||
return out;
|
||||
}
|
||||
|
||||
private static Object jsonNodeToValue(JsonNode node) {
|
||||
if (node == null || node.isNull()) {
|
||||
return null;
|
||||
}
|
||||
if (node.isObject()) {
|
||||
return jsonObjectToMap(node);
|
||||
}
|
||||
if (node.isArray()) {
|
||||
List<Object> values = new ArrayList<>();
|
||||
node.forEach(v -> values.add(jsonNodeToValue(v)));
|
||||
return values;
|
||||
}
|
||||
if (node.isBoolean()) {
|
||||
return node.asBoolean();
|
||||
}
|
||||
if (node.isIntegralNumber()) {
|
||||
return node.asLong();
|
||||
}
|
||||
if (node.isFloatingPointNumber()) {
|
||||
return node.asDouble();
|
||||
}
|
||||
return node.asText();
|
||||
}
|
||||
}
|
||||
@@ -255,6 +255,9 @@ public class CognitoService implements ResourceProvider {
|
||||
UserPool updatedPool = MAPPER.convertValue(pool, UserPool.class);
|
||||
|
||||
populateUserPool(updatedPool, request);
|
||||
if (request.get("PoolName") instanceof String poolName && !poolName.isBlank()) {
|
||||
updatedPool.setName(poolName);
|
||||
}
|
||||
|
||||
updatedPool.setLastModifiedDate(System.currentTimeMillis() / 1000L);
|
||||
poolStore.put(id, updatedPool);
|
||||
@@ -572,7 +575,7 @@ public class CognitoService implements ResourceProvider {
|
||||
Boolean enableTokenRevocation) {
|
||||
|
||||
UserPool userPool = describeUserPool(userPoolId);
|
||||
String clientId = UUID.randomUUID().toString().replace("-", "").substring(0, 26);
|
||||
String clientId = clientIdFor(userPool, clientName);
|
||||
List<String> normalizedAllowedOAuthFlows = normalizeStringList(allowedOAuthFlows);
|
||||
List<String> normalizedAllowedOAuthScopes = normalizeStringList(allowedOAuthScopes);
|
||||
List<String> normalizedCallbackUrls = normalizeStringList(callbackURLs);
|
||||
@@ -599,15 +602,6 @@ public class CognitoService implements ResourceProvider {
|
||||
);
|
||||
|
||||
UserPoolClient client = new UserPoolClient();
|
||||
if (userPool.getClientIdOverride() != null) {
|
||||
if (userPool.getClientIdOverride().equalsIgnoreCase("use-name")) {
|
||||
clientId = clientName;
|
||||
} else if (userPool.getClientIdOverride().startsWith("append-to-name:")) {
|
||||
clientId = clientName + userPool.getClientIdOverride().substring(15);
|
||||
} else if (userPool.getClientIdOverride().startsWith("prepend-to-name:")) {
|
||||
clientId = userPool.getClientIdOverride().substring(16) + clientName;
|
||||
}
|
||||
}
|
||||
client.setClientId(clientId);
|
||||
client.setUserPoolId(userPoolId);
|
||||
client.setClientName(clientName);
|
||||
@@ -657,14 +651,43 @@ public class CognitoService implements ResourceProvider {
|
||||
}
|
||||
|
||||
public UserPoolClient describeUserPoolClient(String userPoolId, String clientId) {
|
||||
UserPoolClient client = clientStore.get(clientId)
|
||||
.orElseThrow(() -> new AwsException("ResourceNotFoundException", "User pool client not found", 400));
|
||||
UserPoolClient client = describeUserPoolClient(clientId);
|
||||
if (!client.getUserPoolId().equals(userPoolId)) {
|
||||
throw new AwsException("ResourceNotFoundException", "User pool client not found", 400);
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
/**
|
||||
* The id a client created now with this name in this pool would get: derived from the name when
|
||||
* the pool carries the {@code floci:override-cognito-client-id} tag, otherwise null because it
|
||||
* would be random. Lets a caller that must not overwrite an existing client check first.
|
||||
*/
|
||||
public String deterministicClientIdFor(String userPoolId, String clientName) {
|
||||
UserPool userPool = describeUserPool(userPoolId);
|
||||
return userPool.getClientIdOverride() == null ? null : clientIdFor(userPool, clientName);
|
||||
}
|
||||
|
||||
private static String clientIdFor(UserPool userPool, String clientName) {
|
||||
String override = userPool.getClientIdOverride();
|
||||
if (override != null) {
|
||||
if (override.equalsIgnoreCase("use-name")) {
|
||||
return clientName;
|
||||
} else if (override.startsWith("append-to-name:")) {
|
||||
return clientName + override.substring(15);
|
||||
} else if (override.startsWith("prepend-to-name:")) {
|
||||
return override.substring(16) + clientName;
|
||||
}
|
||||
}
|
||||
return UUID.randomUUID().toString().replace("-", "").substring(0, 26);
|
||||
}
|
||||
|
||||
/** By id alone, for callers that hold only the client id, such as a CloudFormation stack resource. */
|
||||
public UserPoolClient describeUserPoolClient(String clientId) {
|
||||
return clientStore.get(clientId)
|
||||
.orElseThrow(() -> new AwsException("ResourceNotFoundException", "User pool client not found", 400));
|
||||
}
|
||||
|
||||
public List<UserPoolClient> listUserPoolClients(String userPoolId) {
|
||||
describeUserPool(userPoolId);
|
||||
return clientStore.scan(k -> clientStore.get(k).map(c -> c.getUserPoolId().equals(userPoolId)).orElse(false));
|
||||
|
||||
Reference in new issue
Block a user