This commit is contained in:
Bert Blommers 2021-02-02 16:31:26 +00:00 committed by GitHub
commit 737636f9df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 11 additions and 57 deletions

View file

@ -699,28 +699,7 @@ class CognitoIdpBackend(BaseBackend):
if not client:
raise ResourceNotFoundError(client_id)
if auth_flow == "ADMIN_NO_SRP_AUTH":
username = auth_parameters.get("USERNAME")
password = auth_parameters.get("PASSWORD")
user = user_pool.users.get(username)
if not user:
raise UserNotFoundError(username)
if user.password != password:
raise NotAuthorizedError(username)
if user.status == UserStatus["FORCE_CHANGE_PASSWORD"]:
session = str(uuid.uuid4())
self.sessions[session] = user_pool
return {
"ChallengeName": "NEW_PASSWORD_REQUIRED",
"ChallengeParameters": {},
"Session": session,
}
return self._log_user_in(user_pool, client, username)
elif auth_flow == "ADMIN_USER_PASSWORD_AUTH":
if auth_flow in ("ADMIN_USER_PASSWORD_AUTH", "ADMIN_NO_SRP_AUTH"):
username = auth_parameters.get("USERNAME")
password = auth_parameters.get("PASSWORD")
user = user_pool.users.get(username)

View file

@ -580,9 +580,7 @@ class SageMakerModelBackend(BaseBackend):
message = "Could not find model '{}'.".format(
Model.arn_for_model_name(model_name, self.region_name)
)
raise RESTError(
error_type="ValidationException", message=message, template="error_json",
)
raise ValidationError(message=message)
def list_models(self):
models = []