You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to waku-org#3128
Update the API to enforce mandatory URL encoding for `pubsubTopic` and `content_topic`.
* Update `docs/api/rest-api.md` to include examples of URL-encoded `pubsubTopic` and `contentTopics` parameters.
* Modify `waku/waku_api/rest/store/handlers.nim` to validate and enforce URL encoding for `pubsubTopic` and `contentTopics` parameters.
* Add error handling for invalid or non-encoded `pubsubTopic` and `contentTopics` parameters in `waku/waku_api/rest/store/handlers.nim`.
* Update `decodeRequestBody` function in `waku/waku_api/rest/rest_serdes.nim` to validate and enforce URL encoding for `pubsubTopic` and `contentTopics` parameters.
* Add error handling for invalid or non-encoded `pubsubTopic` and `contentTopics` parameters in `waku/waku_api/rest/rest_serdes.nim`.
Background
When calling API get /store/v3/messages with pubsubTopic encoded or not encoded it works
[...]
Details
ex :
curl -v -X GET "http://127.0.0.1:49153/store/v3/messages?includeData=true&pubsubTopic=/waku/2/rs/3/0&pageSize=20&ascending=true"
or call it encoded
ex:
curl -v -X GET "http://127.0.0.1:5213/store/v3/messages?includeData=true&pubsubTopic=%2Fwaku%2F2%2Frs%2F3%2F0&pageSize=20&ascending=true"
in both cases it works ang got the message with correct topic name
Acceptance criteria
According to specs pubsubtopic shall be encoded
so behavior and specs Don't match either specs shall mark the encoding as optional or SW change to mandatory
Note: same for content_topic
The text was updated successfully, but these errors were encountered: