Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds
  • Group overview
  • Epics 44
    • List
    • Roadmap
  • Issues 1,060
  • Merge Requests 128
  • Security
  • Packages
  • Members
Collapse sidebar
  • Minds
  • Epics
  • &75

Open
Opened 2 months ago by Emiliano Balbuena

PSR7 Router

Goals

  • Request handler working prototype with legacy routes support
  • Allow modules to provide routes
  • Allow modules to specify per-route middlewares
  • Catch uncaught exceptions and cast them as status: error responses. Ensure Sentry works.
  • API/FS versioning?
  • ... Middlewares

Milestones

Milestone Link
PSR-7 Router https://gitlab.com/groups/minds/-/milestones/63

Merge Requests & Branches

https://gitlab.com/groups/minds/-/merge_requests?scope=all&utf8=%E2%9C%93&state=opened&search=router PSR-7 Router

Mockups

Flow

Successful response

RequestRequestRequestRequestRequestResponseResponseHTTP InterfacePre/Post HooksApp MiddlewareGroup MiddlewareRoute MiddlewareModule Actiongraph TD HTTP[HTTP Interface] --Request--> Hooks[Pre/Post Hooks] --Request--> App_Middleware[App Middleware] --Request--> Group_Middleware[Group Middleware] --Request--> Route_Middleware[Route Middleware] --Request--> Module_Action[Module Action] --Response--> Hooks --Response--> HTTP

App Middleware failure response

e.g.: XSRF validation failure

RequestRequestErrorResponseErrorResponseHTTP InterfacePre/Post HooksApp MiddlewareGroup MiddlewareRoute MiddlewareModule Actiongraph TD HTTP[HTTP Interface] --Request--> Hooks[Pre/Post Hooks] --Request--> App_Middleware[App Middleware] -.- Group_Middleware[Group Middleware] -.- Route_Middleware[Route Middleware] -.- Module_Action[Module Action] -.- Route_Middleware -.- Group_Middleware -.- App_Middleware --ErrorResponse--> Hooks --ErrorResponse--> HTTP

Group failure response

e.g. Logged-in user required for certain routes group

RequestRequestRequestErrorResponseErrorResponseHTTP InterfacePre/Post HooksApp MiddlewareGroup MiddlewareRoute MiddlewareModule Actiongraph TD HTTP[HTTP Interface] --Request--> Hooks[Pre/Post Hooks] --Request--> App_Middleware[App Middleware] --Request--> Group_Middleware[Group Middleware] -.- Route_Middleware[Route Middleware] -.- Module_Action[Module Action] -.- Route_Middleware -.- Group_Middleware --ErrorResponse--> Hooks --ErrorResponse--> HTTP

Action failure response

e.g. Database unavailable failure

RequestRequestRequestRequestRequestErrorResponseErrorResponseHTTP InterfacePre/Post HooksApp MiddlewareGroup MiddlewareRoute MiddlewareModule Actiongraph TD HTTP[HTTP Interface] --Request--> Hooks[Pre/Post Hooks] --Request--> App_Middleware[App Middleware] --Request--> Group_Middleware[Group Middleware] --Request--> Route_Middleware[Route Middleware] --Request--> Module_Action[Module Action] --ErrorResponse--> Hooks --ErrorResponse-->HTTP

Potential implementation example

$this->route->withPrefix('api/v3/newsfeed', function(Route $route) {
  $route->get(
    '/', 
    function(ServerRequest $request) {
      return (new JsonResponse([]))
        ->withStatus(501);
    }
  );

  $route->using([
    LoggedInMiddleware::class,
  ])->get(
    '/subscribed', 
    DiRef::_('Newsfeed\Manager', 'listBySubscriptions')
  );

  $route->using([
    LoggedInMiddleware::class,
  ])->withPrefix('/activity', function (Route $route) {
    $route->post(
      '/',
      DiRef::_('Newsfeed\Activity\Manager', 'create')
    );

    $route->post(
      '/:id',
      DiRef::_('Newsfeed\Activity\Manager', 'edit')
    );

    $route->delete(
      '/:id',
      DiRef::_('Newsfeed\Activity\Manager', 'delete')
    );
  });

  $route->get(
    '/:algorithm', 
    DiRef::_('Newsfeed\Manager', 'listByAlgorithm')
  );
});

Developers

