Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move infra for v2 to the v2 folder, removing unused lambda hand… #712

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions api/aws_lambdas/submit_passport/submit_passport.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,3 @@ def _handler(event, _context, request, user_account, body):
def handler(*args, **kwargs):
close_old_connections()
return _handler(*args, **kwargs)


@with_api_request_exception_handling
def _handler_get_score(event, _context, request, user_account, body):
path = event.get("path", "").split("/")

if len(path) != 6:
raise InvalidRequest(f"Invalid path: '{path}'")

scorer_id = path[3]
address = path[5]

logger.info(f"path: '%s', scorer_id: '%s', address: %s", path, scorer_id, address)

# unquote(event.get("queryStringParameters", {}).get("model_list", ""))

score = async_to_sync(ahandle_submit_passport)(
SubmitPassportPayload(
scorer_id=scorer_id,
address=address,
),
user_account,
)

return score


def handler_get_score(*args, **kwargs):
"""
This handles the new GET request for the score, that also implies doing the same score
calculation as on the previous POST `submit-passport` request
"""

close_old_connections()
return _handler_get_score(*args, **kwargs)
Loading
Loading