-
Notifications
You must be signed in to change notification settings - Fork 2
asterfusion commit pki2.0 #21
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
base: asterfusion
Are you sure you want to change the base?
Conversation
|
Could you please add relevant folks from the OLS SONiC side to review as well, thanks. |
| // save to operational.pem | ||
| file, err := os.Create(operationalPath) | ||
| if err != nil { | ||
| logger.Error("cannot create opreational.pem, err is %s", err.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.
minor mistake .. typo error "operational" it must have been.
| Bytes: cert.Raw, | ||
| }) | ||
| if err != nil { | ||
| logger.Error("write opreational.pem failed, err is %s", err.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.
same here, typo
| if ControllerAddr == "" { | ||
| logger.Error("Could not get ControllerAddr") | ||
| estServerList = []string{estHost} | ||
| updateOperationalPem() |
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.
return if it was false, then its not handled ?
| cmd.Stdout = &out | ||
| err := cmd.Run() | ||
| if err != nil { | ||
| logger.Error("command dig failed, err is %s", err.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.
Logging the domain context may also be additionally helpful in this log.
| caUrl := "https://" + estServer + "/cacerts" | ||
| resp, err := client.Get(caUrl) | ||
| if err != nil { | ||
| logger.Error("request failed, err is %s", err.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.
additionally printing the url attempted may be helpful.
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.
the err info contains the url.But It's more readable when expressed in code. Thank you!
| } | ||
|
|
||
| // parse private key | ||
| privateKey, err := x509.ParsePKCS1PrivateKey(block.Bytes) |
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.
getSignatureAlgorithm function supports both RSA and ECDSA, rest is erred.
In tihs code, there is a single key type parsed. Is that enough?
I'm not sure if my comment is right, but thinking why only this is called here and returned failed below, without checking if the key type is something else?
| return true | ||
| } | ||
|
|
||
| estServerList = getEstServer(ControllerAddr) |
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.
What if this was returned empty from getEstServer ?
Guess that case to be handled?
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 It's empty from getEstServer, the code will use production est or qs est based on the birth certificate.
https://telecominfraproject.atlassian.net/browse/OLS-828