From 3e97507fac22df24ecfd8f5a5dc7953a4ac7e1ed Mon Sep 17 00:00:00 2001 From: Krzosa Date: Fri, 16 Apr 2021 10:19:01 +0200 Subject: [PATCH 1/3] /get_from no longer returns payload in python format --- aries_cloudagent/pdstorage_thcf/own_your_data.py | 4 ++-- aries_cloudagent/pdstorage_thcf/routes.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aries_cloudagent/pdstorage_thcf/own_your_data.py b/aries_cloudagent/pdstorage_thcf/own_your_data.py index 591d9dfc84..fcc8005ecf 100644 --- a/aries_cloudagent/pdstorage_thcf/own_your_data.py +++ b/aries_cloudagent/pdstorage_thcf/own_your_data.py @@ -10,7 +10,7 @@ from aiohttp import ClientSession, ClientConnectionError, ClientError from aries_cloudagent.aathcf.credentials import assert_type, assert_type_or import time -from collections import OrderedDict + LOGGER = logging.getLogger(__name__) @@ -163,7 +163,7 @@ async def load(self, dri: str) -> dict: url, headers={"Authorization": "Bearer " + self.token["access_token"]} ) result = await unpack_response(result) - result_dict: dict = json.loads(result, object_pairs_hook=OrderedDict) + result_dict: dict = json.loads(result) return result_dict diff --git a/aries_cloudagent/pdstorage_thcf/routes.py b/aries_cloudagent/pdstorage_thcf/routes.py index 877724659b..118b583270 100644 --- a/aries_cloudagent/pdstorage_thcf/routes.py +++ b/aries_cloudagent/pdstorage_thcf/routes.py @@ -24,6 +24,7 @@ OCA_DATA_CHUNKS = "tda.oca_chunks" + class SaveRecordSchema(Schema): payload = fields.Str(required=True) @@ -193,7 +194,6 @@ async def get_settings(request: web.BaseRequest): try: saved_pds = await SavedPDS.query(context) assert isinstance(saved_pds, list), f"not list {saved_pds}, {type(saved_pds)}" - print("get_settings saved_pds:", saved_pds) except StorageError as err: raise web.HTTPInternalServerError(reason=err.roll_up) From 1bc31ce1fca592a4a8d4b3ab50f70ef0fc6db965 Mon Sep 17 00:00:00 2001 From: Krzosa Date: Fri, 16 Apr 2021 13:10:37 +0200 Subject: [PATCH 2/3] Add /pds/save debug ability to specify oca_schema_dri --- aries_cloudagent/issuer/pds.py | 4 +++- aries_cloudagent/pdstorage_thcf/routes.py | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/aries_cloudagent/issuer/pds.py b/aries_cloudagent/issuer/pds.py index 79ee4c44ee..0f7c1430a9 100644 --- a/aries_cloudagent/issuer/pds.py +++ b/aries_cloudagent/issuer/pds.py @@ -133,7 +133,9 @@ async def create_credential( revoc_reg_id: str = None, tails_file_path: str = None, ) -> Tuple[str, str]: - credential = await self.create_credential_ex(credential_values, schema.get("credential_type")) + credential = await self.create_credential_ex( + credential_values, schema.get("credential_type") + ) return [credential, None] async def create_credential_ex( diff --git a/aries_cloudagent/pdstorage_thcf/routes.py b/aries_cloudagent/pdstorage_thcf/routes.py index 118b583270..bf7e7605c8 100644 --- a/aries_cloudagent/pdstorage_thcf/routes.py +++ b/aries_cloudagent/pdstorage_thcf/routes.py @@ -12,7 +12,7 @@ from marshmallow import fields, validate, Schema from .base import BasePDS -from .api import pds_load, pds_save, load_multiple +from .api import pds_load, pds_save, pds_save_a, load_multiple from .error import PDSError from ..connections.models.connection_record import ConnectionRecord from ..wallet.error import WalletError @@ -27,6 +27,7 @@ class SaveRecordSchema(Schema): payload = fields.Str(required=True) + oca_schema_dri = fields.Str(required=False) class SetActiveStorageTypeSchema(Schema): @@ -57,7 +58,9 @@ async def save_record(request: web.BaseRequest): body = await request.json() try: - payload_id = await pds_save(context, body.get("payload")) + payload_id = await pds_save_a( + context, body.get("payload"), table=body.get("oca_schema_dri") + ) except PDSError as err: raise web.HTTPInternalServerError(reason=err.roll_up) From fa57fb98c503814d547eaafffd7a7b8e1ae2b6f9 Mon Sep 17 00:00:00 2001 From: Krzosa Date: Fri, 16 Apr 2021 14:19:18 +0200 Subject: [PATCH 3/3] Update services plugin --- aries-services-plugin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aries-services-plugin b/aries-services-plugin index bd8cfdac4e..f19b50ef1d 160000 --- a/aries-services-plugin +++ b/aries-services-plugin @@ -1 +1 @@ -Subproject commit bd8cfdac4e4538b86e1c5a17f32f708770a703d5 +Subproject commit f19b50ef1d35fac68bdaabecd11c46c59876d942