Skip to content

Commit a07909a

Browse files
Hacky Credentials Fix
1 parent f32c76f commit a07909a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

google-cloud-clients/google-cloud-firestore/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
</properties>
2323
<dependencies>
2424
<dependency>
25+
<version>1.38.1-SNAPSHOT</version>
2526
<groupId>${project.groupId}</groupId>
2627
<artifactId>google-cloud-core</artifactId>
2728
</dependency>

google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ public Builder setTimestampsInSnapshotsEnabled(boolean value) {
208208
@Override
209209
@Nonnull
210210
public FirestoreOptions build() {
211+
if (this.credentials == null && this.credentialsProvider != null) {
212+
try {
213+
this.setCredentials(credentialsProvider.getCredentials());
214+
} catch (IOException e) {
215+
throw new RuntimeException("Failed to obtain credentials", e);
216+
}
217+
}
218+
211219
return new FirestoreOptions(this);
212220
}
213221
}

0 commit comments

Comments
 (0)