{"action":"created","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6014","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6014/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6014/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6014/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6014","id":294996408,"number":6014,"title":"LwM2M: add data validation callback and set transport binding of server object as read-writable","user":{"login":"rbtchc","id":904087,"avatar_url":"https://avatars2.githubusercontent.com/u/904087?v=4","gravatar_id":"","url":"https://api.github.com/users/rbtchc","html_url":"https://github.com/rbtchc","followers_url":"https://api.github.com/users/rbtchc/followers","following_url":"https://api.github.com/users/rbtchc/following{/other_user}","gists_url":"https://api.github.com/users/rbtchc/gists{/gist_id}","starred_url":"https://api.github.com/users/rbtchc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbtchc/subscriptions","organizations_url":"https://api.github.com/users/rbtchc/orgs","repos_url":"https://api.github.com/users/rbtchc/repos","events_url":"https://api.github.com/users/rbtchc/events{/privacy}","received_events_url":"https://api.github.com/users/rbtchc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T03:40:46Z","updated_at":"2018-02-07T04:04:49Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6014","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6014","diff_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6014.diff","patch_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6014.patch"},"body":"Per issue #3931, it's a good idea that we validate incoming data before we made it permanent.\r\n\r\nThe idea to support this is to simply add a callback to struct lwm2m_engine_res_inst.\r\nCombining with pre_write_cb and post_write_cb we can validate the incoming data.\r\n\r\nHere's how\r\nFirst, pre_write_cb() is registered to return a buffer to store the data for later validation.\r\nSecond, validate_cb() is called after the data is copied from packet buffer to the temporary buffer returned from pre_write_cb()\r\nFinally, post_write_cb() is registered and called to make the validated data permanent.\r\n\r\nWith validation support added to LwM2M, we could set \"transport binding\" resource of server object as read-writable.\r\n\r\nThe server binding mode was read-only for we only support UDP.\r\nHowever, it seems that we do support UDP with queue mode (UQ) as well.\r\nFor queue mode should be a server side implementation.\r\n\r\nSet server binding mode back to read-writable (as defined by OMA) and add binding mode related definition, validation functions to server object to allow server to change the binding mode to either UDP or UDP with queue mode.\r\n"},"comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments/363650433","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6014#issuecomment-363650433","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6014","id":363650433,"user":{"login":"codecov-io","id":8655789,"avatar_url":"https://avatars0.githubusercontent.com/u/8655789?v=4","gravatar_id":"","url":"https://api.github.com/users/codecov-io","html_url":"https://github.com/codecov-io","followers_url":"https://api.github.com/users/codecov-io/followers","following_url":"https://api.github.com/users/codecov-io/following{/other_user}","gists_url":"https://api.github.com/users/codecov-io/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov-io/subscriptions","organizations_url":"https://api.github.com/users/codecov-io/orgs","repos_url":"https://api.github.com/users/codecov-io/repos","events_url":"https://api.github.com/users/codecov-io/events{/privacy}","received_events_url":"https://api.github.com/users/codecov-io/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T04:04:48Z","updated_at":"2018-02-07T04:04:48Z","author_association":"NONE","body":"# [Codecov](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/6014?src=pr&el=h1) Report\n> :exclamation: No coverage uploaded for pull request base (`master@1e6adba`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/6014/graphs/tree.svg?width=650&height=150&src=pr&token=ftaqgO8OOj)](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/6014?src=pr&el=tree)\n\n```diff\n@@            Coverage Diff            @@\n##             master    #6014   +/-   ##\n=========================================\n  Coverage          ?   52.51%           \n=========================================\n  Files             ?      406           \n  Lines             ?    39683           \n  Branches          ?     7715           \n=========================================\n  Hits              ?    20839           \n  Misses            ?    15663           \n  Partials          ?     3181\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/6014?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/6014?src=pr&el=footer). Last update [1e6adba...d28f9ca](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/6014?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"}}
{"actor":{"display_login":"codecov-io"}}