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

Fix #140 and #139 by adding an Inward/Outward mechanism for remote call #141

Closed
wants to merge 6 commits into from

Conversation

jeromevalentin
Copy link

#140 : The priority between error / result is now the same between TCP / HTTP. If an error and a message is returned, the error is now considered (in both TCP/HTTP) as more important and the act call fail.

#139 : An implementation for the server side is proposed. It allows to define an inward/outward hook in listen options. Those hooks are automatically invoked when receiving a remote act call.

  • Inward implementations can alter the incoming message, or even reject it
  • Outward implementations can alter the outgoing result, or even consume an error and produce a default response

Examples:

  • Inward mechanism can be used to improve security checks, by extracting the user token from the request, ensure user is known and logged in
  • Outward mechanism can be used to clean up response before they are sent, like removing all $ properties in case of seneca-entity usage on server and not on client

@coveralls
Copy link

coveralls commented Oct 31, 2016

Coverage Status

Coverage increased (+1.1%) to 85.714% when pulling 27fa44c on jeromevalentin:inward-outward into 6b163bb on senecajs:master.

@coveralls
Copy link

coveralls commented Oct 31, 2016

Coverage Status

Coverage increased (+1.1%) to 85.714% when pulling 8097ba7 on jeromevalentin:inward-outward into 6b163bb on senecajs:master.

@coveralls
Copy link

coveralls commented Jun 3, 2017

Coverage Status

Coverage increased (+1.9%) to 86.447% when pulling 2a1f310 on jeromevalentin:inward-outward into 6b163bb on senecajs:master.

@rjrodger rjrodger closed this Feb 16, 2019
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

Successfully merging this pull request may close these issues.

3 participants