-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: lightpush rest api #2052
feat: lightpush rest api #2052
Conversation
RestApi Lightpush endpoint implemented
You can find the image built from this PR at
Built from f3ff2ea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
See comments for nitpicks
#### Types | ||
|
||
type PushRequest* = object | ||
pubsubTopic*: Option[PubSubTopic] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the RFC the topic is not optional but I guess we are going to update the RFC soon ™️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it was not obvious and I followed node interface lightpushPublish which has as optional due to sharding. Isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah and one more. I'm not pretty sure if it is ok to push a message with empty pubsubTopic and empty contentTopic, that seems doable now. I'm actually testing it further meanwhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok maybe I was confused is PushRequest
used for client -> server or is it between rest -> node?
client -> server; should follow the RFC
rest -> node; should allow optional pubsub with mandatory content topic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly the latter. You ask your node (presumably a light node) to make a push request toward a service provider relay node. So as in this case sharding will take place in case no pubsubTopic provided.
Co-authored-by: Simon-Pierre Vivier <simvivier@status.im>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks! Just a nitpick to enhance the test coverage :)
|
||
# Then | ||
check: | ||
response.status == 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May we have any "400" or "500" test cases as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on those. Just not added yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much less controversial than filter. :) LGTM.
Agree. But still while testing negative cases found some validation issue. I will fix it. Probably effects relay rest api validations too, as I was reusing code from there. So it worth testing for. |
@Ivansete-status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Beautiful PR 💯 !
Just added a couple of nitpick comments.
Aside from that, before merging we need to understand the underlying issue with the js-waku
tests that are failing.
Description
As part of epic #1076 RestApi endpoint for lightpush service is provided here
Changes
New endpoint POST:/lightpush/v1/message is added for wakunode.
How to test
Issue
#2040