Skip to content

Handle forbidden auth check with token user ID - #1159

Open
davidrimshnick wants to merge 2 commits into
bachya:devfrom
davidrimshnick:agent/handle-authcheck-403
Open

Handle forbidden auth check with token user ID#1159
davidrimshnick wants to merge 2 commits into
bachya:devfrom
davidrimshnick:agent/handle-authcheck-403

Conversation

@davidrimshnick

Copy link
Copy Markdown

Describe what the PR does:

SimpliSafe can return 403 Forbidden from api/authCheck even after successfully issuing a valid access token. When that specific response occurs, decode the http://simplisafe.com/uid claim from the newly issued access token and use it as the account user ID.

All other HTTP failures continue to propagate unchanged, and a 403 still propagates when the token is malformed or does not contain a usable user ID.

Does this fix a specific issue?

Related to home-assistant/core#149151

Checklist:

  • Confirm that one or more new tests are written for the new functionality.
  • Run tests and ensure everything passes (with 100% test coverage).
  • README update is not needed because this changes no public API.

Testing:

  • pytest --cov simplipy tests: 97 passed, 100% coverage
  • Ruff formatting and lint: passed
  • isort: passed
  • mypy: passed

@github-actions

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently, so it has automatically been marked as stale and will be closed if no further action occurs within 7 days. Thank you for your contributions.

@github-actions github-actions Bot added the stale There has not been activity on this issue or PR for some time label Aug 18, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aa1b6e0) to head (79bb8fc).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #1159   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1024      1041   +17     
=========================================
+ Hits          1024      1041   +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bachya bachya removed the stale There has not been activity on this issue or PR for some time label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants