Updates to use bearer auth#260
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #260 +/- ##
==========================================
- Coverage 28.25% 26.25% -2.00%
==========================================
Files 35 35
Lines 5596 6163 +567
Branches 778 863 +85
==========================================
+ Hits 1581 1618 +37
- Misses 3938 4467 +529
- Partials 77 78 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@jasonacox This is a draft of two changes:
Arguably these could be split out, but my general approach is:
|
|
Thanks for pointing me here, @Nexarian. I've now read through all three commits in detail. Here's my review: What's GoodThe proto schema work is solid — going from 234 to 792 lines with proper APK-verified enums, field numbers, and message types is exactly the ground-truth correction we need. The Update after APK analysis (see #305 comment): I ran targeted string searches on the Tesla One APK Suggestions for StagingAs I outlined on #305, I think this should land in stages rather than one big merge:
Splitting it this way lets us test each layer independently and gives users a safe upgrade path. Specific Code Notes
After posting on #305 and thinking through this more carefully, I want to add some harder feedback here too — because this PR is where the code lives. The Powerwall Testing Gap 🔴You can't test any of this on a Powerwall — you don't have one. That's not a criticism, it's a constraint that has to shape how we merge this work. pypowerwall's core audience is Powerwall users (TEG, PW2, PW3, PW+), and changes to the auth path and query layer affect all of them. Before any of these stages land in
Please add a "looking for Powerwall testers" callout to the PR description. That's not optional — it's the gate. Coverage: 5.76% on 686 Changed Lines ❌That's not mergeable for a change this deep in the auth and query stack. The critical paths need tests — at minimum the bearer login flow, the signed query construction, and the AuthEnvelope wrapping. I know writing tests for TEDAPI is harder than most things in this codebase, but this is the tradeoff for touching foundational code. New Endpoints Need Hardware Gating
|
I don't know. Can you examine the Tesla One APK and see what it uses? |
|
Good question, @Nexarian — and I should have been more precise about what I can and can't determine here. From the code in this PR: AuthEnvelope wrapping is bearer-mode-only by design. Your if self.auth_mode == "bearer":
auth_env = tedapi_pb2.AuthEnvelope()
auth_env.payload = pb.message.SerializeToString()
auth_env.externalAuth.type = 1 # PRESENCE
data = auth_env.SerializeToString()
else:
data = pb.SerializeToString() # raw Message, no wrappingSame pattern in From the APK: I can only see one auth path — bearer. The Tesla One app is a mobile client that authenticates via The honest answer: I can't determine from the APK alone whether the new What we do know:
I don't have access to a Powerwall or inverter to test this. If you can try sending a signed query via basic auth (without AuthEnvelope) to your hardware, that would close the gap. If it fails, then AuthEnvelope is universal for the new query format and the PR needs to wrap in both modes. — Sam ⚡ |
No description provided.