Skip to content

feat: propagate ALL_PROXY to HTTP_PROXY/HTTPS_PROXY#74

Merged
yimsk merged 9 commits intodevelopfrom
feat/issue-69
Jan 2, 2026
Merged

feat: propagate ALL_PROXY to HTTP_PROXY/HTTPS_PROXY#74
yimsk merged 9 commits intodevelopfrom
feat/issue-69

Conversation

@yimsk
Copy link
Copy Markdown
Contributor

@yimsk yimsk commented Jan 2, 2026

Summary

  • Propagate ALL_PROXY env var to HTTP_PROXY/HTTPS_PROXY since Go's net/http ignores ALL_PROXY
  • Add tests for proxy propagation (5 test cases)
  • Refactor parseFlags switch to use tagged case syntax

Closes #69

Changes

  • cmd/claws/main.go: Add propagateAllProxy() function
  • cmd/claws/proxy_test.go: New test file with table-driven tests

Notes

  • Only uppercase env vars supported (consistent with Go stdlib)
  • Propagation skipped for --help/--version
  • Existing HTTP_PROXY/HTTPS_PROXY values are preserved

yimsk added 8 commits January 2, 2026 09:45
Extend proxy support based on issue #69 feedback:
- Propagate ALL_PROXY to both HTTP_PROXY and HTTPS_PROXY
- Auto-configure NO_PROXY for AWS credential endpoints:
  - 169.254.169.254 (EC2 IMDS)
  - 169.254.170.2 (ECS Task Role)
  - 169.254.170.23 (EKS Pod Identity)
- Preserve existing NO_PROXY entries, only add missing endpoints

