-
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
Refactored security package #58
Refactored security package #58
Conversation
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
==========================================
+ Coverage 53.59% 53.61% +0.01%
==========================================
Files 14 14
Lines 1196 1218 +22
==========================================
+ Hits 641 653 +12
- Misses 491 496 +5
- Partials 64 69 +5
Continue to review full report at Codecov.
|
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.
Had two nits. Otherwise looking good!
security/ca.go
Outdated
} | ||
|
||
// Both exist, skip | ||
if certExist && keyExist { |
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.
This shloud be simplified to
_, certErr := os.Stat(c.caCertPath)
_, certPathErr := os.Stat(c.caKeyPath)
if certErr == nil && certPathErr == nil {
return
}
security/ca.go
Outdated
if err := os.Remove(crt); err != nil { | ||
return err | ||
} | ||
return os.Remove(key) | ||
} | ||
|
||
// GetCACertPath returns the path to the cert from the root CA. |
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.
Isn't the comment wrong here? It also returns the key's path.
d99713c
to
66bac0f
Compare
Good points @Skarlso 🤗 |
Refactored security package. Currently, the CA will be initiated and not used.
Ping @Skarlso