Skip to content

Commit 26dec0b

Browse files
Merge dev into master
2 parents d515faf + d5fbad8 commit 26dec0b

File tree

7 files changed

+38
-17
lines changed

7 files changed

+38
-17
lines changed

auth/email_action_links.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ type ActionCodeSettings struct {
3131
AndroidPackageName string `json:"androidPackageName,omitempty"`
3232
AndroidMinimumVersion string `json:"androidMinimumVersion,omitempty"`
3333
AndroidInstallApp bool `json:"androidInstallApp,omitempty"`
34-
DynamicLinkDomain string `json:"dynamicLinkDomain,omitempty"`
34+
LinkDomain string `json:"linkDomain,omitempty"`
35+
// Deprecated: Use LinkDomain instead.
36+
DynamicLinkDomain string `json:"dynamicLinkDomain,omitempty"`
3537
}
3638

3739
func (settings *ActionCodeSettings) toMap() (map[string]interface{}, error) {

auth/email_action_links_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var testActionLinkResponse = []byte(fmt.Sprintf(testActionLinkFormat, testAction
3535
var testActionCodeSettings = &ActionCodeSettings{
3636
URL: "https://example.dynamic.link",
3737
HandleCodeInApp: true,
38+
LinkDomain: "hosted.page.link",
3839
DynamicLinkDomain: "custom.page.link",
3940
IOSBundleID: "com.example.ios",
4041
AndroidPackageName: "com.example.android",
@@ -44,6 +45,7 @@ var testActionCodeSettings = &ActionCodeSettings{
4445
var testActionCodeSettingsMap = map[string]interface{}{
4546
"continueUrl": "https://example.dynamic.link",
4647
"canHandleCodeInApp": true,
48+
"linkDomain": "hosted.page.link",
4749
"dynamicLinkDomain": "custom.page.link",
4850
"iOSBundleId": "com.example.ios",
4951
"androidPackageName": "com.example.android",
@@ -293,6 +295,7 @@ func TestEmailVerificationLinkError(t *testing.T) {
293295
cases := map[string]func(error) bool{
294296
"UNAUTHORIZED_DOMAIN": IsUnauthorizedContinueURI,
295297
"INVALID_DYNAMIC_LINK_DOMAIN": IsInvalidDynamicLinkDomain,
298+
"INVALID_HOSTING_LINK_DOMAIN": IsInvalidHostingLinkDomain,
296299
}
297300
s := echoServer(testActionLinkResponse, t)
298301
defer s.Close()

auth/user_mgt.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ const (
522522
emailAlreadyExists = "EMAIL_ALREADY_EXISTS"
523523
emailNotFound = "EMAIL_NOT_FOUND"
524524
invalidDynamicLinkDomain = "INVALID_DYNAMIC_LINK_DOMAIN"
525+
invalidHostingLinkDomain = "INVALID_HOSTING_LINK_DOMAIN"
525526
phoneNumberAlreadyExists = "PHONE_NUMBER_ALREADY_EXISTS"
526527
tenantNotFound = "TENANT_NOT_FOUND"
527528
uidAlreadyExists = "UID_ALREADY_EXISTS"
@@ -556,6 +557,11 @@ func IsInvalidDynamicLinkDomain(err error) bool {
556557
return hasAuthErrorCode(err, invalidDynamicLinkDomain)
557558
}
558559

560+
// IsInvalidHostingLinkDomain checks if the given error was due to an invalid hosting link domain.
561+
func IsInvalidHostingLinkDomain(err error) bool {
562+
return hasAuthErrorCode(err, invalidHostingLinkDomain)
563+
}
564+
559565
// IsInvalidEmail checks if the given error was due to an invalid email.
560566
//
561567
// Deprecated: Always returns false.
@@ -1447,6 +1453,11 @@ var serverError = map[string]*authError{
14471453
message: "the provided dynamic link domain is not configured or authorized for the current project",
14481454
authCode: invalidDynamicLinkDomain,
14491455
},
1456+
"INVALID_HOSTING_LINK_DOMAIN": {
1457+
code: internal.InvalidArgument,
1458+
message: "the provided hosting link domain is not configured in Firebase Hosting or is not owned by the current project",
1459+
authCode: invalidHostingLinkDomain,
1460+
},
14501461
"PHONE_NUMBER_EXISTS": {
14511462
code: internal.AlreadyExists,
14521463
message: "user with the provided phone number already exists",

auth/user_mgt_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,11 @@ func TestHTTPErrorWithCode(t *testing.T) {
21512151
errorutils.IsInvalidArgument,
21522152
"the provided dynamic link domain is not configured or authorized for the current project",
21532153
},
2154+
"INVALID_HOSTING_LINK_DOMAIN": {
2155+
IsInvalidHostingLinkDomain,
2156+
errorutils.IsInvalidArgument,
2157+
"the provided hosting link domain is not configured in Firebase Hosting or is not owned by the current project",
2158+
},
21542159
"PHONE_NUMBER_EXISTS": {
21552160
IsPhoneNumberAlreadyExists,
21562161
errorutils.IsAlreadyExists,

firebase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
var defaultAuthOverrides = make(map[string]interface{})
4141

4242
// Version of the Firebase Go Admin SDK.
43-
const Version = "4.17.0"
43+
const Version = "4.18.0"
4444

4545
// firebaseEnvName is the name of the environment variable with the Config.
4646
const firebaseEnvName = "FIREBASE_CONFIG"

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ require (
5050
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
5151
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
5252
go.opentelemetry.io/otel/trace v1.35.0 // indirect
53-
golang.org/x/crypto v0.38.0 // indirect
54-
golang.org/x/net v0.40.0 // indirect
55-
golang.org/x/sync v0.14.0 // indirect
56-
golang.org/x/sys v0.33.0 // indirect
57-
golang.org/x/text v0.25.0 // indirect
53+
golang.org/x/crypto v0.40.0 // indirect
54+
golang.org/x/net v0.42.0 // indirect
55+
golang.org/x/sync v0.16.0 // indirect
56+
golang.org/x/sys v0.34.0 // indirect
57+
golang.org/x/text v0.27.0 // indirect
5858
golang.org/x/time v0.11.0 // indirect
5959
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect
6060
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,35 +107,35 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt
107107
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
108108
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
109109
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
110-
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
111-
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
110+
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
111+
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
112112
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
113113
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
114114
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
115115
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
116-
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
117-
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
116+
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
117+
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
118118
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
119119
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
120120
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
121121
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
122-
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
123-
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
122+
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
123+
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
124124
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
125125
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
126126
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
127127
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
128128
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
129-
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
130-
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
129+
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
130+
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
131131
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
132132
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
133133
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
134134
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
135135
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
136136
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
137-
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
138-
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
137+
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
138+
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
139139
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
140140
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
141141
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

0 commit comments

Comments
 (0)