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
OCM-7188: GitHub IDP Add hostname validation #1909
OCM-7188: GitHub IDP Add hostname validation #1909
Conversation
@mnecas: This pull request references OCM-7188 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.16.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Hi @mnecas. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/ok-to-test |
40cece2
to
f0f9b61
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1909 +/- ##
==========================================
- Coverage 21.69% 21.42% -0.27%
==========================================
Files 118 118
Lines 19782 20481 +699
==========================================
+ Hits 4292 4389 +97
- Misses 15165 15732 +567
- Partials 325 360 +35 ☔ View full report in Codecov by Sentry. |
9b1fabb
to
7949ca9
Compare
pkg/interactive/validation.go
Outdated
if hostname == "github.com" || strings.HasSuffix(hostname, ".github.com") { | ||
return fmt.Errorf(fmt.Sprintf("'%s' hostname cannot be equal to [*.]github.com", hostname)) | ||
} | ||
if !(len(validation.IsDNS1123Subdomain(hostname)) == 0 || netutils.ParseIPSloppy(hostname) != nil) { | ||
return fmt.Errorf(fmt.Sprintf("'%s' hostname must be a valid DNS subdomain or IP address", val.(string))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mnecas Minor, but you can just use the hostname
variable rather than recasting the val again to a string.
The openshfit validates the GitHub hostname and it can not match the [*.]github.com If the user would put the hostname 'github.com' the hive idp sync would fail as the admission controller would not allow to update the oauth cr Signed-off-by: Martin Necas <mnecas@redhat.com>
7949ca9
to
8c78469
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mnecas, robpblake 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 |
@mnecas: all tests passed! Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
The openshfit validates the GitHub hostname and it can not match the [*.]github.com If the user would put the hostname 'github.com' the hive idp sync would fail as the admission controller would not allow to update the oauth cr