Skip to content

Commit de65ddd

Browse files
Merge branch 'master' into dependabot/maven/org.apache.maven.plugins-maven-checkstyle-plugin-3.0.0
2 parents 7a82380 + 3737fe2 commit de65ddd

File tree

66 files changed

+5434
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5434
-321
lines changed

.github/resources/settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
<servers>
99
<server>
10-
<id>ossrh</id>
11-
<username>${env.NEXUS_OSSRH_USERNAME}</username>
12-
<password>${env.NEXUS_OSSRH_PASSWORD}</password>
10+
<id>central</id>
11+
<username>${env.CENTRAL_USERNAME}</username>
12+
<password>${env.CENTRAL_TOKEN}</password>
1313
</server>
1414
</servers>
1515

.github/scripts/publish_artifacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ gpg --import --no-tty --batch --yes firebase.asc
2626
# 1. Compiles the source (compile phase)
2727
# 2. Packages the artifacts - src, bin, javadocs (package phase)
2828
# 3. Signs the artifacts (verify phase)
29-
# 4. Publishes artifacts via Nexus (deploy phase)
29+
# 4. Publishes artifacts via Central Publisher Portal (deploy phase)
3030
mvn -B clean deploy \
3131
-Dcheckstyle.skip \
3232
-DskipTests \

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
startsWith(github.event.pull_request.title, '[chore] Release ')
7979

8080
runs-on: ubuntu-latest
81+
permissions:
82+
contents: write
8183

8284
steps:
8385
- name: Checkout source for publish
@@ -98,8 +100,8 @@ jobs:
98100
env:
99101
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
100102
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
101-
NEXUS_OSSRH_USERNAME: ${{ secrets.NEXUS_OSSRH_USERNAME }}
102-
NEXUS_OSSRH_PASSWORD: ${{ secrets.NEXUS_OSSRH_PASSWORD }}
103+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
104+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
103105

104106
# See: https://cli.github.com/manual/gh_release_create
105107
- name: Create release tag

pom.xml

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<groupId>com.google.firebase</groupId>
2121
<artifactId>firebase-admin</artifactId>
22-
<version>9.4.1</version>
22+
<version>9.6.0</version>
2323
<packaging>jar</packaging>
2424

2525
<name>firebase-admin</name>
@@ -59,7 +59,7 @@
5959
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6060
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6161
<skipUTs>${skipTests}</skipUTs>
62-
<netty.version>4.1.114.Final</netty.version>
62+
<netty.version>4.2.6.Final</netty.version>
6363
</properties>
6464

6565
<scm>
@@ -69,13 +69,6 @@
6969
<tag>HEAD</tag>
7070
</scm>
7171

