fix: Add trailing slash to SITE_URL and enhance debug logging (v0.9.1)

Fix 1: SITE_URL trailing slash normalization
- IndieLogin.com requires client_id URLs to have trailing slash for root domains
- Added automatic normalization in load_config() after env loading
- Added secondary normalization after config overrides (for test compatibility)
- Fixes "client_id is not registered" authentication errors
- Updated redirect_uri construction to avoid double slashes

Fix 2: Enhanced httpx debug logging
- Added detailed request logging before token exchange POST
- Added detailed response logging after token exchange POST
- Shows exact HTTP method, URL, headers, and body for troubleshooting
- All sensitive data (tokens, verifiers) automatically redacted
- Supplements existing _log_http_request/_log_http_response helpers

Version: 0.9.1 (PATCH - bug fixes)
- Updated __version__ in starpunk/__init__.py
- Added CHANGELOG entry for v0.9.1

Tests: 486/514 passing (28 pre-existing failures from v0.8.0)
- No new test failures introduced
- Trailing slash normalization verified in config
- Debug logging outputs verified

Related: IndieLogin.com authentication flow
Following: docs/standards/git-branching-strategy.md

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-19 16:27:13 -07:00
parent ebca9064c5
commit ba0f409a2a
4 changed files with 57 additions and 8 deletions

View File

@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.9.1] - 2025-11-19
### Fixed
- **IndieAuth client_id trailing slash**: Added automatic trailing slash normalization to SITE_URL
- IndieLogin.com spec requires client_id URLs to have trailing slash for root domains
- Fixes "client_id is not registered" authentication errors
- Normalizes https://example.com to https://example.com/
- **Enhanced debug logging**: Added detailed httpx request/response logging for token exchange
- Shows exact HTTP method, URL, headers, and body being sent to IndieLogin.com
- Helps troubleshoot authentication issues with full visibility
- All sensitive data (tokens, verifiers) automatically redacted
### Changed
- SITE_URL configuration now automatically adds trailing slash if missing
## [0.9.0] - 2025-11-19
### Added