Skip to content

Commit c3be6f2

Browse files
Merge dev into master
2 parents 6a28190 + b8f0b13 commit c3be6f2

File tree

13 files changed

+68
-7
lines changed

13 files changed

+68
-7
lines changed
32 Bytes
Binary file not shown.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
go: ['1.20', '1.21', '1.22']
11+
go: ['1.21', '1.22', '1.23']
1212

1313
steps:
1414
- name: Check out code

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Go
3737
uses: actions/setup-go@v5
3838
with:
39-
go-version: '1.20'
39+
go-version: '1.21'
4040

4141
- name: Install golint
4242
run: go install golang.org/x/lint/golint@latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Set up Go
4848
uses: actions/setup-go@v5
4949
with:
50-
go-version: '1.20'
50+
go-version: '1.21'
5151

5252
- name: Install golint
5353
run: go install golang.org/x/lint/golint@latest

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ requests, code review feedback, and also pull requests.
4545
## Supported Go Versions
4646

4747
The Admin Go SDK is compatible with at least the three most recent, major Go releases.
48-
We currently support Go v1.20 and higher.
48+
We currently support Go v1.21 and higher.
4949
[Continuous integration](https://github.com/firebase/firebase-admin-go/actions) system
50-
tests the code on Go v1.20 through v1.22.
50+
tests the code on Go v1.21 through v1.23.
5151

5252
## Documentation
5353

auth/auth.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"errors"
2222
"fmt"
2323
"os"
24+
"runtime"
2425
"strings"
2526
"time"
2627

@@ -133,10 +134,12 @@ func NewClient(ctx context.Context, conf *internal.AuthConfig) (*Client, error)
133134
return nil, err
134135
}
135136

137+
goVersion := strings.TrimPrefix(runtime.Version(), "go")
136138
hc := internal.WithDefaultRetryConfig(transport)
137139
hc.CreateErrFn = handleHTTPError
138140
hc.Opts = []internal.HTTPOption{
139141
internal.WithHeader("X-Client-Version", fmt.Sprintf("Go/Admin/%s", conf.Version)),
142+
internal.WithHeader("x-goog-api-client", fmt.Sprintf("gl-go/%s fire-admin/%s", goVersion, conf.Version)),
140143
}
141144

142145
baseURL := defaultAuthURL

auth/auth_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"log"
2424
"net/http"
2525
"os"
26+
"runtime"
2627
"strings"
2728
"syscall"
2829
"testing"
@@ -1451,6 +1452,13 @@ func checkBaseClient(client *Client, wantProjectID string) error {
14511452
return fmt.Errorf("version = %q; want = %q", version, wantVersion)
14521453
}
14531454

1455+
goVersion := strings.TrimPrefix(runtime.Version(), "go")
1456+
xGoogAPIClientHeader := req.Header.Get("x-goog-api-client")
1457+
wantXGoogAPIClientHeader := fmt.Sprintf("gl-go/%s fire-admin/%s", goVersion, testVersion)
1458+
if xGoogAPIClientHeader != wantXGoogAPIClientHeader {
1459+
return fmt.Errorf("x-goog-api-client header = %q; want = %q", xGoogAPIClientHeader, wantXGoogAPIClientHeader)
1460+
}
1461+
14541462
return nil
14551463
}
14561464

auth/user_mgt_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"net/http"
2525
"net/http/httptest"
2626
"reflect"
27+
"runtime"
2728
"sort"
2829
"strconv"
2930
"strings"
@@ -2315,6 +2316,12 @@ func echoServer(resp interface{}, t *testing.T) *mockAuthServer {
23152316
t.Errorf("X-Client-Version header = %q; want: %q", gh, wh)
23162317
}
23172318

2319+
gh = r.Header.Get("x-goog-api-client")
2320+
wh = fmt.Sprintf("gl-go/%s fire-admin/%s", strings.TrimPrefix(runtime.Version(), "go"), testVersion)
2321+
if gh != wh {
2322+
t.Errorf("x-goog-api-client header = %q; want: %q", gh, wh)
2323+
}
2324+
23182325
for k, v := range s.Header {
23192326
w.Header().Set(k, v)
23202327
}

firebase.go

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

4141
// Version of the Firebase Go Admin SDK.
42-
const Version = "4.14.1"
42+
const Version = "4.15.0"
4343

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

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module firebase.google.com/go/v4
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
cloud.google.com/go/firestore v1.15.0

0 commit comments

Comments
 (0)