-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve URL format validation #3900
Improve URL format validation #3900
Conversation
Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com>
/assign |
Codecov Report
@@ Coverage Diff @@
## master #3900 +/- ##
==========================================
- Coverage 44.55% 44.51% -0.05%
==========================================
Files 142 142
Lines 13863 13885 +22
==========================================
+ Hits 6177 6181 +4
- Misses 7094 7112 +18
Partials 592 592
Continue to review full report at Codecov.
|
@GeekArthur I'm able to add invalid registries like below: $ odo registry list
NAME URL SECURE
test3 https://)(url No
test2 noprotocol://noregistry No
test https://nosuchurlblah No While the last one could be possible in an internal environment (and hence a valid URL for some environment), the other two seem far-fetched and I tried them just for the sake of breaking it. I don't claim to know the definition of 100% correct URL/URI but unless user uses their commonsense, there's going to be ways break this. However, while looking around, I did see examples where |
The only way you can validate the 3rd case, is to see if it is reachable or not, as technically, it is a valid url, just one that may not exist or even be reachable. Do we want to do this?
+1 |
We can use @dharmit Regarding the three cases you tested,
We decide to follow the design of |
Signed-off-by: jingfu wang <jingfu.j.wang@ibm.com>
@adisky @dharmit @mohammedzee1000 Comments addressed, please review again, thanks. |
/retest |
2 similar comments
/retest |
/retest |
@dharmit All tests passed, can you review again? |
/lgtm |
This PR also needs an |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kadel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: jingfu wang jingfu.j.wang@ibm.com
What type of PR is this?
/kind bug
/area devfile
What does does this PR do / why we need it:
This PR adds more requirements to URL format validation so that gate more invalid registry URLs
Which issue(s) this PR fixes:
Fixes #3451
PR acceptance criteria:
Unit test
Integration test
I have read the test guidelines
How to test changes / Special notes to the reviewer:
Run
odo registry add test <invalid URL>
, for example runodo registry add test http://$$$$,,,,,@hdjh.hcgcyd