zalando-stups / hutmann

Simple OAuth2 for Play! backend services
Other
3 stars 6 forks source link

Feature/enable deferred user verification #1

Closed lenalebt closed 8 years ago

lenalebt commented 8 years ago

Added possibility to have deferred user verification filters. The use case is as follows: You cannot in every single case make sure you do not need external information to decide if a user should get authorized, or not. Sometimes additional information is needed (e.g. allow access for all users of a specific team, but getting to know if the person is on a specific team needs another service call).

To make this possible, the user verification function now takes a User, and returns a Future[Boolean] instead of a Boolean. You are able to lazily combine predicates using the implicit class FilterCompositor. See FiltersSpec for information on how to use them.