Developer Focus
@edgebal backend
Edited 2 hours ago by Emiliano Balbuena
To Do
Oct 1, 2019
Start date
Fixed: None
Inherited: Oct 1, 2019
Dec 18, 2019
Due date
Fixed: Dec 18, 2019
Inherited: None
-
3
Labels
Epic::Reviewed
Product::Platform
Squad::Yellow
None
Ancestors
None
3
3 participants
user avatar
Brian Hatchet
user avatar
Emiliano Balbuena
user avatar
Mark Harding
Notifications
  • Epics and Issues
  • Roadmap
0 26
  • 2 hours ago
    Implement feature flag for PSR-7 Router
    2 hours ago
    #1189
    PSR7 Router
    1
    Weight
    Avatar for Emiliano Balbuena
  • 5 days ago
    Front Index should be served using PSR-7 Router
    5 days ago
    #1177
    PSR7 Router
    3
    Weight
    Avatar for Emiliano Balbuena
  • 1 week ago
    Complete spec tests for router
    1 week ago
    #1143
    PSR7 Router
    3
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    SEO Middleware
    2 months ago
    #893
    2
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Pro Middleware
    2 months ago
    #892
    2
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Referral System Middleware
    2 months ago
    #891
    1
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Email Campaigns + Router Hooks Middleware
    2 months ago
    #890
    2
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Analytics Middleware
    2 months ago
    #889
    1
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Catch unhandled exception on route map handlers. Build a response and ping Sentry
    2 months ago
    #882
    PSR7 Router
    3
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    'text/html' requests should serve static front page
    6 days ago
    #2176
    PSR7 Router
    1
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Module routes should parse named parameters
    6 days ago
    #2174
    PSR7 Router
    2
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Only handle known routes on Pre-PSR7 Router (/, /api/v1, /api/v2, /fs, ... other old static routes)
    6 days ago
    #897
    PSR7 Router
    1
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Normalize request: URI, Content Type, POST Data, Host
    2 months ago
    #895
    2
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Frame Deny Middleware
    2 months ago
    #894
    1
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Session Middleware
    6 days ago
    #888
    PSR7 Router
    3
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    CORS Middleware
    6 days ago
    #887
    PSR7 Router
    2
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Routing Middleware (connects modules with routes)
    6 days ago
    #886
    PSR7 Router
    3
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    XSRF Prevention Middleware
    6 days ago
    #885
    PSR7 Router
    2
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Admin Middleware
    6 days ago
    #884
    PSR7 Router
    1
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Logged-in Middleware (Disallow anonymous access to certain endpoints)
    6 days ago
    #883
    PSR7 Router
    1
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Allow module route maps to specify groups with common middleware (as children routes)
    6 days ago
    #881
    PSR7 Router
    2
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Allow module route maps to specify one or more middleware
    6 days ago
    #880
    PSR7 Router
    2
    Weight
    Avatar for Emiliano Balbuena
  • 6 days ago
    Allow modules to map explicit routes handled via DI bindings
    6 days ago
    #879
    PSR7 Router
    2
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Move pre-PSR-7 router to it's class and create a fallback middleware
    2 months ago
    #878
    1
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Request handler prototype
    2 months ago
    #877
    3
    Weight
    Avatar for Emiliano Balbuena
  • 2 months ago
    Investigate PSR-7/PSR-15 implementations and best practices
    2 months ago
    #828
    2
    Weight
    Avatar for Emiliano Balbuena

  • Emiliano Balbuena @edgebal added Product::Platform Squad::Yellow scoped labels 2 months ago

    added scoped labels

  • Emiliano Balbuena @edgebal mentioned in merge request engine!342 2 months ago

    mentioned in merge request engine!342

  • Emiliano Balbuena @edgebal changed the description 2 months ago

    changed the description

  • Emiliano Balbuena @edgebal marked the task Request handler working prototype with legacy routes support as completed 2 months ago

    marked the task Request handler working prototype with legacy routes support as completed

  • Emiliano Balbuena @edgebal added issue minds#828 (closed) 2 months ago

    added issue minds#828 (closed)

  • Emiliano Balbuena @edgebal added issue engine#877 (closed) 2 months ago

    added issue engine#877 (closed)

  • Emiliano Balbuena @edgebal added issue engine#878 (closed) 2 months ago

    added issue engine#878 (closed)

  • Emiliano Balbuena @edgebal added issue engine#879 (closed) 2 months ago

    added issue engine#879 (closed)

  • Emiliano Balbuena @edgebal added issue engine#880 (closed) 2 months ago

    added issue engine#880 (closed)

  • Emiliano Balbuena @edgebal added issue engine#881 (closed) 2 months ago

    added issue engine#881 (closed)

  • Emiliano Balbuena @edgebal added issue engine#882 2 months ago

    added issue engine#882

  • Emiliano Balbuena @edgebal added issue engine#883 (closed) 2 months ago

    added issue engine#883 (closed)

  • Emiliano Balbuena @edgebal added issue engine#884 (closed) 2 months ago

    added issue engine#884 (closed)

  • Emiliano Balbuena @edgebal added issue engine#885 (closed) 2 months ago

    added issue engine#885 (closed)

  • Emiliano Balbuena @edgebal added issue engine#886 (closed) 2 months ago

    added issue engine#886 (closed)

  • Emiliano Balbuena @edgebal added issue engine#887 (closed) 2 months ago

    added issue engine#887 (closed)

  • Emiliano Balbuena @edgebal added issue engine#888 (closed) 2 months ago

    added issue engine#888 (closed)

  • Emiliano Balbuena @edgebal added issue engine#889 2 months ago

    added issue engine#889

  • Emiliano Balbuena @edgebal added issue engine#890 2 months ago

    added issue engine#890

  • Emiliano Balbuena @edgebal added issue engine#891 2 months ago

    added issue engine#891

  • Emiliano Balbuena @edgebal added issue engine#892 2 months ago

    added issue engine#892

  • Emiliano Balbuena @edgebal added issue engine#893 2 months ago

    added issue engine#893

  • Emiliano Balbuena @edgebal added issue engine#894 (closed) 2 months ago

    added issue engine#894 (closed)

  • Emiliano Balbuena @edgebal added issue engine#895 (closed) 2 months ago

    added issue engine#895 (closed)

  • Emiliano Balbuena @edgebal added issue engine#897 (closed) 2 months ago

    added issue engine#897 (closed)

  • Mark Harding @markeharding changed the description 1 month ago

    changed the description

  • Mark Harding @markeharding changed title from Modernize Router (Yellow) to PSR7 Router 1 month ago

    changed title from to

  • Emiliano Balbuena @edgebal changed the description 1 month ago

    changed the description

  • Emiliano Balbuena @edgebal changed the description 1 month ago

    changed the description

  • Emiliano Balbuena @edgebal changed the description 1 month ago

    changed the description

  • Emiliano Balbuena @edgebal changed the description 1 month ago

    changed the description

  • Emiliano Balbuena @edgebal added issue front#2174 (closed) 1 month ago

    added issue front#2174 (closed)

  • Emiliano Balbuena @edgebal added issue front#2176 (closed) 1 month ago

    added issue front#2176 (closed)

  • Emiliano Balbuena @edgebal added issue engine#1143 6 days ago

    added issue engine#1143

  • Brian Hatchet :speech_balloon: @brianhatchet changed finish date to Dec 4, 2019 6 days ago

    changed finish date to Dec 4, 2019

  • Brian Hatchet :speech_balloon: @brianhatchet added issue engine#1177 5 days ago

    added issue engine#1177

  • Brian Hatchet :speech_balloon: @brianhatchet added Epic::Reviewed scoped label 5 days ago

    added scoped label

  • Emiliano Balbuena @edgebal added issue engine#1189 2 hours ago

    added issue engine#1189

  • Emiliano Balbuena @edgebal marked the task Allow modules to provide routes as completed 2 hours ago

    marked the task Allow modules to provide routes as completed

  • Emiliano Balbuena @edgebal marked the task Allow modules to specify per-route middlewares as completed 2 hours ago

    marked the task Allow modules to specify per-route middlewares as completed

  • Emiliano Balbuena @edgebal changed the description 2 hours ago

    changed the description

  • Brian Hatchet :speech_balloon: @brianhatchet changed finish date to Dec 18, 2019 19 minutes ago

    changed finish date to Dec 18, 2019

  • Brian Hatchet
    Brian Hatchet :speech_balloon: @brianhatchet · 18 minutes ago

    This epic is delayed due to conflicting priorities with the Top Feeds fixes. @edgebal is focusing on that and I am moving the due date to next sprint for the PSR-7 router.

Please register or sign in to reply