{"action":"opened","issue":{"url":"https://api.github.com/repos/punchcard-cms/punchcard/issues/490","repository_url":"https://api.github.com/repos/punchcard-cms/punchcard","labels_url":"https://api.github.com/repos/punchcard-cms/punchcard/issues/490/labels{/name}","comments_url":"https://api.github.com/repos/punchcard-cms/punchcard/issues/490/comments","events_url":"https://api.github.com/repos/punchcard-cms/punchcard/issues/490/events","html_url":"https://github.com/punchcard-cms/punchcard/issues/490","id":182592865,"number":490,"title":"user management route middleware","user":{"login":"scottnath","id":216931,"avatar_url":"https://avatars.githubusercontent.com/u/216931?v=3","gravatar_id":"","url":"https://api.github.com/users/scottnath","html_url":"https://github.com/scottnath","followers_url":"https://api.github.com/users/scottnath/followers","following_url":"https://api.github.com/users/scottnath/following{/other_user}","gists_url":"https://api.github.com/users/scottnath/gists{/gist_id}","starred_url":"https://api.github.com/users/scottnath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottnath/subscriptions","organizations_url":"https://api.github.com/users/scottnath/orgs","repos_url":"https://api.github.com/users/scottnath/repos","events_url":"https://api.github.com/users/scottnath/events{/privacy}","received_events_url":"https://api.github.com/users/scottnath/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T18:03:06Z","updated_at":"2016-10-12T18:03:06Z","closed_at":null,"body":"Our user management routes all have common checks that need to be done on the various parameters that make up a user management url. These checks should be done within an express middleware.\r\n\r\n```gherkin\r\nFeature: URL checks before route creation\r\n  As a core developer\r\n  I want user management urls to be confirmed for correctness before the route-specific code runs\r\n  So that a route's code can be only code required to create the route's user interface.\r\n\r\n  Scenario: Middleware\r\n    Given that our system can perform url-parts checks before it triggers a route's code\r\n    When a route path is checked for correctness\r\n    Then that test should happen as middleware\r\n      And that middleware should be triggered for every user management route\r\n      And it should trigger an error route on url errors\r\n      And it should continue to create the route when zero url errors are present.\r\n\r\n  Scenario: Return data\r\n    Given that the middleware can add data to the original request\r\n    When a route path has been tested\r\n      And the tests come back with no errors\r\n    Then the middleware should return route-required data\r\n      And that data should include the user management's merged model object.\r\n\r\n  Scenario: Redirect to error page\r\n    Given that a user has attempted to visit a url which is incorrectly formed\r\n      And that the user needs to know what mistake has been made\r\n    When a user management route's url creates an error\r\n    Then the user should receive an error message\r\n      And the message should be a path-part specific error message for the problem\r\n      And it should show the user an error page\r\n      And that error page should contain the path-part specific error message\r\n      And that error page should contain a safe url for the user to visit to try again.\r\n```\r\n\r\n---\r\n\r\n**URL checks**\r\n- [ ] Middleware\r\n- [ ] Return data\r\n- [ ] Redirect to error page\r\n"}}
{"actor":{"display_login":"scottnath"}}