Refs #69, #67
- NO_PROXY now only includes EC2 IMDS (169.254.169.254) by default
- ECS/EKS endpoints can be added via config (TODO #67)
- Remove proxy URL from log output to avoid credential exposure
configureNoProxy() now runs independently when any proxy is set,
not tied to ALL_PROXY propagation. Cleaner separation of concerns.
@claude

This comment was marked as resolved.

@claude
Copy link
Copy Markdown

claude Bot commented Jan 2, 2026

Code Review

Thank you for this PR! Overall implementation is solid with excellent test coverage.

Strengths

  • Well-tested with 6 comprehensive test cases covering all edge cases
  • Clean refactoring of switch statement to tagged case syntax
  • Good documentation and error handling
  • Non-intrusive design preserving existing env vars

Issues & Suggestions

1. Discrepancy with Issue #69 (Medium Priority)

Issue #69 states: propagate ALL_PROXY to HTTPS_PROXY only (since AWS uses HTTPS). Your implementation propagates to both HTTP_PROXY and HTTPS_PROXY. Was this intentional? Please clarify in PR description.

Location: cmd/claws/main.go:191-197

2. Misleading PR Note (Low Priority)

PR mentions "Propagation skipped for --help/--version" but this happens automatically since parseFlags() exits early. Consider removing this note or adding code comment for clarity.

Location: cmd/claws/main.go:22-24

3. Test Documentation (Very Low Priority)

The lowercase all_proxy test serves as documentation rather than regression prevention. Consider adding a comment noting this.

Location: cmd/claws/proxy_test.go:58-62

Security & Performance

  • No security concerns
  • No performance concerns (O(1) at startup)

Best Practices

All good: table-driven tests, proper isolation, helper functions, error handling

Additional Suggestions

  1. Clarify HTTP vs HTTPS decision with issue author
  2. Consider integration test for call order in main()
  3. Minor: match ordering between code and help text (HTTPS then HTTP vs HTTP then HTTPS)

Summary

Well-implemented with excellent tests. Main question is HTTP_PROXY necessity. Once clarified, ready to merge!

@yimsk yimsk merged commit 329c285 into develop Jan 2, 2026
5 checks passed
@yimsk yimsk deleted the feat/issue-69 branch January 2, 2026 10:18
This was referenced Jan 2, 2026
yimsk added a commit that referenced this pull request Jan 2, 2026
* Align naming conventions with AWS CLI (#71)

* Align registry names with AWS CLI conventions

Rename 7 services to match AWS CLI naming:
- computeoptimizer → compute-optimizer
- cognito → cognito-idp
- config → configservice
- costexplorer → ce
- eventbridge → events
- macie → macie2
- sfn → stepfunctions

Old names preserved as aliases for backward compatibility.

Closes #65

* Fix pseudo-ARN prefix to match registry service name (ce)

* Add comment explaining pseudo-ARN format for Cost Explorer

* Rename directories to align with AWS CLI conventions

- Service dirs: costexplorer→ce, eventbridge→events, sfn→stepfunctions,
  cognito→cognito-idp, config→configservice, macie→macie2,
  computeoptimizer→compute-optimizer, servicequotas→service-quotas,
  licensemanager→license-manager, networkfirewall→network-firewall
- Resource dirs: hyphenate compound names (e.g., loggroups→log-groups)
- Update imports and ARN mappings

Closes #65

* Rename bedrock dirs to kebab-case for AWS CLI consistency

* Fix DAO error strings and deduplicate client helpers

* Fix error strings and deduplicate client helpers

* Fix package names to match directory names (events, stepfunctions)

* Add develop branch to CI triggers

* feat: propagate ALL_PROXY to HTTP_PROXY/HTTPS_PROXY (#74)

* feat: support ALL_PROXY environment variable (#69)

* feat: propagate ALL_PROXY to HTTP_PROXY and configure NO_PROXY

Extend proxy support based on issue #69 feedback:
- Propagate ALL_PROXY to both HTTP_PROXY and HTTPS_PROXY
- Auto-configure NO_PROXY for AWS credential endpoints:
  - 169.254.169.254 (EC2 IMDS)
  - 169.254.170.2 (ECS Task Role)
  - 169.254.170.23 (EKS Pod Identity)
- Preserve existing NO_PROXY entries, only add missing endpoints

Refs #69, #67

* fix: default NO_PROXY to IMDS only and remove proxy value from logs

- NO_PROXY now only includes EC2 IMDS (169.254.169.254) by default
- ECS/EKS endpoints can be added via config (TODO #67)
- Remove proxy URL from log output to avoid credential exposure

* refactor: simplify splitNoProxy and use tagged switch in parseFlags

* refactor: separate NO_PROXY config from ALL_PROXY propagation

configureNoProxy() now runs independently when any proxy is set,
not tied to ALL_PROXY propagation. Cleaner separation of concerns.

* refactor: remove lowercase env var support for simplicity

* refactor: remove NO_PROXY auto-configuration

* refactor: skip proxy propagation for --help/--version and cleanup test

* test: add test case for lowercase all_proxy not supported

* feat: add alias completion in command mode (#76)

* feat: add alias completion in command mode (#70)

Include aliases in GetSuggestions() so :cost+Tab suggests cost-explorer.
Self-referential aliases (sfn→sfn) excluded from suggestions.

* refactor: use prefix+fuzzy for diff completion

* refactor: use CutPrefix and cache GetAliases

* refactor: extract match functions to shared module

- Move fuzzyMatch and matchNamesWithFallback to match.go
- Make :tag/:tags clear behavior explicit
- Sort suggestions alphabetically (services + aliases)

* refactor: cache GetAliasesForService and sort match results

* refactor: unify command parser pattern for sort and login

* test: add cache concurrency tests and improve comments

* refactor: use CutPrefix in ecs tasks render

* refactor: use CutSuffix in parseNumericValue

* fix: quote profile name in error message for clarity

* fix: lowercase pattern in fuzzyMatch for case insensitivity

* chore: remove .claude symlink

* chore: add .claude to gitignore

* fix: lowercase pattern in matchNamesWithFallback prefix check

* fix: return defensive copy from alias cache methods
@yimsk yimsk mentioned this pull request Jan 2, 2026
yimsk added a commit that referenced this pull request Jan 2, 2026
* Align naming conventions with AWS CLI (#71)

* Align registry names with AWS CLI conventions

Rename 7 services to match AWS CLI naming:
- computeoptimizer → compute-optimizer
- cognito → cognito-idp
- config → configservice
- costexplorer → ce
- eventbridge → events
- macie → macie2
- sfn → stepfunctions

Old names preserved as aliases for backward compatibility.

Closes #65

* Fix pseudo-ARN prefix to match registry service name (ce)

* Add comment explaining pseudo-ARN format for Cost Explorer

* Rename directories to align with AWS CLI conventions

- Service dirs: costexplorer→ce, eventbridge→events, sfn→stepfunctions,
  cognito→cognito-idp, config→configservice, macie→macie2,
  computeoptimizer→compute-optimizer, servicequotas→service-quotas,
  licensemanager→license-manager, networkfirewall→network-firewall
- Resource dirs: hyphenate compound names (e.g., loggroups→log-groups)
- Update imports and ARN mappings

Closes #65

* Rename bedrock dirs to kebab-case for AWS CLI consistency

* Fix DAO error strings and deduplicate client helpers

* Fix error strings and deduplicate client helpers

* Fix package names to match directory names (events, stepfunctions)

* Add develop branch to CI triggers

* feat: propagate ALL_PROXY to HTTP_PROXY/HTTPS_PROXY (#74)

* feat: support ALL_PROXY environment variable (#69)

* feat: propagate ALL_PROXY to HTTP_PROXY and configure NO_PROXY

Extend proxy support based on issue #69 feedback:
- Propagate ALL_PROXY to both HTTP_PROXY and HTTPS_PROXY
- Auto-configure NO_PROXY for AWS credential endpoints:
  - 169.254.169.254 (EC2 IMDS)
  - 169.254.170.2 (ECS Task Role)
  - 169.254.170.23 (EKS Pod Identity)
- Preserve existing NO_PROXY entries, only add missing endpoints

Refs #69, #67

* fix: default NO_PROXY to IMDS only and remove proxy value from logs

- NO_PROXY now only includes EC2 IMDS (169.254.169.254) by default
- ECS/EKS endpoints can be added via config (TODO #67)
- Remove proxy URL from log output to avoid credential exposure

* refactor: simplify splitNoProxy and use tagged switch in parseFlags

* refactor: separate NO_PROXY config from ALL_PROXY propagation

configureNoProxy() now runs independently when any proxy is set,
not tied to ALL_PROXY propagation. Cleaner separation of concerns.

* refactor: remove lowercase env var support for simplicity

* refactor: remove NO_PROXY auto-configuration

* refactor: skip proxy propagation for --help/--version and cleanup test

* test: add test case for lowercase all_proxy not supported

* feat: add alias completion in command mode (#76)

* feat: add alias completion in command mode (#70)

Include aliases in GetSuggestions() so :cost+Tab suggests cost-explorer.
Self-referential aliases (sfn→sfn) excluded from suggestions.

* refactor: use prefix+fuzzy for diff completion

* refactor: use CutPrefix and cache GetAliases

* refactor: extract match functions to shared module

- Move fuzzyMatch and matchNamesWithFallback to match.go
- Make :tag/:tags clear behavior explicit
- Sort suggestions alphabetically (services + aliases)

* refactor: cache GetAliasesForService and sort match results

* refactor: unify command parser pattern for sort and login

* test: add cache concurrency tests and improve comments

* refactor: use CutPrefix in ecs tasks render

* refactor: use CutSuffix in parseNumericValue

* fix: quote profile name in error message for clarity

* fix: lowercase pattern in fuzzyMatch for case insensitivity

* chore: remove .claude symlink

* chore: add .claude to gitignore

* fix: lowercase pattern in matchNamesWithFallback prefix check

* fix: return defensive copy from alias cache methods
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