From 472d742db2d7d4ad1356790cf38b0be374277777 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 6 Jul 2023 12:54:18 +0200 Subject: [PATCH] allow verify dpp --- ereuse_devicehub/modules/did/views.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ereuse_devicehub/modules/did/views.py b/ereuse_devicehub/modules/did/views.py index 4f7bf757..b88685a8 100644 --- a/ereuse_devicehub/modules/did/views.py +++ b/ereuse_devicehub/modules/did/views.py @@ -1,5 +1,3 @@ -import json - import flask from ereuseapi.methods import API from flask import Blueprint @@ -161,13 +159,14 @@ class DidView(View): def get_result(self): data = { - 'hardware': {}, + 'document': {}, 'dpp': self.id_dpp, + 'algorithm': "sha3_256", } result = {'data': data} if self.dpp: - data['hardware'] = json.loads(self.dpp.snapshot.json_hw) + data['document'] = self.dpp.snapshot.json_hw last_dpp = self.get_last_dpp() url_last = '' if last_dpp: @@ -179,7 +178,11 @@ class DidView(View): dpps = [] for d in self.device.dpps: - rr = {'dpp': d.key, 'hardware': json.loads(d.snapshot.json_hw)} + rr = { + 'dpp': d.key, + 'document': d.snapshot.json_hw, + 'algorithm': "sha3_256", + } dpps.append(rr) return {'data': dpps}