{"action":"closed","issue":{"url":"https://api.github.com/repos/feathersjs/feathers/issues/357","repository_url":"https://api.github.com/repos/feathersjs/feathers","labels_url":"https://api.github.com/repos/feathersjs/feathers/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/feathersjs/feathers/issues/357/comments","events_url":"https://api.github.com/repos/feathersjs/feathers/issues/357/events","html_url":"https://github.com/feathersjs/feathers/issues/357","id":159797929,"number":357,"title":"How to check authentication and authorization of users in middlewares?","user":{"login":"UlyssesAlves","id":2872102,"avatar_url":"https://avatars.githubusercontent.com/u/2872102?v=3","gravatar_id":"","url":"https://api.github.com/users/UlyssesAlves","html_url":"https://github.com/UlyssesAlves","followers_url":"https://api.github.com/users/UlyssesAlves/followers","following_url":"https://api.github.com/users/UlyssesAlves/following{/other_user}","gists_url":"https://api.github.com/users/UlyssesAlves/gists{/gist_id}","starred_url":"https://api.github.com/users/UlyssesAlves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UlyssesAlves/subscriptions","organizations_url":"https://api.github.com/users/UlyssesAlves/orgs","repos_url":"https://api.github.com/users/UlyssesAlves/repos","events_url":"https://api.github.com/users/UlyssesAlves/events{/privacy}","received_events_url":"https://api.github.com/users/UlyssesAlves/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-06-11T23:04:20Z","updated_at":"2016-08-09T20:19:18Z","closed_at":"2016-08-09T20:19:18Z","body":"Hello, everyone.\r\n\r\nI'm implementing upload funcionality in my application, but since (as far as I know it) feathers services don't give us neither the request object nor the response object I'm using a middleware and a custom route to be able to receive the file contents and store it in an external file storage platform.\r\n\r\nI'm worried about the security of my application, so I need a way to check if the user is authenticated and I also need to check his authorization to know the extents to which he is allowed to make file uploads in my system. In feathers services this is very easy to do, because the hook objcets already tell us the user who is making the request. But what about middlewares?\r\n\r\nIs it possible to check these user's authentication and authorization properties inside middlewares? Another possible solution would be if it's possible for me to capture the incoming request object, because this way I would be able to process the file being uploaded and persist it in the persistent storage of my choice."}}
{"actor":{"display_login":"ekryski"}}