add ability to specify extra configuration in middleware

Sometimes a user might need to provide extra configuration for a
given resource. This allows the user to bundle that extra behavior
directly in the middleware, along with other possible milestone
behaviors