72-
<distributionManagement>
73-
<snapshotRepository>
74-
<id>ossrh</id>
75-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
76-
</snapshotRepository>
77-
</distributionManagement>
78-
7972
<profiles>
8073
<profile>
8174
<id>devsite-apidocs</id>
@@ -89,7 +82,7 @@
8982
<plugin>
9083
<!-- Generate API docs using Doclava for the developer site -->
9184
<artifactId>maven-javadoc-plugin</artifactId>
92-
<version>3.10.1</version>
85+
<version>3.11.3</version>
9386
<executions>
9487
<execution>
9588
<phase>site</phase>
@@ -157,7 +150,7 @@
157150
<plugins>
158151
<plugin>
159152
<artifactId>maven-gpg-plugin</artifactId>
160-
<version>3.2.7</version>
153+
<version>3.2.8</version>
161154
<executions>
162155
<execution>
163156
<id>sign-artifacts</id>
@@ -189,7 +182,7 @@
189182
<plugin>
190183
<groupId>org.jacoco</groupId>
191184
<artifactId>jacoco-maven-plugin</artifactId>
192-
<version>0.8.12</version>
185+
<version>0.8.13</version>
193186
<executions>
194187
<execution>
195188
<id>pre-unit-test</id>
@@ -215,7 +208,7 @@
215208
<plugin>
216209
<groupId>org.codehaus.mojo</groupId>
217210
<artifactId>exec-maven-plugin</artifactId>
218-
<version>3.4.1</version>
211+
<version>3.5.1</version>
219212
<executions>
220213
<execution>
221214
<phase>test</phase>
@@ -270,7 +263,7 @@
270263
<!-- Compile Phase -->
271264
<plugin>
272265
<artifactId>maven-compiler-plugin</artifactId>
273-
<version>3.13.0</version>
266+
<version>3.14.0</version>
274267
<configuration>
275268
<source>1.8</source>
276269
<target>1.8</target>
@@ -280,7 +273,7 @@
280273
<!-- Test Phase -->
281274
<plugin>
282275
<artifactId>maven-surefire-plugin</artifactId>
283-
<version>3.5.1</version>
276+
<version>3.5.4</version>
284277
<configuration>
285278
<skipTests>${skipUTs}</skipTests>
286279
</configuration>
@@ -301,7 +294,7 @@
301294
</plugin>
302295
<plugin>
303296
<artifactId>maven-javadoc-plugin</artifactId>
304-
<version>3.10.1</version>
297+
<version>3.11.3</version>
305298
<executions>
306299
<execution>
307300
<id>attach-javadocs</id>
@@ -337,7 +330,7 @@
337330
<!-- Verify Phase -->
338331
<plugin>
339332
<artifactId>maven-failsafe-plugin</artifactId>
340-
<version>3.5.1</version>
333+
<version>3.5.3</version>
341334
<executions>
342335
<execution>
343336
<goals>
@@ -350,14 +343,14 @@
350343

351344
<!-- Deploy Phase -->
352345
<plugin>
353-
<groupId>org.sonatype.plugins</groupId>
354-
<artifactId>nexus-staging-maven-plugin</artifactId>
355-
<version>1.7.0</version>
346+
<groupId>org.sonatype.central</groupId>
347+
<artifactId>central-publishing-maven-plugin</artifactId>
348+
<version>0.8.0</version>
356349
<extensions>true</extensions>
357350
<configuration>
358-
<serverId>ossrh</serverId>
359-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
360-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
351+
<publishingServerId>central</publishingServerId>
352+
<autoPublish>true</autoPublish>
353+
<waitUntil>published</waitUntil>
361354
</configuration>
362355
</plugin>
363356
</plugins>
@@ -367,7 +360,7 @@
367360
<plugins>
368361
<plugin>
369362
<artifactId>maven-project-info-reports-plugin</artifactId>
370-
<version>3.8.0</version>
363+
<version>3.9.0</version>
371364
<reportSets>
372365
<reportSet>
373366
<configuration>
@@ -385,14 +378,7 @@
385378
<dependency>
386379
<groupId>com.google.cloud</groupId>
387380
<artifactId>libraries-bom</artifactId>
388-
<version>26.49.0</version>
389-
<type>pom</type>
390-
<scope>import</scope>
391-
</dependency>
392-
<dependency>
393-
<groupId>com.google.api-client</groupId>
394-
<artifactId>google-api-client-bom</artifactId>
395-
<version>2.7.0</version>
381+
<version>26.67.0</version>
396382
<type>pom</type>
397383
<scope>import</scope>
398384
</dependency>
@@ -401,6 +387,10 @@
401387

