Commit 45b4a28b authored by Jiahang Chen's avatar Jiahang Chen
Browse files

fix s3i messages problem

parent cb1cbc9a
Pipeline #377821 passed with stages
in 1 minute and 2 seconds
......@@ -112,7 +112,7 @@ def prepare_service_request():
parameter = {"name": name}
serv_req.fillServiceRequest(
senderUUID=hmi_cred.get("identifier"), receiverUUID=[receiver], sender_endpoint=hmi_endpoint,
senderUUID=hmi_cred.get("identifier"), receiverUUIDs=[receiver], sender_endpoint=hmi_endpoint,
serviceType="{}/{}".format(class_name, method),
parameters=parameter,
msgUUID="s3i:{}".format(uuid.uuid4())
......@@ -132,7 +132,7 @@ def prepare_get_value_request():
"attributes/features/ml40::Composite/targets/ml40::Engine/features/ml40::RotationalSpeed"
"/rpm]")
getv_req.fillGetValueRequest(
senderUUID=hmi_cred.get("identifier"), receiverUUID=[receiver], sender_endpoint=hmi_endpoint,
senderUUID=hmi_cred.get("identifier"), receiverUUIDs=[receiver], sender_endpoint=hmi_endpoint,
attributePath=attribute_path, msgUUID="s3i:{}".format(uuid.uuid4())
)
return getv_req.msg
......
......@@ -679,7 +679,7 @@ def on_service_request(self, body_json):
)
service_reply.fillServiceReply(
senderUUID=self.thing_id,
receiverUUIDs=body_json.get("sender", None),
receiverUUIDs=[body_json.get("sender", None)],
serviceType=body_json.get("serviceType", None),
results={"error": "invalid functionalities (serviceType) {}".format(service_functionality)},
replyingToUUID=body_json.get("identifier", None),
......@@ -696,7 +696,7 @@ def on_service_request(self, body_json):
)
service_reply.fillServiceReply(
senderUUID=self.thing_id,
receiverUUIDs=body_json.get("sender", None),
receiverUUIDs=[body_json.get("sender", None)],
serviceType=body_json.get("serviceType", None),
results={"error": "invalid functionalities (serviceType) {}".format(service_type.split('/')[1])},
replyingToUUID=body_json.get("identifier", None),
......@@ -716,7 +716,7 @@ def on_service_request(self, body_json):
APP_LOGGER.critical("Invalid function arguments")
service_reply.fillServiceReply(
senderUUID=self.thing_id,
receiverUUIDs=body_json.get("sender", None),
receiverUUIDs=[body_json.get("sender", None)],
serviceType=body_json.get("serviceType", None),
results={"error": "invalid function arguments (parameters)"},
replyingToUUID=body_json.get("identifier", None),
......@@ -727,7 +727,7 @@ def on_service_request(self, body_json):
result = {"ok": result}
service_reply.fillServiceReply(
senderUUID=self.thing_id,
receiverUUIDs=body_json.get("sender", None),
receiverUUIDs=[body_json.get("sender", None)],
serviceType=body_json.get("serviceType", None),
results=result,
replyingToUUID=body_json.get("identifier", None),
......
"""This module provides a collection of convenience functions."""
import datetime
import time
import uuid
import json
import os
from functools import partial
from s3i import Directory
from s3i import Broker
from s3i import ServiceRequest
from s3i import TokenType
from s3i import IdentityProvider
from ml.app_logger import APP_LOGGER
from ml.authentication import GRANT_TYPES
IDENTITY_PROVIDER_URL = "https://idp.s3i.vswf.dev/"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment