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

Make API key mandatory for PI-Hole #85264

Merged
merged 9 commits into from
Jan 7, 2023

Conversation

mib1185
Copy link
Contributor

@mib1185 mib1185 commented Jan 5, 2023

Proposed change

Since pi-hole version 5.18, the API key is mandatory (home-assistant-ecosystem/python-hole#13) for every api call. This has been implemented with #84516 in HA, but the config flow was never adjusted accordingly and no config entry migration has been done.
This PR will remove the config option CONF_STATISTICS_ONLY which was the condition if user is asked for api key or not.
Further CONF_STATISTICS_ONLY is now removed from any existing configuration entry and a missing CONF_API_KEY will start the reauth flow (yes it is a new feature, but it is a requirement for this bug fix).

With this it is ensured, that every PI-Hole configuration entry has a valid api key.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Jan 5, 2023

Hey there @johnluetke, @shenxn, mind taking a look at this pull request as it has been labeled with an integration (pi_hole) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of pi_hole can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign pi_hole Removes the current integration label and assignees on the issue, add the integration domain after the command.

homeassistant/components/pi_hole/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/pi_hole/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/pi_hole/config_flow.py Outdated Show resolved Hide resolved
tests/components/pi_hole/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/pi_hole/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/pi_hole/test_init.py Outdated Show resolved Hide resolved
tests/components/pi_hole/test_init.py Outdated Show resolved Hide resolved
@balloob balloob modified the milestones: 2023.1.1, 2023.1.2 Jan 6, 2023
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MartinHjelmare MartinHjelmare merged commit ee3ab45 into home-assistant:dev Jan 7, 2023
@mib1185 mib1185 deleted the pi_hole/add-reauth branch January 7, 2023 11:23
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2023
@balloob
Copy link
Member

balloob commented Jan 9, 2023

I'm unable to cherry-pick this PR due to it being created on top of #84803, which is a breaking change and should not be picked into a hot fix.

If you want this fix in a hot fix, open a new PR with the change against rc.

@balloob balloob removed this from the 2023.1.2 milestone Jan 9, 2023
@mib1185
Copy link
Contributor Author

mib1185 commented Jan 14, 2023

I'm unable to cherry-pick this PR due to it being created on top of #84803, which is a breaking change and should not be picked into a hot fix.

If you want this fix in a hot fix, open a new PR with the change against rc.

have done so in #85885

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants