Skip to content
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

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

michelvocks
Copy link
Member

Refactored security package. Currently, the CA will be initiated and not used.

Ping @Skarlso

@codecov-io
Copy link

codecov-io commented Jul 25, 2018

Codecov Report

Merging #58 into master will increase coverage by 0.01%.
The diff coverage is 77.14%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
security/ca.go 74.25% <77.14%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6a51f1...66bac0f. Read the comment docs.

Copy link
Member

@Skarlso Skarlso left a 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 {
Copy link
Member

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.
Copy link
Member

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.

@michelvocks michelvocks force-pushed the security_refactored branch from d99713c to 66bac0f Compare July 25, 2018 19:35
@michelvocks
Copy link
Member Author

Good points @Skarlso 🤗

@michelvocks michelvocks merged commit 95b672d into gaia-pipeline:master Jul 25, 2018
@michelvocks michelvocks deleted the security_refactored branch July 25, 2018 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants