-
Notifications
You must be signed in to change notification settings - Fork 277
certificates: Adding Certificate Manager #67
Conversation
} | ||
|
||
func newCertificate(cn CommonName) (*Certificate, error) { | ||
glog.V(7).Infof("[certificate] Creating a certificate for CN=%s", cn) |
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.
nit: replace 7 with a constant, the constants for the log levels can be in a separate file/pkg
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.
@shashankram That's a good idea - I'll make a github issue for that for us to follow up in a separate PR - just so we keep the scope here narrow to the cert manager. (#69)
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.
Sounds good.
return c.privateKey | ||
} | ||
|
||
func newCertificate(cn CommonName) (*Certificate, error) { |
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.
Why isn't 'n' of "newCertificate" capitalized?
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.
Good question... because there was no need to use newCertificate
outside of the package - it is not exported.
But if we find a need to use it outside somewhere - we could. The newCertificate
is called by the CertificateManager
(factory) -- so once you do NewCertificateManager
then you call IssueCertifiacate
on it... which ends up calling newCertificate
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.
Ah I see. I am a bit spoiled by other languages where all functions names are styled similarly.
return c.privateKey | ||
} | ||
|
||
func newCertificate(cn CommonName) (*Certificate, error) { |
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.
Ah I see. I am a bit spoiled by other languages where all functions names are styled similarly.
} | ||
|
||
func newCertificate(cn CommonName) (*Certificate, error) { | ||
glog.V(7).Infof("[certificate] Creating a certificate for CN=%s", cn) |
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.
Sounds good.
This PR proposes a
certificate.Manager
, which will be additionally discussed in the Design Document here #51This implementation of a
Certificate Manager
relies on hard-coded PEMs on disk.At a later stage the implementation will change.