Skip to content
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

Create HA issue if OPNsense Firmware below min version #178

Conversation

Snuffy2
Copy link
Collaborator

@Snuffy2 Snuffy2 commented Sep 10, 2024

2024-09-09_20-10-05

screenshot using fake firmware version

@Snuffy2 Snuffy2 force-pushed the Show-Repair-and-Config-Flow-if-OPNsense-below-min-version branch from a1099e2 to cc60608 Compare September 10, 2024 00:35
@Snuffy2 Snuffy2 marked this pull request as ready for review September 10, 2024 00:36
@Snuffy2
Copy link
Collaborator Author

Snuffy2 commented Sep 10, 2024

@alexdelprete if you're good with it, I'd say that we merge this PR and then put out v0.2.1
Feel free to put out the release if you have time to.

@alexdelprete
Copy link
Collaborator

Great. Anything special to write in the notes or can I simply use auto-generation for the release?

@alexdelprete
Copy link
Collaborator

alexdelprete commented Sep 10, 2024

I was also thinking, now that you added this minimum fw check, if it's possible to check the privileges of the used account and warn the user in case it's not an admin. I don't know if there's an API for that, probably doable via the XMLrpc?

With these 2 checks, we could prevent users from opening issues for those two pre-requirements (e.g. see #175)

@alexdelprete alexdelprete merged commit 2e47e2f into travisghansen:main Sep 10, 2024
2 checks passed
@Snuffy2
Copy link
Collaborator Author

Snuffy2 commented Sep 10, 2024

It generates an Error if any of the REST queries return a 403 saying there are permission issues.

        elif response.status_code == 403:
            _LOGGER.error(
                f"Permission Error in {inspect.currentframe().f_back.f_code.co_qualname}. Path: {path}. Ensure the OPNsense user connected to HA has full Admin access."
            )

I might be able trigger a similar error in the get_proxy method to represent XMLRPC permission issues, but I'd need to test more.

@Snuffy2 Snuffy2 deleted the Show-Repair-and-Config-Flow-if-OPNsense-below-min-version branch September 10, 2024 01:07
@alexdelprete
Copy link
Collaborator

alexdelprete commented Sep 10, 2024

Sorry, I was referring to the config_flow, in the initial setup phase.

If you check #175 the user has a weird situation...the user seems to have the admin privileges, but the symptoms indicate it actually has a privilege problem.

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