Skip to content

Commit 58a1828

Browse files
authored
fix: switch to GSON per security team advice (#586)
* switch to GSON per security team advice * fix samples * format * update Javadoc * bom version * google-oauth-client not in BOM
1 parent cc08859 commit 58a1828

File tree

28 files changed

+42
-49
lines changed

28 files changed

+42
-49
lines changed

google-oauth-client-appengine/src/main/java/com/google/api/client/extensions/appengine/auth/AbstractAppEngineCallbackServlet.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@
4848
* {@link
4949
* com.google.api.client.extensions.appengine.auth.oauth2.AbstractAppEngineAuthorizationCodeCallbackServlet}.
5050
*
51-
* <p>Upgrade warning: in version 1.15 there was an implementation of {@link
52-
* #newJsonFactoryInstance()} that used {@code com.google.api.client.json.jackson.JacksonFactory},
53-
* but starting with version 1.16 there is no such implementation.
54-
*
5551
* @author moshenko@google.com (Jacob Moshenko)
5652
* @since 1.4
5753
*/

google-oauth-client-appengine/src/main/java/com/google/api/client/extensions/appengine/auth/AbstractAppEngineFlowServlet.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
* {@link
3030
* com.google.api.client.extensions.appengine.auth.oauth2.AbstractAppEngineAuthorizationCodeServlet}.
3131
*
32-
* <p>Upgrade warning: in version 1.15 there was an implementation of {@link
33-
* #newJsonFactoryInstance()} that used {@code com.google.api.client.json.jackson.JacksonFactory},
34-
* but starting with version 1.16 there is no such implementation.
35-
*
3632
* @author moshenko@google.com (Jacob Moshenko)
3733
* @since 1.4
3834
*/

google-oauth-client-appengine/src/main/java/com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeCallbackServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
* protected AuthorizationCodeFlow initializeFlow() throws IOException {
7171
* return new AuthorizationCodeFlow.Builder(BearerToken.authorizationHeaderAccessMethod(),
7272
* new UrlFetchTransport(),
73-
* new JacksonFactory(),
73+
* new GsonFactory(),
7474
* new GenericUrl("https://server.example.com/token"),
7575
* new BasicAuthentication("s6BhdRkqt3", "7Fjfp0ZBr1KtDRbnfVdmIw"),
7676
* "s6BhdRkqt3",

google-oauth-client-appengine/src/main/java/com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* protected AuthorizationCodeFlow initializeFlow() throws IOException {
6464
* return new AuthorizationCodeFlow.Builder(BearerToken.authorizationHeaderAccessMethod(),
6565
* new UrlFetchTransport(),
66-
* new JacksonFactory(),
66+
* new GsonFactory(),
6767
* new GenericUrl("https://server.example.com/token"),
6868
* new BasicAuthentication("s6BhdRkqt3", "7Fjfp0ZBr1KtDRbnfVdmIw"),
6969
* "s6BhdRkqt3",

google-oauth-client-java6/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
</dependency>
9393
<dependency>
9494
<groupId>com.google.http-client</groupId>
95-
<artifactId>google-http-client-jackson2</artifactId>
95+
<artifactId>google-http-client-gson</artifactId>
9696
<scope>test</scope>
9797
</dependency>
9898
<dependency>

google-oauth-client-java6/src/test/java/com/google/api/client/extensions/java6/auth/oauth2/FileCredentialStoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.google.api.client.http.LowLevelHttpResponse;
2626
import com.google.api.client.json.JsonFactory;
2727
import com.google.api.client.json.JsonGenerator;
28-
import com.google.api.client.json.jackson2.JacksonFactory;
28+
import com.google.api.client.json.gson.GsonFactory;
2929
import com.google.api.client.testing.http.MockHttpTransport;
3030
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
3131
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
@@ -48,7 +48,7 @@
4848
@Deprecated
4949
public class FileCredentialStoreTest extends TestCase {
5050

51-
static final JsonFactory JSON_FACTORY = new JacksonFactory();
51+
static final JsonFactory JSON_FACTORY = new GsonFactory();
5252
private static final String ACCESS_TOKEN = "abc";
5353
static final String NEW_ACCESS_TOKEN = "def";
5454
private static final GenericUrl TOKEN_SERVER_URL = new GenericUrl("http://example.com/token");

google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/AbstractCallbackServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected final HttpTransport getHttpTransport() {
137137
* json factory and should be as simple as:
138138
*
139139
* <pre>
140-
* new JacksonFactory();
140+
* new GsonFactory();
141141
* </pre>
142142
*
143143
* @return {@link JsonFactory} instance for your particular environment

google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/AbstractFlowUserServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected final HttpTransport getHttpTransport() {
168168
* json factory and should be as simple as:
169169
*
170170
* <pre>
171-
* new JacksonFactory();
171+
* new GsonFactory();
172172
* </pre>
173173
*
174174
* @return {@link JsonFactory} instance for your particular environment

google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/oauth2/AbstractAuthorizationCodeCallbackServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* protected AuthorizationCodeFlow initializeFlow() throws IOException {
6868
* return new AuthorizationCodeFlow.Builder(BearerToken.authorizationHeaderAccessMethod(),
6969
* new NetHttpTransport(),
70-
* new JacksonFactory(),
70+
* new GsonFactory(),
7171
* new GenericUrl("https://server.example.com/token"),
7272
* new BasicAuthentication("s6BhdRkqt3", "7Fjfp0ZBr1KtDRbnfVdmIw"),
7373
* "s6BhdRkqt3",

google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/oauth2/AbstractAuthorizationCodeServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
* protected AuthorizationCodeFlow initializeFlow() throws IOException {
7070
* return new AuthorizationCodeFlow.Builder(BearerToken.authorizationHeaderAccessMethod(),
7171
* new NetHttpTransport(),
72-
* new JacksonFactory(),
72+
* new GsonFactory(),
7373
* new GenericUrl("https://server.example.com/token"),
7474
* new BasicAuthentication("s6BhdRkqt3", "7Fjfp0ZBr1KtDRbnfVdmIw"),
7575
* "s6BhdRkqt3",

0 commit comments

Comments
 (0)