Skip to content

Commit eae314f

Browse files
authored
Merge branch 'master' into issue-1072
2 parents 5c0b348 + 1e3bddc commit eae314f

Some content is hidden

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

45 files changed

+5255
-291
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
env:
101101
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
102102
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
103-
NEXUS_OSSRH_USERNAME: ${{ secrets.NEXUS_OSSRH_USERNAME }}
104-
NEXUS_OSSRH_PASSWORD: ${{ secrets.NEXUS_OSSRH_PASSWORD }}
103+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
104+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
105105

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

pom.xml

Lines changed: 15 additions & 22 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.5.0</version>
22+
<version>9.7.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.2.1.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.11.2</version>
85+
<version>3.12.0</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>
@@ -215,7 +208,7 @@
215208
<plugin>
216209
<groupId>org.codehaus.mojo</groupId>
217210
<artifactId>exec-maven-plugin</artifactId>
218-
<version>3.5.0</version>
211+
<version>3.5.1</version>
219212
<executions>
220213
<execution>
221214
<phase>test</phase>
@@ -280,7 +273,7 @@
280273
<!-- Test Phase -->
281274
<plugin>
282275
<artifactId>maven-surefire-plugin</artifactId>
283-
<version>3.5.2</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.11.2</version>
297+
<version>3.12.0</version>
305298
<executions>
306299
<execution>
307300
<id>attach-javadocs</id>
@@ -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,7 +378,7 @@
385378
<dependency>
386379
<groupId>com.google.cloud</groupId>
387380
<artifactId>libraries-bom</artifactId>
388-
<version>26.59.0</version>
381+
<version>26.71.0</version>
389382
<type>pom</type>
390383
<scope>import</scope>
391384
</dependency>

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/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;

src/main/java/com/google/firebase/cloud/FirestoreClient.java

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

2020
/**
2121
* {@code FirestoreClient} provides access to Google Cloud Firestore. Use this API to obtain a
22-
* <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
22+
* <a href="https://cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.cloud.firestore.Firestore">{@code Firestore}</a>
2323
* instance, which provides methods for updating and querying data in Firestore.
2424
*
2525
* <p>A Google Cloud project ID is required to access Firestore. FirestoreClient determines the
@@ -60,7 +60,7 @@ private FirestoreClient(FirebaseApp app, String databaseId) {
6060
* same instance for all invocations. The Firestore instance and all references obtained from it
6161
* becomes unusable, once the default app is deleted.
6262
*
63-
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
63+
* @return A non-null <a href="https://cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.cloud.firestore.Firestore">{@code Firestore}</a>
6464
* instance.
6565
*/
6666
@NonNull
@@ -74,7 +74,7 @@ public static Firestore getFirestore() {
7474
* obtained from it becomes unusable, once the specified app is deleted.
7575
*
7676
* @param app A non-null {@link FirebaseApp}.
77-
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
77+
* @return A non-null <a href="https://cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.cloud.firestore.Firestore">{@code Firestore}</a>
7878
* instance.
7979
*/
8080
@NonNull
@@ -90,7 +90,7 @@ public static Firestore getFirestore(FirebaseApp app) {
9090
*
9191
* @param app A non-null {@link FirebaseApp}.
9292
* @param database - The name of database.
93-
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
93+
* @return A non-null <a href="https://cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.cloud.firestore.Firestore">{@code Firestore}</a>
9494
* instance.
9595
*/
9696
@NonNull
@@ -104,7 +104,7 @@ public static Firestore getFirestore(FirebaseApp app, String database) {
104104
* references obtained from it becomes unusable, once the default app is deleted.
105105
*
106106
* @param database - The name of database.
107-
* @return A non-null <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/firestore/Firestore.html">{@code Firestore}</a>
107+
* @return A non-null <a href="https://cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.cloud.firestore.Firestore">{@code Firestore}</a>
108108
* instance.
109109
*/
110110
@NonNull

src/main/java/com/google/firebase/cloud/StorageClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static synchronized StorageClient getInstance(FirebaseApp app) {
7171
* configured via {@link com.google.firebase.FirebaseOptions} when initializing the app. If
7272
* no bucket was configured via options, this method throws an exception.
7373
*
74-
* @return a cloud storage <a href="https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/com/google/cloud/storage/Bucket.html">{@code Bucket}</a>
74+
* @return a cloud storage <a href="https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Bucket">{@code Bucket}</a>
7575
* instance.
7676
* @throws IllegalArgumentException If no bucket is configured via <code>FirebaseOptions</code>,
7777
* or if the bucket does not exist.
@@ -84,7 +84,7 @@ public Bucket bucket() {
8484
* Returns a cloud storage Bucket instance for the specified bucket name.
8585
*
8686
* @param name a non-null, non-empty bucket name.
87-
* @return a cloud storage <a href="https://googlecloudplatform.github.io/google-cloud-java/latest/google-cloud-clients/com/google/cloud/storage/Bucket.html">{@code Bucket}</a>
87+
* @return a cloud storage <a href="https://cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Bucket">{@code Bucket}</a>
8888
* instance.
8989
* @throws IllegalArgumentException If the bucket name is null, empty, or if the specified
9090
* bucket does not exist.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.firebase.remoteconfig;
18+
19+
import static com.google.common.base.Preconditions.checkArgument;
20+
import static com.google.common.base.Preconditions.checkNotNull;
21+
22+
import com.google.common.collect.ImmutableList;
23+
import com.google.firebase.internal.NonNull;
24+
import com.google.firebase.remoteconfig.internal.ServerTemplateResponse.AndConditionResponse;
25+
import com.google.firebase.remoteconfig.internal.ServerTemplateResponse.OneOfConditionResponse;
26+
27+
import java.util.List;
28+
import java.util.stream.Collectors;
29+
30+
final class AndCondition {
31+
private final ImmutableList<OneOfCondition> conditions;
32+
33+
AndCondition(@NonNull List<OneOfCondition> conditions) {
34+
checkNotNull(conditions, "List of conditions for AND operation must not be null.");
35+
checkArgument(!conditions.isEmpty(),
36+
"List of conditions for AND operation must not be empty.");
37+
this.conditions = ImmutableList.copyOf(conditions);
38+
}
39+
40+
AndCondition(AndConditionResponse andConditionResponse) {
41+
List<OneOfConditionResponse> conditionList = andConditionResponse.getConditions();
42+
checkNotNull(conditionList, "List of conditions for AND operation must not be null.");
43+
checkArgument(!conditionList.isEmpty(),
44+
"List of conditions for AND operation must not be empty");
45+
this.conditions = conditionList.stream()
46+
.map(OneOfCondition::new)
47+
.collect(ImmutableList.toImmutableList());
48+
}
49+
50+
@NonNull
51+
ImmutableList<OneOfCondition> getConditions() {
52+
return conditions;
53+
}
54+
55+
AndConditionResponse toAndConditionResponse() {
56+
return new AndConditionResponse()
57+
.setConditions(this.conditions.stream()
58+
.map(OneOfCondition::toOneOfConditionResponse)
59+
.collect(Collectors.toList()));
60+
}
61+
}

0 commit comments

Comments
 (0)