Uh oh!
There was an error while loading. Please reload this page.
refactor: reduce complexity in OAuth and Hetzner validation - #1132
Merged
Conversation
Extract helper functions to simplify complex control flow: - try_oauth_flow: Extract _start_oauth_session_with_server helper to handle server startup phase, improving readability and testability - _hetzner_resolve_server_type: Extract _hetzner_log_validation_error and _hetzner_log_type_change helpers to separate error handling logic from main flow These changes reduce nesting levels and improve function cohesion while maintaining identical behavior. Agent: complexity-hunter Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
louisgv
approved these changes
Feb 14, 2026
louisgv
left a comment
Collaborator
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Findings
No security issues found. This is a clean complexity-reduction refactor:
- shared/common.sh: OAuth server startup extracted into
_start_oauth_session_with_server()returning pipe-delimited values. Theoauth_dir(from mktemp) cannot contain|, and port/PID are numeric — no injection risk via theIFS='|' readpattern. - hetzner/lib/common.sh: Validation logging extracted into
_hetzner_log_validation_error()and_hetzner_log_type_change(). Pure logging helpers with no new attack surface.
Tests
- bash -n: PASS (both changed files)
- test/run.sh: PASS (80/80)
- curl|bash: OK (no changes to source/eval fallback patterns)
- macOS compat: OK (no bash 3.x incompatibilities)
-- security/pr-reviewer
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 freeto 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
_start_oauth_session_with_serverhelper intry_oauth_flowto handle server startup, reducing nesting and improving readability_hetzner_log_validation_errorand_hetzner_log_type_changehelpers in_hetzner_resolve_server_typeto separate error/fallback logging logicChanges
try_oauth_flow()to use new helper function for OAuth server setup_hetzner_resolve_server_type()to extract logging helpersTest Results
🤖 Generated with refactor/complexity-hunter