Skip to content

Support for htpasswd-based HTTP authentication in ai-code-review plugin #7

@yangbin1265712

Description

@yangbin1265712

I’m currently integrating the ai-code-review plugin with a Gerrit 3.9.x instance that uses HTTP Basic Authentication (via Apache + htpasswd).
Everything works fine on the Gerrit web login — Gerrit can automatically create external_id records for new users under this authentication model.

However, the ai-code-review plugin reports an error saying that it cannot find the external_id for the review user.
This happens even when the same user successfully logs into Gerrit via the web interface.

It seems that the plugin assumes external IDs are managed by Gerrit’s internal authentication mechanisms (LDAP, OAuth, etc.),
and does not fully support accounts that were auto-created via HTTP Basic Auth (htpasswd).

Proposal:
Would it be possible for ai-code-review to support HTTP-authenticated users (htpasswd model) — for example, by

  • allowing manual configuration of the review user via username only, or
  • resolving users based on username/email, not strictly on external_id?

This would make ai-code-review compatible with many production Gerrit setups using simple Apache BasicAuth.

Thanks a lot for your work maintaining this plugin — it’s a very valuable addition to Gerrit.

The attachment is the Gerrit backend log output during git push origin HEAD: refs/for/master testing

gerrit_error_log.txt

Environment:

  • Gerrit version: 3.9.1
  • ai-code-review version: 3.9
  • Java: OpenJDK 17
  • Auth: Apache + htpasswd + HTTP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions