feat: add remaining Authentication API endpoints - #133
Merged
Merged
Conversation
Adds Get-PiHoleAuthStatus (GET /auth), Get-PiHoleAuthTotp (GET /auth/totp), and New-PiHoleAppPassword (GET /auth/app), completing the Authentication API area. Get-PiHoleAuthStatus's -Password is optional, unlike every other function in the module: its real value is checking whether a Pi-hole requires a login at all for the calling client, which only works when called without credentials. Passing -Password instead checks the status of a real login. New-PiHoleAppPassword only generates a candidate password/hash pair - confirmed via testing that it has no effect, including no session invalidation, until the returned hash is explicitly applied via config, despite the API's own description text suggesting otherwise. Co-Authored-By: Claude Sonnet 5 <[email protected]>
# Conflicts: # docs/EXAMPLES.md
Picks up DHCP's examples alongside the Authentication ones added on this branch, and refreshes stale stats/history output with fresh captured data. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Not important enough to carry alongside the other Authentication endpoints - app passwords are a niche credential-management feature, unlike Get-PiHoleAuthStatus/Get-PiHoleAuthTotp which are simple status checks. Get-PiHoleAuthStatus and Get-PiHoleAuthTotp remain. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This was referenced Oct 1, 2026
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.
Summary
Get-PiHoleAuthStatus(GET /auth) andGet-PiHoleAuthTotp(GET /auth/totp), rounding out the Authentication API area with its two simple status-check endpointsGet-PiHoleAuthStatus's-Passwordis optional, unlike every other function in the module: its real value is checking whether a Pi-hole requires a login at all for the calling client, which only works when called with no credentials. Passing-Passwordinstead checks the status of a real loginNew-PiHoleAppPassword/GET /auth/appwas dropped from this PR - niche credential-management feature, not worth carrying alongside these two simple status checks)Test plan
Get-PiHoleAuthStatuswithout-Passwordcorrectly surfaces a 401 on this test server (which requires login for API clients)🤖 Generated with Claude Code