Skip to content

Harden authentication and energy-data ingestion - #21

Merged
lukefx merged 2 commits into
lukefx:mainfrom
kioku:fix/harden-ail-integration
Sep 20, 2026
Merged

lukefx merged 2 commits into
lukefx:mainfrom
kioku:fix/harden-ail-integration

Conversation

@kioku

@kioku kioku commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

AIL authentication follows remote redirects and form actions while persisting session cookies and meter data. Those inputs were previously unbounded and not restricted to AIL destinations.

  • Restrict requests, redirects, forms, and persisted cookies to approved HTTPS AIL hosts.
  • Add request timeouts, response limits, and bounded meter-data validation.
  • Recognize a remembered Keycloak session when it redirects directly to an authenticated Energy Buddy page.
  • Treat provider and transport failures as retryable instead of rejected credentials; only an unsuccessful interactive login requests reauthentication.
  • Close the client when Home Assistant setup fails and add authentication and security regression coverage.

Tests: pytest -q (41 passed); ruff check .; ruff format . --check.

@kioku
kioku force-pushed the fix/harden-ail-integration branch from baffc9c to 48f8a62 Compare September 19, 2026 15:39
Signed-off-by: Claudiu Ivan <contact@claudiu-ivan.com>
@kioku
kioku force-pushed the fix/harden-ail-integration branch from 48f8a62 to 690e4d0 Compare September 19, 2026 15:57
@kioku
kioku marked this pull request as ready for review September 19, 2026 16:04
Signed-off-by: Claudiu Ivan <contact@claudiu-ivan.com>
@lukefx

lukefx commented Sep 20, 2026

Copy link
Copy Markdown
Owner

@kioku thx a lot for the contribution! Code looks good... some minor things regarding validations but we can improve it later :D

@lukefx
lukefx merged commit d7622ef into lukefx:main Sep 20, 2026
3 checks passed
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