-
Notifications
You must be signed in to change notification settings - Fork 2.9k
KMS changes #1218
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
KMS changes #1218
Conversation
8ede13b
to
61c96de
Compare
61c96de
to
9ad4c7d
Compare
@@ -16,6 +16,7 @@ | |||
|
|||
package com.example; | |||
|
|||
// [START kms_get_asymmetric_public] |
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 don't think you should add the imports for the entire file. Several of these imports aren't even being used in the snippet that is requesting them.
One suggesting for handling this problem is the approach that's being used in #1232. This puts each snippet in it's own file, and the region tags include the imports.
Another suggestion is to add a comment detailing that the PemReader import is needed, and maybe even specify the mvn package name for the user to more easily add it to their pom.
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.
We had a discussion about the best way to present these imports in b/113025156, and we decided the universal import region tag would be sufficient. Is it more standard to include imports in each region tag? I could do it that way, but it would require a pretty big refactor, and new PRs for the other languages
(btw, I changed the region tag here - these should be imports for all asymmetric samples, not just get_asymmetric_public)
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.
Up until now the standard has been to not include imports in region tags. If we switch the new format, each snippet will be in it's own file so that only relevant imports will be shown.
What page will this be on? I don't think lumping all the imports into one region tag is a good solution for multiple different snippets - it won't be clear which imports go to which snippet.
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.
It would have to be on the encrypting and signing docs pages. I think I'll spend some time tomorrow moving imports into each snippet, if that's more in line with existing ones
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 other suggestion (if you want to avoid a large refactor until the new format is decided upon) would be to update the comment for the functions using the 3rd party library with just that import.
For example add something like this snippet uses BouncyCastleProvider, which can be imported at org.bouncycastle.jce.provider.BouncyCastleProvider
to the function comment. This way the third party import would be visible and still only listed for the relevant functions.
@kurtisvg I did some experimenting, and ended up ended up deciding it looks best with the comments. I think I'll remove the import region tags and go with this for the other languages |
implements changes suggested in b/113025362 and b/113025156