-
Notifications
You must be signed in to change notification settings - Fork 14
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
Log the master IPS when there is a login in error #439
Conversation
ips, lookUpError := net.LookupIP(host) | ||
if lookUpError != nil { | ||
fmt.Fprintf(os.Stderr, "Could not get IPs: %v\n", lookUpError) | ||
os.Exit(1) |
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.
Dont we want to return error if error happens and dont exit here like other places in this file?
fmt.Fprintf(os.Stderr, "Could not get IPs: %v\n", lookUpError) | ||
os.Exit(1) | ||
} | ||
ipsList := " IP Addresses: " |
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.
There is a join function of any other allegant string function that can do what you doing here
} | ||
ipsList := " IP Addresses: " | ||
for _, ip := range ips { | ||
ipsList += ip.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.
If you remain in this way maybe this two lines can be combined to one with string formatting
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 dont think there is a way since the ip address are []byte and have to be first converted to a readable string. i could drop the optional ipv6 and just only submit one ip address, this would get rid of the need of a for loop and also allow me to do a formatted string.
56dd870
to
4cfb2bd
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!!!
Desired Outcome
Log the requests IP address when there is a login error
Implemented Changes
Add a function to find and print he ip address taken from the host name.
Connected Issue/Story
CyberArk internal issue link: ONYX-14476
Definition of Done
Improved error message in authenticator client when request goes to an unhealthy master (502 error code doesn't reveal what IP address the name resolved to). Log the node's IP address when the connection fails.
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
README
s) were updated in this PRBehavior
Security