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

Move decoding of RPC requests to a custom HTTP Route #5

Open
Ocramius opened this issue Oct 5, 2012 · 0 comments
Open

Move decoding of RPC requests to a custom HTTP Route #5

Ocramius opened this issue Oct 5, 2012 · 0 comments

Comments

@Ocramius
Copy link
Contributor

Ocramius commented Oct 5, 2012

Current status

Logic used to parse parameters within an RPC HTTP request coming from ExtJs is currently located in KJSencha\Controller\DirectController#getRPC().

Proposal

This logic can be decomposed into a simple Zend\Mvc\Router\Http\RouterInterface that will be able to accept requests and produce standard controller and action parameters, along with an RPC object stored in the returned RouteMatch.

This unlocks a set of interesting features:

  1. can add guards at route level (security)
  2. allows usage of standard controller and action parameters in MVC
  3. allows usage of standard controllers in RPC context
  4. can use the mapper service to already avoid matching on non-mapped services (404 instead of 5xx error)
  5. can use guards at dispatch level (since we'll have the actionparameter, this is important if we need to integrate with tools like BjyAuthorize)

Problems

If the controller key is already valued DirectController by the router, we cannot use it for route guards. Same applies for action. We can anyway integrate with our own Route or Controller Guard assuming the end user is using BjyAuthorize. We can then trigger any checks on the Route or Controller guard with our custom parameters.

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

No branches or pull requests

1 participant