Fix warnings about unmatched {} in inline tags.
Enabling any more than this set of warnings introduces hundreds of
warnings about things like missing @throws tags, which we may want to
fix, but is a lot more work.
Change-Id: Ic671fb600d2e1ba49b7e855158811c6c98b6cda1
* changes:
Use consistent lowercase for "gitweb"
GitWebConfig: Minor cleanup
Move logic from GitWebType to GitWebConfig
Extract CGI configuration from GitWebConfig
GitWebConfig: Fix check for set-to-empty-string
We had inconsistent class and variable naming in Gerrit to the point
that (prior to I640e645f6) there were two completely different classes
named "GitwebConfig" and "GitWebConfig".
In the official upstream Git documentation, this command line tool is
most often referred to as "gitweb". Standardize on this
capitalization in text. It may still be capitalized at the beginning
of sentences, or where required by programming language style (e.g.
Java class names).
The only exceptions are:
- MSysGit's wiki page is entitled GitWeb, so use that when referring
specifically to that page.
- Old release notes were not touched.
Change-Id: I497477c264e9cc1380c520618f8edf13e7226c9d
GitWebConfig was used for two separate things:
1. Encapsulating the (type, GitWebConfig) pair that gets passed
through the GerritConfig to the host page.
2. Describing the configuration for the built-in CGI servlet in the
gitweb package.
Separate these concerns, creating GitWebCgiConfig in the same config
package as GitWebConfig. (Although it contains configuration for the
httpd functionality, it needs to live in the server package so other
server classes can check the configuration status.)
Change-Id: I002beb892d415eb41a15829e6c5d540be253e390
* changes:
Check with HEAD request if docs are available and remove GerritConfig
Remove usage of GerritConfig from GitWebServlet
Add acceptance test for /config/server/info REST endpoint
Return info about SSHD with /config/server/info REST endpoint
Retrieve clone commands from /config/server/info REST endpoint
Add new extension point for clone commands
Make *Info classes in GetServerInfo movable to extension package
Expose more config parameters via REST
Expose GitWeb config via /config/server/info REST endpoint
Gerrit Client: Retrieve archives formats via REST
Expose all auth config params that are needed by client over REST
For clone commands rely on scheme URLs from the server
The Gerrit client needs to know if documentation is available on the
server so that it can add the Documentation menu bar. The
/config/server/info REST endpoint cannot easily provide this
information since the ServletContext which can be used to check this
is not available in the REST API layer. Instead let the Gerrit client
do a HEAD request to "Documentation/index.html" to check if
documentation is available on the server.
GerritConfig is now no longer used and can be removed.
Change-Id: I759c262a6789193d14bcfdf702f9907854230c01
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Instead of injecting GerritConfig into GitWebServlet inject what is
needed to get the SSHD listen address and the canonical git URL, since
this is everything GitWebServlet needs. Removing the injection of
GerritConfig allows us to remove the SSHD listen address and the
canonical git URL from GerritConfig and in a later step to get rid of
GerritConfig.
Change-Id: I74c134edb34a26a49424c4ee1337dab642c249f3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The /config/server/info REST endpoint now provides almost all
configuration parameters which are needed by the Gerrit Client.
GerritConfig still contains 3 values. 2 cannot easily be exposed via
REST due to missing Guice bindings in the REST API layer (sshdAddress,
documentationAvailable), 1 is not used on client-side (gitDaemonUrl).
Further cleanups will be done in follow-up changes.
Change-Id: I660db7aa63253cb6a448079228301461dd1aa06f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
In the Gerrit Client retrieve the GitWeb configuration via REST and
remove the GitWeb configuration from the config that is embedded in
the host page data.
In order to provide the GitWeb configuration from the REST endpoint
the GitWeb configuration must be bound in the sysinjector (the binding
of the GitWebModule stays in the webinjector).
Change-Id: I640e645f6c9a72d5539f33e28721f0cff93e732d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Use the /config/server/info REST endpoint to retrieve the supported
archive formats and remove this information from the config that is
embedded in the host page data.
The way how archives formats are included into the ServerInfo JSON was
adapted to the changes done with commit 1e933885.
Change-Id: Iaf0a3817c5f239e87a0f9c2b29d198e410e4f49e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The Gerrit Client needs to know about some authentication
configuration parameters of the server in order to render the UI and
enable/disable certain functionality. Some of them are already
provided via the /config/server/info REST endpoint. Add the other auth
parameters to this REST endpoint and adapt the Gerrit Client to
retrieve these parameters via REST. Remove these parameters from the
config that is embedded in the host page data as they are no longer
read from this data structure.
Change-Id: Ia7dc5ea8654b6e63eb577dc3d9ada07ce8d90113
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Do not construct clone commands on client-side, but rely on the scheme
URLs that are retrieved from the server.
Change-Id: I7077ce0dcf21941d44ec69e4aecf7adb94bbeebe
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
It's a user error if a wrong password is provided and the Gerrit
administrator doesn't need a stacktrace for this.
Change-Id: Ie370440d8be52b4be4ea4f7d052c843a1e414708
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
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
The Gerrit Client needs to know about some server configuration
parameters in order to render the UI and enable/disable certain
functionality. At the moment the information about the server
configuration is embedded into the host page, but there is a new REST
endpoint that exposes some of the configuration parameters, and it
should be used instead. Retrieving the data via REST is cleaner as
this is an API which can be also used by other clients. Also it
reduces some code duplication if the configuration parameters are only
exposed via REST and not once again via the host page.
This change is only a start to get rid of the configuration data which
is embedded in the host page. It only consumes those configuration
parameters via REST which are already exposed in the REST API. In
future changes the REST API should be extended to provide all
information that is needed by the Gerrit Client, so that no such data
must be embedded into the host page.
This change doesn't consume the download commands which are already
exposed via REST, since this requires quite some changes in the Gerrit
Client, and it is better done in an own change.
Change-Id: Id367ba82a29bfc8f84fa4bb3c2fc973355e5cc4a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
* stable-2.11:
Position cursor on first column on diff chunk navigation
Restore default Codemirror cursor style
Update 2.11.1 release notes
Update replication plugin
rest-api-changes.txt: fix minor spelling mistake
Fix various spelling mistakes
Prolog-Cookbook: tidy up rule status descriptions
Upgrade replication plugin
Always add SecureStore module in WebAppInitializer
Batch index executor: Don't fall back to interactive executor
Fix minor typo in set-account command documentation
ChangeJson: Don't load all approvals on closed changes
ChangeJson: Less eager loading of patch sets
ChangeJson: Eliminate patch set loading in search results
Remove StoredValues.PATCH_SET
Update 2.11.1 release notes
JarPluginProvider: Add JarScanner on running plugin JAR file
GitWeb config: Delete temporary config on exit
Fix description of auth.* parameters
Change-Id: I9fc13aa3665c29e488d49a36c9b57f908a74c2f8
GitWeb config file remains undeleted in temporary directory on Gerrit
exit.
Call deleteOnExit() for this temporary file.
Change-Id: Ib62579b36cfe73bca0fa1f44383e6a613609cb45
The clone commands on the project info screen were only shown when a
checkout command was configured on the server. This doesn't make sense
since clone has nothing to do with checkout. Remove the check and
always show the clone commands.
Change-Id: I7f9095046004d8643fc810c61b7ca53cfed1b4a7
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Certain code paths may trigger execution of the finally block before a
value is assigned to the viewData variable. This change properly
handles the case where viewData is null.
Change-Id: I41723257fa3a3a6d99aaae56f6ce9392b1a4250b
Some of the Gerrit configuration parameters can now be accessed by
GET /config/server/info
This REST endpoint can also be used anonymously.
For now the REST endpoint returns only a very limited set of
configuration parameters, which are needed by the Gerrit Mylyn
Connector. The result contains information about:
- auth type, editable account fields, if contributor agreements are
used
- contact store
- download schemes, commands and archive formats
- All-Projects and All-Users project names
At the moment the Mylyn Gerrit Connector retrieves this information by
parsing the config from the HostPageData which is sent to the client.
This is an internal data structure which is used to exchange
information between Gerrit server and Gerrit WebUI. It's not an API
and third-party tools should not rely on it. As a result the Mylyn
Gerrit Connector is currently broken for Gerrit 2.11 and newer.
Provide the Mylyn Gerrit Connector team a stable API that provides
them the information they need so that future breakages can be
avoided. See Eclipse Bugzilla issue 465132 [1] for further details.
The structure of the returned JSON correlates to the structure in the
gerrit.config file.
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=465132
Change-Id: Iac4be762bff971403438aa84923d9f0e11883366
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
In order to facilitate action-specific auditing, the RestResource,
RestView, and HttpServletRequest are incorporated into a new extended
audit event class, supplementing all existing fields (some redundant)
in HttpAuditEvent. Although the request is already available from the
Guice injector, adding this high-value information as a field
facilitates convenient access.
Change-Id: I3ebd629c90921237bbcfbb00d9ea990740099104
The REGISTER_NEW_EMAIL is only supposed to be included into the
editable account fields that are sent to the client if it is editable
and if an email sender is available and enabled. At the moment it is
always included when it is editable, even if there is no enabled email
sender.
Change-Id: Ib64851b9e6f5853ba7e111b4ddcd22a4fffa833e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This allows use the standard git archive command to create an archive
of the content of a repository:
$ git archive -f tar.bz2 --prefix=foo-1.0/ \
--remote=ssh://john@gerrit:29418/foo \
refs/changes/73/673/1 > foo-1.0.tar.bz2
Different compression levels can be configured for zip format:
$ git archive -f zip -9 \
--remote=ssh://john@gerrit:29418/foo \
refs/changes/73/673/1 > foo.zip
TEST PLAN:
buck test --include ssh
Bug: Issue 2061
Change-Id: Ifc1a92bacef3155cf474adee883cbe587dd8759f
* stable-2.11:
Acceptance-tests: Don't assume UTF-8 system wide encoding
Update version to 2.10.3.1
Release notes for 2.10.3.1
Project Owner Guide: Mention importer plugin to rename project
Update the cookbook plugin revision
Acceptance tests: Always treat response encoding as UTF-8
Fix broken formatting in 2.10.3 release notes
Update 2.11 release notes
Add anchors to plugin sections in plugin documentation page
Add description of importer plugin to the plugin documentation page
Fix rendering issues in Configuration documentation
Document that submit should for granted on refs/heads/*
Update version to 2.10.3
Update 2.10.3 release notes
Improve the version computation for the release notes
Check reachability from R_HEADS/R_TAGS/REFS_CONFIG when creating branches
Update 2.10.3 release notes
Include submitter in ChangeMessage on submission
Support hybrid OpenID and OAuth2 authentication
Move edit ref name methods from ChangeEditUtil to RefNames
Remove tests related to duplicate event type registration
Events: Allow same event type to be re-registered
InlineEdit: Clarify difference between remove and revert operation
Documentation: clone buck from Github
ChangeTable: Always add the title tooltip on label column entries
Enable 'Save' button when 'Display In Review Category' pref is changed
Add ForcePushIT to acceptance tests
InlineEdit: Handle enter event in add file dialog box
Update replication plugin to latest revision
Release notes for Gerrit 2.10.3
Fix NPE in GitWebServlet
Update revision of the replication plugin
Fix required index version for online reindexing in 2.11 release notes
Update buck version to same as master
OAuth: Respect servlet context path in URL for login token
Invalidate OAuth session after web_sessions cache expiration
Set version to 2.11
Update 2.11 release notes
Prevent wrong content type for CSS files
Improve rebase usability with the RebaseDialog
Update 2.11 release notes
MergeabilityCacheImpl: Only get needed refs
Explain online reindexing in 2.11 release
Revert marking merged or abandoned changes in related changes
Change-Id: Id915ef7316b3e721738064bb1cce97020e04296e
* stable-2.10:
Update 2.10.3 release notes
Improve the version computation for the release notes
Check reachability from R_HEADS/R_TAGS/REFS_CONFIG when creating branches
Update 2.10.3 release notes
Include submitter in ChangeMessage on submission
Support hybrid OpenID and OAuth2 authentication
Release notes for Gerrit 2.10.3
Change-Id: I03e0cbb444e9ae2090f510d6f4e49c6db5ece033
e9707d8f85 exposed OAuth authentication extension point. Using this
extension point plugins can offer OAuth2 authentications.
That is fine for new Gerrit sites, which can restrict the auth scheme
to OAuth2 only.
For the existing sites, that rely on non SSO OpenID auth scheme it
doesn't work to migrate to OAuth2 because of diverse contributors
base that use different OpenID providers. Not all OpenID providers
offer OAuth2 protocol. Particularly, widespread OpenID providers
among open source Gerrit communities are Launchpad/UbuntuOne and
FedoraProject don't offer OAuth2 protocol. To not lock out those
contributors from being able to contribute to open source Gerrit
based projects OpenID must still be supported.
With Google's shut down of their OpenID service in April 2015, big
user base is locked out from contribution to Gerrit based projects
that only support OpenID auth scheme.
The only way to still support OpenID 2.0 providers and new OAuth2
based protocol is native support for hybrid authentication scheme
in Gerrit.
This change extends OpenID auth scheme by making it aware of optional
OAuth plugin-based authentication.
When no oauth-provider plugins are deployed, OpenID auth scheme works
as usual. When OAuth provider plugins are deployed, OAuth2 providers
are offered on the OpenID login form, in addition to hard coded Yahoo!
and Launchpad OpenID providers: [1].
[1] http://imgur.com/IcCrChN
Change-Id: I6d70212f4fea5443a6322c7da683e1e943d058eb
When modifications of access rights are saved for review, a new change
is created. Now this change has a Change-Id in the commit message, so
that it's easier to manually rework the change and push further patch
sets.
Bug: issue 2817
Change-Id: I0a6399d731644bdc28147cfd8527e3b692c953da
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>