-
Notifications
You must be signed in to change notification settings - Fork 142
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
Fix bugs in googleca and update flag description #897
Conversation
Signed-off-by: Priya Wadhwa <[email protected]>
Signed-off-by: Priya Wadhwa <[email protected]>
Signed-off-by: Priya Wadhwa <[email protected]>
e6788c2
to
ecedc7b
Compare
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.
just a couple comments, looks good!
pkg/ca/googleca/v1/googleca.go
Outdated
parent string | ||
client *privateca.CertificateAuthorityClient | ||
certAuthority string | ||
certAuthorityParent string |
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.
I'd merge these two variables into one, caPool
, since they represent the same resource. You can then check if certAuthority
is set to decide whether or not to target a specific 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.
So we do need both of them later on, the full certAuthorityParent in the GetCertificateAuthority
request and just the name of the CA certAuthority
when actually making the request for IssuingCertificateAuthorityId
.
i think it's more understandable to do all the validation/string splitting logic at the beginning and then have everything we need later on when actually getting CA's/making requests.
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.
Oh I see my confusion, it's around terminology. I thought two referred to the same resource. I would use the terms from aip.dev to describe the resources and IDs here:
- certAuthority -> certAuthorityID (since it represents just an ID)
- certAuthorityParent -> certAuthorityResource (since it's the full resource string)
- caPoolParent -> caPoolResource
Does that sound good? "parent" was what was confusing, since a parent of the a resource is a different resource.
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.
Sure, that's fine. I'd still keep "parent" personally to follow the google naming standards for a googleca, but am fine with changing it too. It's updated now.
Signed-off-by: Priya Wadhwa <[email protected]>
Signed-off-by: Priya Wadhwa <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #897 +/- ##
==========================================
- Coverage 55.63% 54.78% -0.85%
==========================================
Files 38 38
Lines 2333 2380 +47
==========================================
+ Hits 1298 1304 +6
- Misses 939 980 +41
Partials 96 96
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This fixes 2 bugs in the googleca:
TrustBundle
because we were checkingif len(roots) == 0
instead ofif len(caCerts) == 0
, roots was always empty at this pointgcp_private_ca_parent
flagSigned-off-by: Priya Wadhwa [email protected]
Release Note
Fix bugs in googleca and update flag description