Commit 7c9c1218 authored by Paris Stentoumis's avatar Paris Stentoumis
Browse files

feat: srm now allows only requests with appId in characteristic field

parent 4e5d74e2
Loading
Loading
Loading
Loading
+6 −1
Changes for service-resource-manager-implementation/src/controllers/intent_controller.py: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -27,8 +27,13 @@ def create_intent(body):
    logger.debug("Create Intent")

    tf_sdk = get_client()
    res = tf_sdk.onboard_intent(body)

    characteristic = body.get("characteristic")[0]
    if characteristic.get("name") == "appId":
        res = tf_sdk.onboard_intent(body)
    else:
        logger.exception("appId is not present in characteristic")
        return {"error": "appId is not present in characteristic"}, 400
    # Adapter returned HTTP response
    try:
        if not res.content: