Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACP resource를 사용하여 AE 삭제 명령 권한 제어 #48

Open
maro5397 opened this issue Feb 25, 2022 · 2 comments
Open

ACP resource를 사용하여 AE 삭제 명령 권한 제어 #48

maro5397 opened this issue Feb 25, 2022 · 2 comments

Comments

@maro5397
Copy link

maro5397 commented Feb 25, 2022

ACP resource를 사용하여 AE 삭제 명령 권한 제어가 올바르게 이루어지지 않습니다.

AE 삭제 시 IN-CSE가 가지고 있는 ri값과 role(X-M2M-Origin)을 가지고 삭제 명령을 수행할 수 있는데,
ACP resource를 사용하여 이러한 명령을 제어할 수 있는 방법이 없더군요.

oneM2M 표준에는 ACP resource를 가지고 AE에 대한 접근 권한을 제어할 수 있도록 하는 것이 가능하다고 기술되어 있습니다만,
Mobius platform에는 이것이 올바르게 적용되어있지 않은 것 같습니다.

아래 코드의 내용을 보면,
"acpi":["Mobius/"+acpi]
위 속성을 주어 AE에도 ACP가 적용될 수 있도록 조치해놓았습니다.

하지만 INCSE의 ri값으로도, AE 자체의 ri값(이때 X-M2M-Origin의 role 값이 ri값으로 대체됨)으로도,
AE를 삭제할 수 없는 현상이 발생합니다.

때문에 ACP resource를 사용하여 AE 삭제 명령을 제어할 수 있는 기능을 고쳐주셨으면 합니다.

확인해주셔서 감사합니다.

@maro5397
Copy link
Author

maro5397 commented Feb 25, 2022

아래 코드는 테스트를 위해 사용한 AE 생성 시 ACP를 적용하는 코드입니다.
하지만 ACP가 올바르게 적용되지 않는 것을 확인할 수 있습니다.

============================================

def createApplicationEntity(AEname, serverURL, role):
    header = {
        "Accept":"application/json",
        "X-M2M-RI":"3408",
        "X-M2M-Origin":role,
        "Content-Type":"application/json;ty=2"
    }
    body = {
        "m2m:ae":{
            "rn":AEname,
            "api":"ID_api_raleeshinjo",
            "lbl":["key1","key2"],
            "rr": True,
            "poa":["MQTT|"],
            "acpi":["Mobius/"+acpi] #acp를 추가하기 위한 속성
        }
    }
    res = requests.post(serverURL+"/Mobius", headers=header, json=body)
    print(res.json())

============================================

확인해주셔서 감사합니다.

@maro5397
Copy link
Author

maro5397 commented Feb 25, 2022

아래 코드는 테스트를 위해 사용한 AE 삭제 시 role값을 주는 코드입니다.
하지만 ACP가 올바르게 적용되지 않아 삭제되지 않는 것을 확인할 수 있습니다.

============================================

def removeApplicationEntity(serverURL, AEname, role):
    ri = getApplicationEntityRI(serverURL, AEname, role)

    header = {
        "Accept":"application/json",
        "X-M2M-RI": ri_value, #이때 AE 자체의 ri, INCSE 자체의 ri 모두 사용해보았지만 삭제되지 않았음 
        "X-M2M-Origin": role,
    }
    res = requests.delete(serverURL+"/Mobius/"+AEname, headers=header, data="")
    res = res.json()
    print(res)

============================================

확인해주셔서 감사합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant