18 Commits

Author SHA1 Message Date
David Pursehouse
7f04237529 Merge branch 'stable-2.15'
* stable-2.15:
  ProjectTagsScreen: Base visibility on the create refs/tags/* permission
  Upgrade JGit to 4.9.4.201809090327-r
  Upgrade JGit to 4.7.3.201809090215-r
  Set version to 2.14.13-SNAPSHOT
  ProjectTagsScreen: Base visibility on the create refs/tags/* permission
  Set version to 2.15.4-SNAPSHOT
  Set version to 2.14.12
  [project.config] Allow to add commentLink entries
  ElasticVersionTest: Align tested versions w/ ElasticContainer last ones
  Assume correct relative or absolute URL from Weblink provider
  AbstractSubmit: Remove redundant assertion about null IOException
  ListMailFilter: Fix operator precedence warning raised by ErrorProne
  ListProjects: Fix operator precedence warning raised by ErrorProne
  ChangeBundle: Fix operator precedence warning raised by ErrorProne
  Bazel: fix error_prone_warnings_toolchain rule
  Elastic{Index|ReindexIT} Remove tests for 6.2 and 6.3
  ElasticVersionTest#version6: Add missing test for V6_4
  Allow more email RFC accepted chars in username
  Make inheritance of receive.maxObjectSizeLimit optional
  Allow to inherit receive.maxObjectSizeLimit from parent project
  RestApiServlet: Skip capability check for administrators
  CreateAccount: Simplify error message when username is invalid
  Bazel: Provide toolchain with activated error prone warnings
  Use ExternalId.isValidUsername instead of ExternalId.USER_NAME_PATTERN_REGEX
  Move regular expressions for user name from Account to ExternalId
  AccountIT: Add basic tests for creating user with {in}valid username
  Revert refactoring of Account.USER_NAME_PATTERN
  Fix code that caused changes to break in MS Edge
  Add support for Elasticsearch 6.4.0
  Upgrade elasticsearch-rest-client to 6.4.0
  ElasticVersion: Say 'Unsupported' rather than 'Invalid'
  ElasticQueryAdapter: Move isV6 method to ElasticVersion and simplify
  Account.java: introduce compiled pattern and use where applicable
  Optimize USER_NAME_PATTERN string and its usage
  ElasticContainer: Test against Elasticsearch version 5.6.11
  rest-api-accounts: Fix documentation of "Get Active" response
  GetCapabilities#CheckOne: Return json content type
  ConfigSuite: Instantiate class via getDeclaredConstructor()

Change-Id: I08136f1d27da08ce8a523f2dc062316723e17c45
2018-09-12 13:27:01 +09:00
Marco Miller
c2114ac086 ProjectTagsScreen: Base visibility on the create refs/tags/* permission
Before this change, the Tags creation form fields were visible also if
either refs/* or refs/head/* was allowed for Create Reference. This fix
limits that visibility to a create refs/tags/* permission solely, as per
current documentation anyway. isAdmin() still also makes the panel
visible, overriding potentially missing ref creation permissions.

Create Annotated Tag is still also required for the user to be able to
use the optional Annotation field. In this case, the created tag is no
longer lightweight but becomes annotated. Both kinds of tags are still
supported through such a single Tags creation panel or form, thus the
need to allow both permissions even if aiming for annotated tags only.
(Command line does not have that design limitation indeed.)

Bug: Issue 9689
Change-Id: Ib7c3f1a0fdebaee30da371cc64850fa6d6d8dd05
2018-09-10 17:12:40 -04:00
Han-Wen Nienhuys
33ef2b8754 Expose names and URLs for invisible groups in GetAccess
This sounds counter-intuitive, but this is feature compatible with the
GWT UI, which uses the GWT RPC interface.

Change-Id: I53a0f00684b33634883aaa9ecb7f2fd294456f5f
2018-02-15 14:13:44 +01:00
Alice Kober-Sotzek
a4c07f4efa Fix broken layout of /access/ REST API documentation
Because of the missing |, the description of the 'groups' field ended up
in a previous column. What was worse is that the field name
'configWegLinks' was displayed as description of the 'groups' field and
its own description was omitted.

Change-Id: I8a764c845c02c73ce5bb6e1b6c2d2c6c9176d3e8
2018-02-12 10:55:38 +01:00
Han-Wen Nienhuys
663d1890d2 Provide browsing URL for GetAccess
This is so the PolyGerrit admin screen can show a link to history like
the GWT admin screen does.

Change-Id: Ida03b41469a8a785fbc0f37313565a169ce01b93
2018-01-31 15:56:19 +01:00
Han-Wen Nienhuys
e2258f6ee8 Add a groups map ProjectAccessInfo.
This lets the access UI in PolyGerrit show group names without doing
many roundtrips to discover the names.

Change-Id: Iaeb652776c80401d115038dd4abdb0342bfc47d7
2017-08-30 16:58:00 +02:00
David Pursehouse
f3346faf27 Merge branch 'stable-2.13'
* stable-2.13:
  Update 2.13.2 release notes
  Fix minor typo in projects REST API documentation
  Fix double Repository.close() in MergeOp
  Fix malformed account suggestions

Change-Id: I3d785e99cb669a11c95bc6f6c991232f41977cd9
2016-10-03 13:32:09 +09:00
David Pursehouse
59c8dc5a07 Fix minor typo in projects REST API documentation
Change-Id: I803f63f48847372e666bd2f1ba2697549d63495d
2016-10-02 23:53:16 +00:00
Edwin Kempin
62c156857e Rename 'Push Annotated/Signed Tag' permission to 'Create Annotated/Signed Tag'
Each tag type requires a special permission for the tag creation:
- Lightweight tags require 'Create Reference'
- Annontated tags require 'Push Annotated Tag'
- Signed tags require 'Push Signed Tag'

This naming is inconsistent and may be confusing. E.g. whether tags
can be updated is controlled by the 'Push' permission on 'refs/tags/*'
and not by the 'Push Annotated/Signed Tag' permission, as some users
might expect.

This change includes a schema migration that renames the permissions
for creating annotated/signed tags.

Permission rules in project.config that use the old names are still
respected. They are automatically converted when the project config is
saved the next time. This is needed so that multi-master sites can do
a multi-step-migration:

1. First upgrade all hosts to the new binary:
   Projects may still contain permissions with the old names,
   new permissions are saved with the new names.
2. Run a background job on all hosts that migrates the permissions for
   all projects to the new names:
   Projects do not contain permissions with the old names,
   new permissions are saved with the new names.
3. Upgrade all hosts to a binary that doesn't respect the old names
   anymore.

The migration for schema 130 is rewritten because ProjectConfig no
longer allows to change the force flag for 'pushTag' without
converting it to 'createTag'.

Change-Id: I839be24f82a908b5184f15e746f3588a0d397b7e
Signed-off-by: Edwin Kempin <ekempin@google.com>
2016-09-08 13:50:04 +09:00
David Pursehouse
56bf1cb803 Make Content-Type examples consistent with actual server output
Change-Id: I32d9d66d894d9dbb9cb8b7748b8466c8b1c98f22
2015-01-06 06:54:12 +00:00
David Pursehouse
ae36719784 Don't limit tables to 50% width in REST API documentation
Fixing the width of the tables to 50% makes it difficult to read
entries that have long descriptions.

Change-Id: Ic080c684bc5cf009d47149b2839390c66f3e9af0
2014-11-25 18:35:53 +09:00
David Pursehouse
76af7f8bb5 Add missing "JSON Entities" section title in rest-api-access.txt
Change-Id: I3f66431c5003b6f4a44869743e7b4a5300985c96
2014-11-25 17:13:11 +09:00
Shawn Pearce
21a6c21717 Update project REST API documentation to remove kind, add state
The kind field is no longer included in ProjectInfo.
Document the state enum that is usually included.

Change-Id: I86a75fde48f7147ac30e1ee23a11e6475366ab48
2014-04-23 12:35:10 -07:00
Yuxuan 'fishy' Wang
61698b14e0 Use the new section title style in Asciidoctor.
We previous use the section title style like:

Section level 1
===============

Section level 2
---------------

Which have a problem in Asciidoctor that the number of "="s or "-"s must match
the number of characters in the header exactly, as a result it's easy to make
mistakes while changing the titles. Asciidoctor provides a better style like:

= Section level 1

== Section level 2

So we switched to this style.

Also fixed a bug in replace_macros.py, which will not cause any problem in the
old style.

Change-Id: I811dd7238735d98f662767c17086152cd69aea02
2013-12-20 12:55:51 -08:00
Yuxuan 'fishy' Wang
d85b687536 Bypass the rendering differences in AsciiDoctor.
AsciiDoctor have different understanding of [verse] with asciidoc, causing some
rendering differences. To get similar result with asciidoc, we use something
else instead of [verse] now.

Screenshots:
before:
http://imgur.com/JKMdBiv
after:
http://imgur.com/yFVvVac

Change-Id: I14e84f0e998e1e87b633681e8028ad657bde07e4
2013-11-15 11:47:46 -08:00
Yuxuan 'fishy' Wang
99cb68dec4 Added searchbox to documentation.
This provides the entry point of the documentation search feature.

Change-Id: Iea2b707995c0e042829db509927384dcec7aaf43
2013-11-05 12:49:43 -08:00
Edwin Kempin
ca192a6836 Include in ProjectAccessInfo whether the calling user is project owner
Change-Id: I1e1c7e887e88cbfd3a9e390c71cb1def3def18e8
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-07-12 13:21:15 +02:00
Edwin Kempin
87340e6bb7 Support retrieving project access rights via REST
By GET on /access/?project=<project-name> it is now possible to
retrieve the access rights of a project via REST.

Having /access/ instead of /projects/<project-name>/access allows to
retrieve the access rights for multiple projects at once by specifying
the 'project' option multiple times.

In future this REST endpoint may be extended to only return the access
rights for a certain user or group by supporting a 'user' and 'group'
option.

Change-Id: Ibc57b2c006472a9f70699ae69e72f60317819bef
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-06-26 03:22:26 +02:00