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

Improve middleware situation #44

Closed
Firehed opened this issue Jun 4, 2018 · 1 comment
Closed

Improve middleware situation #44

Firehed opened this issue Jun 4, 2018 · 1 comment
Milestone

Comments

@Firehed
Copy link
Owner

Firehed commented Jun 4, 2018

  • PSR-15
  • Routing process could possibly become MW
  • Input validation, auth, and error handling same?

The goal is that the auth and error handling could move out of the main EndpointInterface, and auth moves into some kind of AuthenticatedEndpointInterface in 4.0, so changes should enable this. Error handling may get its own interface; probably inspired by MiddlewareInterface but also taking Throwable in place of the ResponseHandlerInterface

For auth specifically, it will need access to the endpoint being authenticated against. The attributes component of ServerRequestInterface is a possibility here, but that's going to be really challenging to get things in the right order (and other MW could strip it out or otherwise make a mess). PSR-15 meta goes into this a bit. Alternatively, extending the MiddlewareInterface to have an Endpoint injector may work

@Firehed Firehed added this to the 3.1.0 milestone Jun 4, 2018
@Firehed
Copy link
Owner Author

Firehed commented Jun 10, 2018

All of the auth stuff previously mentioned is largely redundant with #43, so trying to shoehorn something in with request attributes isn't necessary.

Everything else is still fairly open ended, but I think it looks like this:

  • Dispatcher becomes a RequestHandlerInterface, doing the FIFO queue thing (return $middleware->process($req, $this))
  • Some kind of adapter for legacy MW is created, and they are added to the end of the queue when dispatch is run

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

No branches or pull requests

1 participant