Skip to content

OCM-18900 | fix: Improve proxy validation error messages for special characters in passwords#3052

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
olucasfreitas:OCM-18900
Feb 24, 2026
Merged

OCM-18900 | fix: Improve proxy validation error messages for special characters in passwords#3052
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
olucasfreitas:OCM-18900

Conversation

@olucasfreitas
Copy link
Copy Markdown
Contributor

@olucasfreitas olucasfreitas commented Oct 21, 2025

Details

This PR fixes a usability issue where rosa create cluster --http-proxy was displaying unhelpful error messages when proxy passwords contained special characters like forward slashes, making it difficult for users to understand what was wrong with their input.


Problem (Before)

rosa create cluster --http-proxy "http://proxyuser:QvoZjyy/trkCiY5@10.0.0.161:8080"

Output:

E: Invalid http-proxy value 'http://proxyuser:QvoZjyy/trkCiY5@10.0.0.161:8080'

The user has no idea what's wrong with the URL.


Fixed Behavior (After)

./rosa create cluster --http-proxy "http://proxyuser:QvoZjyy/trkCiY5@10.0.0.161:8080"

Output:

ERR: invalid http-proxy value: password contains invalid character '/'

Now the user knows exactly what's wrong.


Additional Validations

The implementation validates special characters in both username and password fields:

  1. Forward slash in password:

    rosa edit cluster --cluster=my-cluster --http-proxy "http://user:pass/word@10.0.0.161:8080"

    Output:

    ERR: invalid http-proxy value: password contains invalid character '/'
    
  2. @ symbol in password:

    rosa edit cluster --cluster=my-cluster --http-proxy "http://user:p@ssword@10.0.0.161:8080"

    Output:

    ERR: invalid http-proxy value: password contains invalid character '@'
    
  3. Question mark in password:

    rosa edit cluster --cluster=my-cluster --http-proxy "http://user:pass?word@10.0.0.161:8080"

    Output:

    ERR: invalid http-proxy value: password contains invalid character '?'
    
  4. Hash in password:

    rosa edit cluster --cluster=my-cluster --http-proxy "http://user:pass#word@10.0.0.161:8080"

    Output:

    ERR: invalid http-proxy value: password contains invalid character '#'
    
  5. Invalid character in username:

    rosa edit cluster --cluster=my-cluster --http-proxy "http://us/er:password@10.0.0.161:8080"

    Output:

    ERR: invalid http-proxy value: username contains invalid character '/'
    
  6. Missing scheme:

    rosa edit cluster --cluster=my-cluster --http-proxy "user:password@10.0.0.161:8080"

    Output:

    ERR: invalid http-proxy value: URL is missing scheme (expected '://')
    
  7. HTTPS proxy validation:

    rosa edit cluster --cluster=my-cluster --https-proxy "https://user:pass/word@10.0.0.161:8080"

    Output:

    ERR: invalid https-proxy value: password contains invalid character '/'
    

Ticket

Closes OCM-18900

Comment thread pkg/ocm/helpers_test.go
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 88.67925% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.08%. Comparing base (c854a37) to head (dde1c46).
⚠️ Report is 107 commits behind head on master.

Files with missing lines Patch % Lines
pkg/ocm/helpers.go 87.87% 3 Missing and 1 partial ⚠️
cmd/create/cluster/cmd.go 0.00% 1 Missing ⚠️
cmd/edit/cluster/cmd.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3052      +/-   ##
==========================================
+ Coverage   23.91%   24.08%   +0.17%     
==========================================
  Files         317      330      +13     
  Lines       35202    35941     +739     
==========================================
+ Hits         8418     8657     +239     
- Misses      26143    26631     +488     
- Partials      641      653      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 23, 2025
Comment thread cmd/list/dnsdomains/cmd.go Outdated
@olucasfreitas olucasfreitas force-pushed the OCM-18900 branch 2 times, most recently from 00638f4 to 120a803 Compare November 3, 2025 11:36
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 3, 2025
@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest-required

Comment thread cmd/list/dnsdomains/cmd.go Outdated
Comment thread tests/utils/exec/rosacli/upgrade_service.go
Comment thread pkg/ocm/helpers.go Outdated
@olucasfreitas olucasfreitas force-pushed the OCM-18900 branch 2 times, most recently from 2260456 to c6b94b4 Compare November 3, 2025 14:46
@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest-required

@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest-required

Copy link
Copy Markdown
Contributor

@hunterkepley hunterkepley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test case in the bug ticket does not seem to pass:

E: parse "http://proxyuser:QvoZjyy/trkCiY5@10.0.0.161:8080": invalid port ":QvoZjyy" after host

I think there may be a bug in the parse code

@olucasfreitas
Copy link
Copy Markdown
Contributor Author

@hunterkepley I just did some tests here, and it seems to be working after the fix, did you test it with the branch locally ?

@olucasfreitas olucasfreitas force-pushed the OCM-18900 branch 2 times, most recently from 96029c9 to a50904c Compare November 3, 2025 19:49
@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest-required

1 similar comment
@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest-required

Comment thread tests/e2e/test_rosacli_cluster.go
Comment thread pkg/ocm/helpers_test.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
@olucasfreitas olucasfreitas force-pushed the OCM-18900 branch 2 times, most recently from 9502aa4 to 2637639 Compare November 5, 2025 15:38
@hunterkepley
Copy link
Copy Markdown
Contributor

/test e2e-presubmits-pr-rosa-hcp-advanced

@hunterkepley
Copy link
Copy Markdown
Contributor

/test e2e-presubmits-pr-rosa-sts-advanced

@olucasfreitas olucasfreitas force-pushed the OCM-18900 branch 2 times, most recently from 34c6edf to 875a547 Compare November 19, 2025 19:47
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 19, 2025

@olucasfreitas: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/coverage 2637639 link true /test coverage

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest

Comment thread pkg/helper/helpers.go Outdated
Comment thread pkg/helper/helpers.go Outdated
Comment thread pkg/helper/helpers.go Outdated
Comment thread pkg/helper/helpers.go Outdated
Comment thread pkg/helper/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
@olucasfreitas olucasfreitas force-pushed the OCM-18900 branch 2 times, most recently from f7318dc to 3d09b7b Compare December 8, 2025 15:43
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/ocm/helpers.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/interactive/validation_test.go
Comment thread pkg/ocm/helpers.go Outdated
Copy link
Copy Markdown
Contributor

@hunterkepley hunterkepley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we provide a copyright notice in the brand new file(s)?

Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation_test.go
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
Comment thread pkg/helper/url/validation.go Outdated
@olucasfreitas
Copy link
Copy Markdown
Contributor Author

/retest

Comment thread pkg/helper/url/validation.go
@marcolan018
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Feb 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marcolan018, olucasfreitas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 092e2de into openshift:master Feb 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants