Search code examples
gerrit

how to get http password in gerrit rest api


I want to look up some review comments on Gerrit via the REST API. I tried a few methods, including Gerrit's official documentation, and nothing changed the fact that I was an anonymous user. The authentication configuration in the gerrit.config is as follow:

[auth]
    type = LDAP
    gitBasicAuthPolicy = LDAP

I'm calling rest api by curl

$ curl --digest --user LDAP_user:LDAP_password \
      https://gerrit.example.com/a/path/to/api

It does not work.


Solution

  • HTTP_PASSWORD maybe the answer which can be found in account settings.

    And then

    curl -u USR_NAME:HTTP_PASSWORD https://gerrit.XX.com/a/path/to/api