Add support for rejecting requests when no config

Also move some duplicated methods into a shared
library.

Change-Id: Id0baa25cbf64276ba4b4f40a29e6dcfba0baa596
7 files changed