Allow anonymous clones when pull-replication plugin is enabled.

When the command `git clone` is executed over http, behind the scenes it
does a request: `/info/refs?service=git-upload-pack`. Currently
`BearerAuthenticationFilter.java` filters ALL the `upload pack` requests
and therefore it checks the Bearer token header. This feature was added
to allow Bearer Token Authentication when `git fetch over http` is
executed from other Gerrit instances.

The fix allows to discriminate the `upload pack` requests, therefore
Bearer token header checking will be done just in the case of
`git fetch over http` from other Gerrit instances.

Bug: Issue 16548
Change-Id: I9873d92c88b8eb00c895a8e1cce18cae94199ac9
2 files changed
tree: 9f63f0ccc95d109e7ce3f8aaa7eca99b1b48f88b
  1. example-setup/
  2. src/
  3. .gitignore
  4. BUILD
  5. Jenkinsfile
  6. LICENSE