Tech debt (#3653)
This commit is contained in:
parent
81859f9180
commit
737636f9df
20 changed files with 11 additions and 57 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue