Skip to content

Commit

Permalink
updates to verifier with ecr schema verification (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: 2byrds <[email protected]>
  • Loading branch information
2byrds authored Oct 22, 2024
1 parent 266320d commit 557becb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/regps/app/fastapi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ async def login(response: Response, data: LoginRequest):
try:
logger.info(f"Login: sending login cred {str(data)[:50]}...")
resp = api_controller.login(data.said, data.vlei)
lei = resp.get("lei")
aid = resp.get("aid")
reports_db.register_aid(aid, lei)
return JSONResponse(status_code=202, content=resp)
except VerifierServiceException as e:
logger.error(f"Login: Exception: {e}")
Expand Down Expand Up @@ -86,6 +83,9 @@ async def check_login_route(
try:
logger.info(f"CheckLogin: sending aid {aid}")
resp = api_controller.check_login(aid)
lei = resp.get("lei")
aid = resp.get("aid")
reports_db.register_aid(aid, lei)
return JSONResponse(status_code=200, content=resp)
except VerifierServiceException as e:
logger.error(f"CheckLogin: Exception: {e}")
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def test_ends():

result = client.get(f"/checklogin/{AID}", headers=headers)
assert result.status_code == 200
assert result.text == '{"aid":"EP4kdoVrDh4Mpzh2QbocUYIv4IjLZLDU367UO0b40f6x","said":"EElnd1DKvcDzzh7u7jBjsg2X9WgdQQuhgiu80i2VR-gk","lei":"875500ELOZEL05BVXV37","msg":"AID EP4kdoVrDh4Mpzh2QbocUYIv4IjLZLDU367UO0b40f6x w/ lei 875500ELOZEL05BVXV37 presented valid credential"}'

result = client.get(f"/upload/{AID}/{DIG}", headers=headers)
assert result.status_code == 401 # fail because this signature should not verify

0 comments on commit 557becb

Please sign in to comment.