402388
<dependencies>
403389
<!-- Google Cloud Platform dependencies -->
390+
<dependency>
391+
<groupId>com.google.auth</groupId>
392+
<artifactId>google-auth-library-oauth2-http</artifactId>
393+
</dependency>
404394
<dependency>
405395
<groupId>com.google.api-client</groupId>
406396
<artifactId>google-api-client</artifactId>
@@ -417,10 +407,6 @@
417407
<groupId>com.google.api</groupId>
418408
<artifactId>api-common</artifactId>
419409
</dependency>
420-
<dependency>
421-
<groupId>com.google.auth</groupId>
422-
<artifactId>google-auth-library-oauth2-http</artifactId>
423-
</dependency>
424410
<dependency>
425411
<groupId>com.google.cloud</groupId>
426412
<artifactId>google-cloud-storage</artifactId>
@@ -438,7 +424,7 @@
438424
<dependency>
439425
<groupId>org.slf4j</groupId>
440426
<artifactId>slf4j-api</artifactId>
441-
<version>2.0.16</version>
427+
<version>2.0.17</version>
442428
</dependency>
443429
<dependency>
444430
<groupId>io.netty</groupId>

src/main/java/com/google/firebase/auth/AbstractFirebaseAuth.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,10 @@ private CallableOperation<UserRecord, FirebaseAuthException> getUserByProviderUi
600600
// Although we don't really advertise it, we want to also handle
601601
// non-federated idps with this call. So if we detect one of them, we'll
602602
// reroute this request appropriately.
603-
if (providerId == "phone") {
603+
if ("phone".equals(providerId)) {
604604
return this.getUserByPhoneNumberOp(uid);
605-
} else if (providerId == "email") {
605+
}
606+
if ("email".equals(providerId)) {
606607
return this.getUserByEmailOp(uid);
607608
}
608609

src/main/java/com/google/firebase/auth/ActionCodeSettings.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ private ActionCodeSettings(Builder builder) {
5151
if (!Strings.isNullOrEmpty(builder.dynamicLinkDomain)) {
5252
properties.put("dynamicLinkDomain", builder.dynamicLinkDomain);
5353
}
54+
if (!Strings.isNullOrEmpty(builder.linkDomain)) {
55+
properties.put("linkDomain", builder.linkDomain);
56+
}
5457
if (!Strings.isNullOrEmpty(builder.iosBundleId)) {
5558
properties.put("iOSBundleId", builder.iosBundleId);
5659
}
@@ -84,6 +87,7 @@ public static final class Builder {
8487
private String url;
8588
private boolean handleCodeInApp;
8689
private String dynamicLinkDomain;
90+
private String linkDomain;
8791
private String iosBundleId;
8892
private String androidPackageName;
8993
private String androidMinimumVersion;
@@ -135,12 +139,28 @@ public Builder setHandleCodeInApp(boolean handleCodeInApp) {
135139
*
136140
* @param dynamicLinkDomain Firebase Dynamic Link domain string.
137141
* @return This builder.
142+
* @deprecated Use {@link #setLinkDomain(String)} instead.
138143
*/
144+
@Deprecated
139145
public Builder setDynamicLinkDomain(String dynamicLinkDomain) {
140146
this.dynamicLinkDomain = dynamicLinkDomain;
141147
return this;
142148
}
143149

150+
/**
151+
* Sets the link domain to use for the current link if it is to be opened using
152+
* {@code handleCodeInApp}, as multiple link domains can be configured per project. This
153+
* setting provides the ability to explicitly choose one. If none is provided, the default
154+
* Firebase Hosting domain will be used.
155+
*
156+
* @param linkDomain Link domain string.
157+
* @return This builder.
158+
*/
159+
public Builder setLinkDomain(String linkDomain) {
160+
this.linkDomain = linkDomain;
161+
return this;
162+
}
163+
144164
/**
145165
* Sets the bundle ID of the iOS app where the link should be handled if the
146166
* application is already installed on the device.

src/main/java/com/google/firebase/auth/AuthErrorCode.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public enum AuthErrorCode {
5858
*/
5959
INVALID_DYNAMIC_LINK_DOMAIN,
6060

61+
/**
62+
* The provided hosting link domain is not configured or authorized for the current project.
63+
*/
64+
INVALID_HOSTING_LINK_DOMAIN,
65+
6166
/**
6267
* The specified ID token is invalid.
6368
*/

src/main/java/com/google/firebase/auth/FirebaseToken.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public final class FirebaseToken {
3737
this.claims = ImmutableMap.copyOf(claims);
3838
}
3939

40-
/** Returns the Uid for the this token. */
40+
/** Returns the Uid for this token. */
4141
public String getUid() {
4242
return (String) claims.get("sub");
4343
}
4444

45-
/** Returns the tenant ID for the this token. */
45+
/** Returns the tenant ID for this token. */
4646
public String getTenantId() {
4747
Map<String, Object> firebase = (Map<String, Object>) claims.get("firebase");
4848
if (firebase == null) {
@@ -51,7 +51,7 @@ public String getTenantId() {
5151
return (String) firebase.get("tenant");
5252
}
5353

54-
/** Returns the Issuer for the this token. */
54+
/** Returns the Issuer for this token. */
5555
public String getIssuer() {
5656
return (String) claims.get("iss");
5757
}

src/main/java/com/google/firebase/auth/UserRecord.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public UpdateRequest setPhoneNumber(@Nullable String phone) {
487487
// *and* by setting providersToUnlink to include 'phone', then we'll reject that. Though
488488
// it might also be reasonable to relax this restriction and just unlink it.
489489
for (String dp : deleteProviderIterable) {
490-
if (dp == "phone") {
490+
if ("phone".equals(dp)) {
491491
throw new IllegalArgumentException(
492492
"Both UpdateRequest.setPhoneNumber(null) and "
493493
+ "UpdateRequest.setProvidersToUnlink(['phone']) were set. To unlink from a "
@@ -601,7 +601,7 @@ public UpdateRequest setProvidersToUnlink(Iterable<String> providerIds) {
601601
for (String id : providerIds) {
602602
checkArgument(!Strings.isNullOrEmpty(id), "providerIds must not be null or empty");
603603

604-
if (id == "phone" && properties.containsKey("phoneNumber")
604+
if ("phone".equals(id) && properties.containsKey("phoneNumber")
605605
&& properties.get("phoneNumber") == null) {
606606
// If we've been told to unlink the phone provider both via setting phoneNumber to null
607607
// *and* by setting providersToUnlink to include 'phone', then we'll reject that. Though

src/main/java/com/google/firebase/auth/internal/AuthErrorHandler.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ final class AuthErrorHandler extends AbstractHttpErrorHandler<FirebaseAuthExcept
7373
"The provided dynamic link domain is not "
7474
+ "configured or authorized for the current project",
7575
AuthErrorCode.INVALID_DYNAMIC_LINK_DOMAIN))
76+
.put(
77+
"INVALID_HOSTING_LINK_DOMAIN",
78+
new AuthError(
79+
ErrorCode.INVALID_ARGUMENT,
80+
"The provided hosting link domain is not configured in Firebase Hosting or is "
81+
+ "not owned by the current project",
82+
AuthErrorCode.INVALID_HOSTING_LINK_DOMAIN))
7683
.put(
7784
"PHONE_NUMBER_EXISTS",
7885
new AuthError(
@@ -180,7 +187,7 @@ String buildMessage(AuthServiceErrorResponse response) {
180187

181188
/**
182189
* JSON data binding for JSON error messages sent by Google identity toolkit service. These
183-
* error messages take the form `{"error": {"message": "CODE: OPTIONAL DETAILS"}}`.
190+
* error messages take the form `{"error": {"message": "CODE : OPTIONAL DETAILS"}}`.
184191
*/
185192
private static class AuthServiceErrorResponse {
186193

@@ -196,7 +203,7 @@ public String getCode() {
196203

197204
int separator = message.indexOf(':');
198205
if (separator != -1) {
199-
return message.substring(0, separator);
206+
return message.substring(0, separator).trim();
200207
}
201208

202209
return message;

0 commit comments

Comments
 (0)