Fix Perforce authentication and errors on 2026.1.
Review Request #15133 — Created June 23, 2026 and submitted
Perforce 2026.1 was a big security-by-default release, which focused on
an increased default security level for authentication, no password-less
access, no set-password-on-first-connect behavior, and other changes.This requires some changes on our end. Specifically, we now need to
ensure we do an explicit login when we connect (and after we've verified
we've successfully connected), as thep4.passwordwe set will no
longer apply otherwise.The list of authentication error strings was updated to handle "Password
invalid", which may have already existed but was not being handled by
our code.Authentication is now only performed once a connection is established.
This avoids an attempt at a login when we've hit an outage or cert error
(which would trigger a "not connected" P4 error).The unit test database has been updated for p4d 2026.1, and as part of
this, each user had to be given a password. These areguest12345,
samwise12345, anddavid12345(for those respective users). The unit
tests have been updated to set these credentials for the connection
where appropriate.
Unit tests pass with p4d 2026.1, p4 2026.1, and p4python 2026.1.
Tested the code changes with the previous 2021.2 database and matching
versions ofp4d,p4, andp4python. Unit tests passed.Manually tested review requests and diffs with a local P4 server, using
both the 2021.2 and 2026.1 versions, without ticket auth (using the new
password login flow). These failed on 2026.1 before, but worked with the
new changes.
| Summary | ID |
|---|---|
| d2abc3be200eb6d14d1f378c0ea208dc9eaed369 |
| Description | From | Last Updated |
|---|---|---|
|
Can we add tests for the _AUTH_ERROR_RE strings resulting in AuthenticationError? |
|
|
|
Can we put this on release-7.x? We'll want to be able to run tests there. |
|
|
|
Can we call self.login() here so we get the logging that it does? |
|
|
|
I know some versions of p4python have added prefixes to errors. Can we use .search(error) instead of .match()? |
|
- Change Summary:
-
- Added more authentication errors, and tests for some of them (a few would involve too much work to do right now).
- Added a missing password for the stunnel tests.
- Commits:
-
Summary ID 0c835eadcee5a2476d285cceccf640d619f8eddd d2abc3be200eb6d14d1f378c0ea208dc9eaed369 - Diff:
-
Revision 2 (+194 -58)