-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: Java SDK Api Key authorization sample #9586
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
Conversation
@@ -104,11 +108,6 @@ limitations under the License. | |||
</executions> | |||
<configuration> | |||
<executable>java</executable> | |||
<arguments> | |||
<argument>-classpath</argument> | |||
<classpath /> |
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.
please note I had to remove this specification as it was causing all AuthExamples tests to fail. I have updated the readme so DownscopingExample can run without it.
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
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.
Hello, thank you for submitting this code sample.
Please do the following modifications:
- split code samples one per class (and file)
- resolve code snippet mismatching region tags
- add test(s) to the new code sample
auth/src/main/java/com/google/cloud/auth/samples/AuthExample.java
Outdated
Show resolved
Hide resolved
auth/src/main/java/com/google/cloud/auth/samples/AuthExample.java
Outdated
Show resolved
Hide resolved
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.
Thank you for addressing the feedback quickly. There are a couple of additional changes related to using the standard language constructs as best practices and some guidance regarding code sample parameters and return types.
If you find time, would you mind to split other code samples in the same folder to stand-alone classes? It is not big deal if you don't but we are trying to use each opportunity to improve our code when we touch it.
Thank you.
auth/src/main/java/com/google/cloud/auth/samples/ApiKeyAuthExample.java
Outdated
Show resolved
Hide resolved
auth/src/main/java/com/google/cloud/auth/samples/ApiKeyAuthExample.java
Outdated
Show resolved
Hide resolved
auth/src/test/java/com/google/cloud/auth/samples/ApiKeyAuthExampleIT.java
Outdated
Show resolved
Hide resolved
auth/src/main/java/com/google/cloud/auth/samples/ApiKeyAuthExample.java
Outdated
Show resolved
Hide resolved
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.
please fix the potential test resource generation without deleting.
auth/src/test/java/com/google/cloud/auth/samples/AuthExampleIT.java
Outdated
Show resolved
Hide resolved
auth/src/test/java/com/google/cloud/auth/samples/AuthTestUtils.java
Outdated
Show resolved
Hide resolved
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.
thank you for the quick fixes
Description
Java Cloud SDK introduced a new API to allow users to authenticate via an API key. This provides a sample usage of the new setApiKey function.
Checklist
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory only