-
Notifications
You must be signed in to change notification settings - Fork 2
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
add a hostname verification function that doesn't do dns resolution #142
add a hostname verification function that doesn't do dns resolution #142
Conversation
types.go
Outdated
@@ -215,6 +215,21 @@ func IsHostname(target string) bool { | |||
return len(r) > 0 | |||
} | |||
|
|||
// IsHostnameNoDnsResolution returns true if the target is not an IP. | |||
func IsHostnameNoDnsResolution(target string) bool { |
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.
I would do: s/Dns/DNS in the name of the function.
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.
fixed :)
types_test.go
Outdated
@@ -628,6 +628,45 @@ func TestIsHostname(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestIsHostnameNoDnsResolution(t *testing.T) { |
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.
I would do: s/Dns/DNS in the name of the function.
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.
fixed :)
@manelmontilla Any chance on getting this reviewed? |
@manelmontilla : Is there anything we can do to help get this merged? |
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
Hi @kozmic, |
cb055d0
to
868061d
Compare
rebased |
This adds a hostname check that doesn't do a dns verification of the hostname, in order to support the use case of tracking assets that are behind a split horizon dns setup.
This is part 1 of 2, the other part will be in vulcan-api and use this function.