c9fa09eb5e
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
74 lines
1.7 KiB
Python
74 lines
1.7 KiB
Python
SRCS = glob(
|
|
['src/main/java/**/*.java'],
|
|
)
|
|
RESOURCES = glob(['src/main/resources/**/*'])
|
|
|
|
java_library(
|
|
name = 'httpd',
|
|
srcs = SRCS,
|
|
resources = RESOURCES,
|
|
deps = [
|
|
'//gerrit-antlr:query_exception',
|
|
'//gerrit-common:annotations',
|
|
'//gerrit-common:server',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-gwtexpui:server',
|
|
'//gerrit-patch-jgit:server',
|
|
'//gerrit-prettify:server',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-server:server',
|
|
'//gerrit-util-cli:cli',
|
|
'//gerrit-util-http:http',
|
|
'//lib:args4j',
|
|
'//lib:gson',
|
|
'//lib:guava',
|
|
'//lib:gwtjsonrpc',
|
|
'//lib:gwtorm',
|
|
'//lib:jsch',
|
|
'//lib:mime-util',
|
|
'//lib/auto:auto-value',
|
|
'//lib/commons:codec',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-assistedinject',
|
|
'//lib/guice:guice-servlet',
|
|
'//lib/jgit:jgit',
|
|
'//lib/jgit:jgit-servlet',
|
|
'//lib/log:api',
|
|
'//lib/lucene:core',
|
|
],
|
|
provided_deps = ['//lib:servlet-api-3_1'],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_sources(
|
|
name = 'httpd-src',
|
|
srcs = SRCS + RESOURCES,
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_test(
|
|
name = 'httpd_tests',
|
|
srcs = glob(['src/test/java/**/*.java']),
|
|
deps = [
|
|
':httpd',
|
|
'//gerrit-common:server',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-server:server',
|
|
'//gerrit-util-http:http',
|
|
'//lib:junit',
|
|
'//lib:gson',
|
|
'//lib:gwtorm',
|
|
'//lib:guava',
|
|
'//lib:servlet-api-3_1',
|
|
'//lib:truth',
|
|
'//lib/easymock:easymock',
|
|
'//lib/guice:guice',
|
|
'//lib/jgit:jgit',
|
|
'//lib/jgit:junit',
|
|
],
|
|
source_under_test = [':httpd'],
|
|
# TODO(sop) Remove after Buck supports Eclipse
|
|
visibility = ['//tools/eclipse:classpath'],
|
|
)
|