-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Supervisor token authentication from landing page #5321
Conversation
The landing page provides the Supervisor token as authentication, so consider the landingpage as new enough too.
📝 WalkthroughWalkthroughThe changes involve modifications to the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Middleware
participant HomeAssistant
Client->>Middleware: Send request
Middleware->>HomeAssistant: Check version
alt Version is LANDINGPAGE
Middleware-->>Client: Allow request
else Version is new enough
Middleware-->>Client: Allow request
else Version is not valid
Middleware-->>Client: Reject request
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Check host network connectivity and offer DNS alternatives in case host internet is not available. This allows users with broken DNS setup to configure the host network with a working DNS. Requires home-assistant/supervisor#5321.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- supervisor/api/middleware/security.py (2 hunks)
🔇 Additional comments (2)
supervisor/api/middleware/security.py (2)
12-13
: LGTM: Import statement for LANDINGPAGE added.The addition of the
LANDINGPAGE
import fromsupervisor.homeassistant.const
aligns with the PR objective of enabling Supervisor token authentication from the landing page.
Line range hint
1-338
: Summary: Changes align with PR objective, minor fix needed.The modifications to the
security.py
file successfully implement the ability to authenticate Supervisor tokens from the landing page. This is achieved by:
- Importing the
LANDINGPAGE
constant.- Modifying the
core_proxy
middleware to allow requests when the Home Assistant version isLANDINGPAGE
.These changes align well with the PR objective and maintain backwards compatibility. The existing security measures remain intact, ensuring that the new functionality doesn't compromise the system's security.
However, there's a minor indentation issue in the
core_proxy
method that needs to be corrected to prevent syntax errors.Once the indentation is fixed, the implementation looks good to merge.
To ensure that the
LANDINGPAGE
constant is correctly defined and imported, please run the following verification script:
Check host network connectivity and offer DNS alternatives in case host internet is not available. This allows users with broken DNS setup to configure the host network with a working DNS. Requires home-assistant/supervisor#5321.
Check host network connectivity and offer DNS alternatives in case host internet is not available. This allows users with broken DNS setup to configure the host network with a working DNS. Requires home-assistant/supervisor#5321.
Proposed change
The landing page provides the Supervisor token as authentication, so consider the landingpage as new enough too.
This will enable network configuration (e.g. DNS) from the landing page.
Type of change
Additional information
Checklist
ruff format supervisor tests
)If API endpoints or add-on configuration are added/changed:
Summary by CodeRabbit
New Features
Bug Fixes