Auth methods - #10
Merged
Merged
Auth methods#10
Conversation
pfRest v2 exposes three mutually-exclusive auth schemes; the v2 rewrite only wired up the API key. This adds the other two. Client (pypfsense): - `Client(url, session, *, auth_method, api_key|username/password, verify_ssl)`. api_key -> `x-api-key`; basic -> `Authorization: Basic`; jwt -> a Bearer token minted from `POST /api/v2/auth/jwt` (with Basic), cached, and re-minted + retried once on a 401. Header-only, so no deprecated `aiohttp.BasicAuth`. - `client_from_config(url, session, data, verify_ssl)` builds the right client from a config-entry mapping; used by setup and the config flow. Config flow (VERSION 3 -> 4): - `async_step_user` is now a menu (API key / username+password / JWT); each method has its own form. Reauth re-prompts for whichever credentials the entry's `auth_method` needs. - `async_migrate_entry` v3 -> v4 stamps `auth_method: api_key` on existing entries (unique id unchanged, entities re-attach). Strings gain the menu + per-method steps; `invalid_auth` text is now method-neutral and mentions enabling the method under System > REST API > Settings. Tests updated for the new signature and flow; added basic/jwt header, jwt-refresh, missing-credential, and v3->v4 migration cases. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the username+password and JWT authentication methods to the config flow (see previous commit). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
action-gh-release updates the existing release to attach the zip; pass back its current prerelease/draft flags so a pre-release isn't silently promoted to a full release. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🎉 Thank you for contributing to SkyRadar Fusion! Your Pull Request has been received. Our automated tests (Hassfest, Ruff, etc.) will run shortly. If anything fails, don't worry—just check the logs and update your branch! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.