ContainerAuthFilter: honor username provided by container

When 'trustContainerAuth' is enabled and proxy does authentication
on root (instead of '/login/'), ServletRequest#getRemoteUser is
null. In this case we need to pull the username from 'Authorization'
header. It is done the same way in HttpAuthFilter already.

Move username extraction logic from HttpAuthFilter to
RemoteUserUtil and add some tests.

Update javadoc to reflect current situation:
ContainerAuthFilter is also used for the REST API; see:
GitOverHttpModule#configureServlets: filter("/a/*").through(authFilter)

Change-Id: I0cf21fb7ecd8a958fad270704c11ebfffd9fea93
Bug: Issue 2209
5 files changed