-
Notifications
You must be signed in to change notification settings - Fork 6
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
Hostname check with DNS or not #276
Hostname check with DNS or not #276
Conversation
pkg/api/asset.go
Outdated
@@ -67,8 +68,14 @@ func (a Asset) Validate() error { | |||
|
|||
switch a.AssetType.Name { | |||
case "Hostname": | |||
if !types.IsHostname(a.Identifier) { | |||
return errors.Validation("Identifier is not a valid Hostname") | |||
if os.Getenv("VULCAN_HOSTNAME_VALIDATION_WITH_DNS") == "false" { |
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.
We don't directly access env vars in the logic of the program.
In order to add a config option you need to:
- Add it to the config file that maps env vars to parameters in the config file
I think there isn't any section that makes sense to add this new param, so I would add a new section, something like this:
[assets]
dns_hostname_validaton = "$DNS_HOSTNAME_VALIDATION"
- Map the value in the run script of the container by adding something like this:
export DNS_HOSTNAME_VALIDATION=${DNS_HOSTNAME_VALIDATION:-true}
- Add the new section in the struct representing the configuration of the api
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.
Thanks for the review, I updated the branch and tried to apply this feedback.
…e performed with a dns resolution or not
…tion, and instead use the viper library for that
f3fb001
to
666953a
Compare
I added comment with a suggestion to change a little bit the approach.
cd db
./persistence-start.sh
./flyway-migrate.sh Note: You will need to have docker installed.
go test ./... |
…iguration items into the Vulcanito struct
Any update on this one? |
1 similar comment
Any update on this one? |
Now that the adevinta/vulcan-types#142 has been merged, could this PR be reviewed and merged @manelmontilla ? |
Fixed and merged #317 |
add an environment variable to control if the hostname check should be performed with a dns resolution or not.
adevinta/vulcan-types#142 needs to be merged and released before this can be evaluated I guess :)