-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: George J Padayatti <[email protected]>
- Loading branch information
1 parent
ae2fe99
commit 0bb0fb4
Showing
8 changed files
with
199 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from aries_cloudagent.messaging.base_handler import ( | ||
BaseHandler, | ||
BaseResponder, | ||
RequestContext, | ||
) | ||
from dexa_protocol.v1_0.messages.pulldata_request_message import PullDataRequestMessage | ||
from dexa_sdk.managers.dexa_manager import DexaManager | ||
|
||
|
||
class PullDataRequestMessageHandler(BaseHandler): | ||
async def handle(self, context: RequestContext, responder: BaseResponder): | ||
|
||
assert isinstance(context.message, PullDataRequestMessage) | ||
|
||
# Initialise the manager | ||
mgr = DexaManager(context) | ||
|
||
# Process message. | ||
await mgr.process_pulldata_request_message( | ||
context.message, context.message_receipt | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from aries_cloudagent.messaging.base_handler import ( | ||
BaseHandler, | ||
BaseResponder, | ||
RequestContext, | ||
) | ||
from dexa_protocol.v1_0.messages.pulldata_response_message import ( | ||
PullDataResponseMessage, | ||
) | ||
from dexa_sdk.managers.dexa_manager import DexaManager | ||
|
||
|
||
class PullDataResponseMessageHandler(BaseHandler): | ||
async def handle(self, context: RequestContext, responder: BaseResponder): | ||
|
||
assert isinstance(context.message, PullDataResponseMessage) | ||
|
||
# Initialise the manager | ||
mgr = DexaManager(context) | ||
|
||
# Process message. | ||
await mgr.process_pull_data_response_message( | ||
context.message, context.message_receipt | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from aries_cloudagent.messaging.agent_message import AgentMessage, AgentMessageSchema | ||
from dexa_protocol.v1_0.message_types import PROTOCOL_PACKAGE, PULLDATA_REQUEST | ||
from marshmallow import EXCLUDE, fields | ||
|
||
HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.pulldata_request_handler.PullDataRequestMessageHandler" | ||
|
||
|
||
class PullDataRequestMessage(AgentMessage): | ||
class Meta: | ||
handler_class = HANDLER_CLASS | ||
message_type = PULLDATA_REQUEST | ||
schema_class = "PullDataRequestMessageSchema" | ||
|
||
def __init__(self, *, dda_instance_id: str = None, nonce: str = None, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
self.dda_instance_id = dda_instance_id | ||
self.nonce = nonce | ||
|
||
|
||
class PullDataRequestMessageSchema(AgentMessageSchema): | ||
class Meta: | ||
model_class = PullDataRequestMessage | ||
|
||
# Unknown fields are excluded. | ||
unknown = EXCLUDE | ||
|
||
dda_instance_id = fields.Str(required=False) | ||
nonce = fields.Str(required=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from aries_cloudagent.messaging.agent_message import AgentMessage, AgentMessageSchema | ||
from dexa_protocol.v1_0.message_types import PROTOCOL_PACKAGE, PULLDATA_RESPONSE | ||
from marshmallow import EXCLUDE, fields | ||
|
||
HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers.pulldata_response_handler.PullDataResponseMessageHandler" | ||
|
||
|
||
class PullDataResponseMessage(AgentMessage): | ||
class Meta: | ||
handler_class = HANDLER_CLASS | ||
message_type = PULLDATA_RESPONSE | ||
schema_class = "PullDataResponseMessageSchema" | ||
|
||
def __init__(self, *, ds_eth_address: str = None, nonce: str = None, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
self.ds_eth_address = ds_eth_address | ||
self.nonce = nonce | ||
|
||
|
||
class PullDataResponseMessageSchema(AgentMessageSchema): | ||
class Meta: | ||
model_class = PullDataResponseMessage | ||
|
||
# Unknown fields are excluded. | ||
unknown = EXCLUDE | ||
|
||
ds_eth_address = fields.Str(required=False) | ||
nonce = fields.Str(required=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters