pool domain should always return a domain (#3707)
* pool domain should always return a domain Refs https://github.com/spulec/moto/issues/3706 * set character encoding * test CloudFrontDomain exists on pool domain * describe pool domain does not return cloudfront domain
This commit is contained in:
parent
2000f6654f
commit
d07e287b37
@ -195,7 +195,8 @@ class CognitoIdpUserPoolDomain(BaseModel):
|
||||
self.custom_domain_config["CertificateArn"].encode("utf-8")
|
||||
).hexdigest()
|
||||
return "{hash}.cloudfront.net".format(hash=hash[:16])
|
||||
return None
|
||||
hash = hashlib.md5(self.user_pool_id.encode("utf-8")).hexdigest()
|
||||
return "{hash}.amazoncognito.com".format(hash=hash[:16])
|
||||
|
||||
def to_json(self, extended=True):
|
||||
distribution = self._distribution_name()
|
||||
|
@ -137,6 +137,7 @@ def test_create_user_pool_domain():
|
||||
user_pool_id = conn.create_user_pool(PoolName=str(uuid.uuid4()))["UserPool"]["Id"]
|
||||
result = conn.create_user_pool_domain(UserPoolId=user_pool_id, Domain=domain)
|
||||
result["ResponseMetadata"]["HTTPStatusCode"].should.equal(200)
|
||||
result["CloudFrontDomain"].should_not.be.none
|
||||
|
||||
|
||||
@mock_cognitoidp
|
||||
|
Loading…
x
Reference in New Issue
Block a user