Anker Solix: a 403 that is not about the token spends no login
anker-solix-api v3.9.1 (2026-10-25) and ha-anker-solix 3.9.1.1 (2026-10-30).
The release is mostly PPS, F3000 and A91B2 work, and none of it reaches an
A5191. The emergency fix does. On 29 October Anker retired an endpoint by
answering it 403. Clients took every 403 for an evicted token and logged in
again on every poll, and that ended in a 24-hour IP ban, code 100041 "Hit max
login error limit" (ha-anker-solix #658, #659). This connector treated a 403
the same way. A successful login clears the backoff, so nothing would have
stopped the loop.
A refused token now costs a login only when one could help:
- A token issued less than two minutes ago was not evicted, so its refusal is
the endpoint saying no.
- If another request has already replaced the token, the retry uses that
token and no new login is made.
- An endpoint that refuses a fresh token is left alone for an hour. Its
requests still go out and fail on their own, and no further logins are
spent on it.
- Code 100041 holds the next login attempt back for an hour. More attempts
only add to the count, and only a new public IP lifts the ban early.
Already as upstream now has it: the MQTT client does not mark a topic
subscribed when its SUBACK refuses it, and a malformed message is dropped
without touching the connection. The v3.9.1 signature comment (secret[:16]
after the handshake, presetKey only for the exchange) matches
payloadcrypto.go.
Toyota: pytoyoda has nothing after 6.0.0, which e7d2ef8 ported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ea562a80a
commit
9d8636ee73
4 files changed
+196
-19
No files matched your search
@@ -14,6 +14,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// encryptedCloud is the server half of the scheme in payloadcrypto.go, written
|
||||
@@ -204,6 +205,9 @@ func TestPayloadEncryptionHandshakeFollowsLogin(t *testing.T) {
|
||||
if _, err := p.apiRequest(context.Background(), epSiteList, map[string]any{}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// An evicted token is an old one: a token refused minutes after its login
|
||||
// is taken to be the endpoint saying no (relogin), so age it first.
|
||||
p.sess.tok.issued = time.Now().Add(-72 * time.Hour)
|
||||
cloud.mu.Lock()
|
||||
cloud.rejectTok = "tok-01" // the first login's token
|
||||
cloud.mu.Unlock()
|
||||
|
||||
Reference in new issue
Block a user