diff --git a/eudi_wallet/ebsi/entry_points/server/routes/v2/config.py b/eudi_wallet/ebsi/entry_points/server/routes/v2/config.py index 0863c29..34490ea 100644 --- a/eudi_wallet/ebsi/entry_points/server/routes/v2/config.py +++ b/eudi_wallet/ebsi/entry_points/server/routes/v2/config.py @@ -68,9 +68,11 @@ ) from eudi_wallet.ebsi.usecases.v2.organisation.read_verification_request_usecase import ( ReadVerificationRequestUsecase, + ReadVerificationRequestUsecaseError ) from eudi_wallet.ebsi.usecases.v2.organisation.delete_verification_request_usecase import ( DeleteVerificationRequestUsecase, + DeleteVerificationRequestUsecaseError ) from eudi_wallet.ebsi.usecases.v2.organisation.list_verification_request_usecase import ( @@ -788,6 +790,7 @@ async def handle_post_create_verification_request( organisation_id=organisation_id, presentation_definition=request_body.presentationDefinition, requestByReference=request_body.requestByReference, + webhook_url=context.legal_entity_service.legal_entity_entity.webhook_url ) return web.json_response(verification_record.to_dict()) except ValidationError as e: @@ -829,6 +832,8 @@ async def handle_get_read_verification_history( verification_record_id=verification_record_id ) return web.json_response(verification_record.to_dict()) + except ReadVerificationRequestUsecaseError as e: + raise web.HTTPBadRequest(reason=str(e)) except ValidationError as e: raise web.HTTPBadRequest(reason=json.dumps(e.errors())) except PresentationDefinitionValidationError as e: @@ -864,14 +869,13 @@ async def handle_delete_verification_history( logger=context.app_context.logger, ) - is_deleted = usecase.execute( + usecase.execute( organisation_id=organisation_id, verification_record_id=verification_record_id, ) - if is_deleted: - return web.json_response(status=204) - else: - return web.json_response(status=400) + return web.json_response(status=204) + except DeleteVerificationRequestUsecaseError as e: + raise web.HTTPBadRequest(reason=str(e)) except ValidationError as e: raise web.HTTPBadRequest(reason=json.dumps(e.errors())) except PresentationDefinitionValidationError as e: diff --git a/eudi_wallet/ebsi/entry_points/server/routes/v2/service.py b/eudi_wallet/ebsi/entry_points/server/routes/v2/service.py index 3c0b1bb..75f62b8 100644 --- a/eudi_wallet/ebsi/entry_points/server/routes/v2/service.py +++ b/eudi_wallet/ebsi/entry_points/server/routes/v2/service.py @@ -71,7 +71,7 @@ async def handle_get_credential_record_by_reference( @service_routes.get( - "/organisation/{organisationId}/service/verification-request/{verification_record_id}", + "/organisation/{organisationId}/service/verification/{verification_record_id}", name="handle_get_verification_request_by_reference", ) @v2_inject_request_context() @@ -101,6 +101,7 @@ async def handle_get_verification_request_by_reference( verification_record = usecase.execute( verification_record_id=verification_record_id, + webhook_url=context.legal_entity_service.legal_entity_entity.webhook_url ) return web.Response( text=verification_record.vp_token_request, content_type="application/jwt" @@ -288,6 +289,7 @@ async def handle_service_post_direct_post(request: Request, context: V2RequestCo id_token_response_req.presentation_submission ) }, + webhook_url=context.legal_entity_service.legal_entity_entity.webhook_url ) return web.json_response(verification_record.to_dict()) diff --git a/eudi_wallet/ebsi/usecases/v2/organisation/create_verification_request_usecase.py b/eudi_wallet/ebsi/usecases/v2/organisation/create_verification_request_usecase.py index 4e2e1e3..751b73f 100644 --- a/eudi_wallet/ebsi/usecases/v2/organisation/create_verification_request_usecase.py +++ b/eudi_wallet/ebsi/usecases/v2/organisation/create_verification_request_usecase.py @@ -103,7 +103,7 @@ def execute( if requestByReference: encoded_params = urllib.parse.urlencode( { - "request_uri": f"{domain}/organisation/{organisation_id}/service/verification-request/{verification_record_id}", + "request_uri": f"{domain}/organisation/{organisation_id}/service/verification/{verification_record_id}", } ) else: @@ -113,7 +113,7 @@ def execute( "response_type": response_type, "scope": scope, "redirect_uri": redirect_uri, - "request_uri": f"{domain}/organisation/{organisation_id}/service/verification-request/{verification_record_id}", + "request_uri": f"{domain}/organisation/{organisation_id}/service/verification/{verification_record_id}", "response_mode": response_mode, "state": state, "nonce": nonce, diff --git a/eudi_wallet/ebsi/usecases/v2/organisation/delete_verification_request_usecase.py b/eudi_wallet/ebsi/usecases/v2/organisation/delete_verification_request_usecase.py index c17ddd5..a12bc08 100644 --- a/eudi_wallet/ebsi/usecases/v2/organisation/delete_verification_request_usecase.py +++ b/eudi_wallet/ebsi/usecases/v2/organisation/delete_verification_request_usecase.py @@ -29,6 +29,6 @@ def execute( ) if not is_deleted: raise DeleteVerificationRequestUsecaseError( - "Verification record is not deleted" + "Verification record is not found" ) return is_deleted