You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This, in theory, should work. However, note the use of an internal package.
We can try using NewClient(...), and will be able to provide its first arg of context.Context, but won't be able to provide a value for its second arg of type *internal.AppCheckConfigbecause it's internal.
Steps to reproduce:
import firebase "firebase.google.com/go"// get the admin app of type *firebase.Appapp, err:=firebase.NewApp(context.Background(), nil, opt)
iferr!=nil {
returnerr
}
// then try to get the type of *appcheck.ClientappCheck, err:=appcheck.NewClient(context.Background(), &internal.AppCheckConfig{ // <-- won't work because using internal packageProjectID: "your_proj_id",
})
iferr!=nil {
returnerr
}
The text was updated successfully, but these errors were encountered:
The "steps to reproduce" example imports the v1 major version of the module, which did not have an AppCheck method. The v4 major version ("firebase.google.com/go/v4") used by the example in the documentation does (docs).
The example from the documentation builds without errors for me. In an empty directory:
$ cat > main.go
package main
import (
"context"
"log"
"net/http"
firebaseAdmin "firebase.google.com/go/v4"
"firebase.google.com/go/v4/appcheck"
)
// ...
// rest of the code from https://firebase.google.com/docs/app-check/custom-resource-backend#go
// ...
$ go mod init example.com/test
go: creating new go.mod: module example.com/test
go: to add module requirements and sums:
$ go mod tidy
go: finding module for package firebase.google.com/go/v4/appcheck
go: finding module for package firebase.google.com/go/v4
go: found firebase.google.com/go/v4 in firebase.google.com/go/v4 v4.12.0
go: found firebase.google.com/go/v4/appcheck in firebase.google.com/go/v4 v4.12.0
$ go build .
// no errors
Describe your environment
golang:1.20-alpine
.Describe the problem
Original Stack Overflow source here.
First, I believe the Firebase documentation for how to use AppCheck with the Golang SDK is wrong here.
It says you need to create a new
appcheck.Client
directly via method off of yourfirebase.App
, but this method doesn't exist (anymore?):So, instead, I've referred to Firebase's
appcheck
package here which says you now need to create a new instance via this method instead:This, in theory, should work. However, note the use of an
internal
package.We can try using
NewClient(...)
, and will be able to provide its first arg ofcontext.Context
, but won't be able to provide a value for its second arg of type*internal.AppCheckConfig
because it's internal.Steps to reproduce:
The text was updated successfully, but these errors were encountered: