Skip to content

refactor(examples): improve code quality and safety across examples#12

Merged
appleboy merged 1 commit intomainfrom
worktree-example
Mar 28, 2026
Merged

refactor(examples): improve code quality and safety across examples#12
appleboy merged 1 commit intomainfrom
worktree-example

Conversation

@appleboy
Copy link
Copy Markdown
Member

Summary

  • Add HTTP server read/write/idle timeouts to go-webservice to prevent resource exhaustion (slowloris)
  • Log exception details in python-cli cached token validation instead of silently swallowing errors
  • Extract duplicated scopes list into SCOPES constant in python-cli to prevent drift between auth and re-auth
  • Simplify python-m2m response reading from 14-line streaming chunk iterator to simple http.get()
  • Extract triplicated symlink/ownership security guard into validate_cache_file() helper in bash-cli

Test plan

  • cd go-webservice && go build ./... — confirms compilation
  • python3 -c "import ast; ast.parse(open('python-cli/main.py').read())" — syntax check
  • python3 -c "import ast; ast.parse(open('python-m2m/main.py').read())" — syntax check
  • bash -n bash-cli/main.sh — syntax check
  • Manually test each example against a running AuthGate instance

🤖 Generated with Claude Code

- Add HTTP server read/write/idle timeouts to go-webservice to prevent slowloris attacks
- Log exception details in python-cli token validation instead of silently swallowing
- Extract duplicated scopes list into SCOPES constant in python-cli
- Simplify python-m2m response reading from streaming chunk iterator to simple get
- Extract triplicated symlink/ownership guard into validate_cache_file helper in bash-cli

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@appleboy appleboy merged commit ccc738a into main Mar 28, 2026
4 checks passed
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.

1 participant