-
Notifications
You must be signed in to change notification settings - Fork 283
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
Go code to get SIA certs from a CGF (Google Cloud Function) #2220
Go code to get SIA certs from a CGF (Google Cloud Function) #2220
Conversation
Signed-off-by: gilad.bendor <[email protected]>
// | ||
// to get an Athenz certificate from ZTS. | ||
// | ||
// This file should usually be copied without changes into the GCF source-code. |
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.
not sure what this is referring to. nobody should copy the source file. instead, they'll just import the module and call the methods, so let's remove this comment
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.
Archeological remnant removed...
@@ -0,0 +1,263 @@ | |||
package functions |
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.
need to add Athenz License header block
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 err != nil { | ||
return nil, err | ||
} | ||
//log.Printf("GCP Attestation Data: %s", attestationData) // commented out - sensitive info |
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.
let's remove all the commented log entries
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.
👍
} | ||
|
||
// SiaCertData response of GcfGetSiaCerts() | ||
type SiaCertData struct { |
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.
No need to define a new struct. This is already available as part of our RDL
import "github.com/AthenZ/athenz/clients/go/zts"
and generate and return zts.InstanceIdentity object
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.
Thing is, zts.InstanceIdentity is JSON-able: it only contain PEM stuff.
My SiaCertData also contains rsa.PrivateKey and x509.Certificate objects - so usage is simpler.
Also, zts.InstanceIdentitycontains many properties that I will not fill-in, and it would be confusing to users.
I would not make this change, but will yield to your judgment...
Are you sure you want to go that way?
Signed-off-by: gilad.bendor <[email protected]>
No description provided.