Skip to content

Commit 87b867c

Browse files
Merge dev into master
2 parents b04387e + a886851 commit 87b867c

File tree

10 files changed

+1293
-123
lines changed

10 files changed

+1293
-123
lines changed

.github/scripts/publish_preflight_check.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if [[ ! "${RELEASE_VERSION}" =~ ^([0-9]*)\.([0-9]*)\.([0-9]*)$ ]]; then
6464
fi
6565

6666
echo_info "Extracted release version: ${RELEASE_VERSION}"
67-
echo "::set-output name=version::v${RELEASE_VERSION}"
67+
echo "version=v${RELEASE_VERSION}" >> $GITHUB_OUTPUT
6868

6969

7070
echo_info ""
@@ -108,13 +108,13 @@ readonly CHANGELOG=`${CURRENT_DIR}/generate_changelog.sh`
108108
echo "$CHANGELOG"
109109

110110
# Parse and preformat the text to handle multi-line output.
111-
# See https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
111+
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string
112+
# and https://github.com/github/docs/issues/21529#issue-1418590935
112113
FILTERED_CHANGELOG=`echo "$CHANGELOG" | grep -v "\\[INFO\\]"`
113-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//'%'/'%25'}"
114-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\n'/'%0A'}"
115-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\r'/'%0D'}"
116-
echo "::set-output name=changelog::${FILTERED_CHANGELOG}"
117-
114+
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\''/'"'}"
115+
echo "changelog<<CHANGELOGEOF" >> $GITHUB_OUTPUT
116+
echo -e "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
117+
echo "CHANGELOGEOF" >> $GITHUB_OUTPUT
118118

119119
echo ""
120120
echo_info "--------------------------------------------"

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
go: [1.17, 1.18, 1.19]
11+
go: ['1.20', '1.21', '1.22']
1212

1313
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v4
16+
1417
- name: Set up Go ${{ matrix.go }}
15-
uses: actions/setup-go@v3
18+
uses: actions/setup-go@v5
1619
with:
1720
go-version: ${{ matrix.go }}
1821

1922
- name: Install golint
2023
run: go install golang.org/x/lint/golint@latest
2124

22-
- name: Check out code
23-
uses: actions/checkout@v2
24-
2525
- name: Run Linter
2626
run: |
2727
golint -set_exit_status ./...

.github/workflows/nightly.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ jobs:
2828
runs-on: ubuntu-latest
2929

3030
steps:
31+
- name: Check out code
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.event.client_payload.ref || github.ref }}
35+
3136
- name: Set up Go
32-
uses: actions/setup-go@v3
37+
uses: actions/setup-go@v5
3338
with:
34-
go-version: 1.17
39+
go-version: '1.20'
3540

3641
- name: Install golint
3742
run: go install golang.org/x/lint/golint@latest
3843

39-
- name: Check out code
40-
uses: actions/checkout@v2
41-
with:
42-
ref: ${{ github.event.client_payload.ref || github.ref }}
43-
4444
- name: Run Linter
4545
run: |
4646
golint -set_exit_status ./...

.github/workflows/release.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ jobs:
3939
# When manually triggering the build, the requester can specify a target branch or a tag
4040
# via the 'ref' client parameter.
4141
steps:
42+
- name: Check out code
43+
uses: actions/checkout@v4
44+
with:
45+
ref: ${{ github.event.client_payload.ref || github.ref }}
46+
4247
- name: Set up Go
43-
uses: actions/setup-go@v3
48+
uses: actions/setup-go@v5
4449
with:
45-
go-version: 1.17
50+
go-version: '1.20'
4651

4752
- name: Install golint
4853
run: go install golang.org/x/lint/golint@latest
4954

50-
- name: Check out code
51-
uses: actions/checkout@v2
52-
with:
53-
ref: ${{ github.event.client_payload.ref || github.ref }}
54-
5555
- name: Run Linter
5656
run: |
5757
golint -set_exit_status ./...
@@ -79,7 +79,7 @@ jobs:
7979

8080
steps:
8181
- name: Checkout source for publish
82-
uses: actions/checkout@v2
82+
uses: actions/checkout@v4
8383
with:
8484
persist-credentials: false
8585

@@ -89,31 +89,25 @@ jobs:
8989

9090
# We authorize this step with an access token that has write access to the master branch.
9191
- name: Merge to master
92-
uses: actions/github-script@0.9.0
92+
uses: actions/github-script@v7
9393
with:
9494
github-token: ${{ secrets.FIREBASE_GITHUB_TOKEN }}
9595
script: |
96-
github.repos.merge({
96+
github.rest.repos.merge({
9797
owner: context.repo.owner,
9898
repo: context.repo.repo,
9999
base: 'master',
100100
head: 'dev'
101101
})
102102
103-
# We pull this action from a custom fork of a contributor until
104-
# https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
105-
# this action does not support the "body" parameter.
103+
# See: https://cli.github.com/manual/gh_release_create
106104
- name: Create release tag
107-
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
108105
env:
109106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110-
with:
111-
tag_name: ${{ steps.preflight.outputs.version }}
112-
release_name: Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}
113-
body: ${{ steps.preflight.outputs.changelog }}
114-
commitish: master
115-
draft: false
116-
prerelease: false
107+
run: gh release create ${{ steps.preflight.outputs.version }}
108+
--title "Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}"
109+
--notes '${{ steps.preflight.outputs.changelog }}'
110+
--target "master"
117111

118112
# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
119113
- name: Post to Twitter

CONTRIBUTING.md

Lines changed: 83 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,89 @@ the integration tests, and only execute the unit tests.
115115

116116
### Integration Testing
117117

118-
A suite of integration tests are available in the Admin SDK source code.
119-
These tests are designed to run against an actual Firebase project. Create a new
120-
project in the [Firebase Console](https://console.firebase.google.com), if you
121-
do not already have one suitable for running the tests against. Then obtain the
122-
following credentials from the project:
123-
124-
1. *Service account certificate*: This can be downloaded as a JSON file from
125-
the "Settings > Service Accounts" tab of the Firebase console. Click
126-
"GENERATE NEW PRIVATE KEY" and copy the file into your Go workspace as
127-
`src/firebase.google.com/go/testdata/integration_cert.json`.
128-
2. *Web API key*: This is displayed in the "Settings > General" tab of the
129-
console. Copy it and save to a new text file. Copy this text file into
130-
your Go workspace as
131-
`src/firebase.google.com/go/testdata/integration_apikey.txt`.
132-
133-
You'll also need to grant your service account the 'Firebase Authentication Admin' role. This is
134-
required to ensure that exported user records contain the password hashes of the user accounts:
135-
1. Go to [Google Cloud Platform Console / IAM & admin](https://console.cloud.google.com/iam-admin).
136-
2. Find your service account in the list, and click the 'pencil' icon to edit it's permissions.
137-
3. Click 'ADD ANOTHER ROLE' and choose 'Firebase Authentication Admin'.
138-
4. Click 'SAVE'.
139-
140-
Some of the integration tests require an
141-
[Identity Platform](https://cloud.google.com/identity-platform/) project with multi-tenancy
142-
[enabled](https://cloud.google.com/identity-platform/docs/multi-tenancy-quickstart#enabling_multi-tenancy).
143-
An existing Firebase project can be upgraded to an Identity Platform project without losing any
144-
functionality via the
145-
[Identity Platform Marketplace Page](https://console.cloud.google.com/customer-identity). Note that
146-
charges may be incurred for active users beyond the Identity Platform free tier.
118+
Integration tests are executed against a real life Firebase project. If you do not already
119+
have one suitable for running the tests against, you can create a new project in the
120+
[Firebase Console](https://console.firebase.google.com) following the setup guide below.
121+
If you already have a Firebase project, you'll need to obtain credentials to communicate and
122+
authorize access to your Firebase project:
123+
124+
125+
1. Service account certificate: This allows access to your Firebase project through a service account
126+
which is required for all integration tests. This can be downloaded as a JSON file from the
127+
**Settings > Service Accounts** tab of the Firebase console when you click the
128+
**Generate new private key** button. Copy the file into the repo so it's available at
129+
`src/firebase.google.com/go/testdata/integration_cert.json`.
130+
> **Note:** Service accounts should be carefully managed and their keys should never be stored in publicly accessible source code or repositories.
131+
132+
133+
2. Web API key: This allows for Auth sign-in needed for some Authentication and Tenant Management
134+
integration tests. This is displayed in the **Settings > General** tab of the Firebase console
135+
after enabling Authentication as described in the steps below. Copy it and save to a new text
136+
file at `src/firebase.google.com/go/testdata/integration_apikey.txt`.
137+
138+
139+
Set up your Firebase project as follows:
140+
141+
142+
1. Enable Authentication:
143+
1. Go to the Firebase Console, and select **Authentication** from the **Build** menu.
144+
2. Click on **Get Started**.
145+
3. Select **Sign-in method > Add new provider > Email/Password** then enable both the
146+
**Email/Password** and **Email link (passwordless sign-in)** options.
147+
148+
149+
2. Enable Firestore:
150+
1. Go to the Firebase Console, and select **Firestore Database** from the **Build** menu.
151+
2. Click on the **Create database** button. You can choose to set up Firestore either in
152+
the production mode or in the test mode.
153+
154+
155+
3. Enable Realtime Database:
156+
1. Go to the Firebase Console, and select **Realtime Database** from the **Build** menu.
157+
2. Click on the **Create Database** button. You can choose to set up the Realtime Database
158+
either in the locked mode or in the test mode.
159+
160+
> **Note:** Integration tests are not run against the default Realtime Database reference and are
161+
instead run against a database created at `https://{PROJECT_ID}.firebaseio.com`.
162+
This second Realtime Database reference is created in the following steps.
163+
164+
3. In the **Data** tab click on the kebab menu (3 dots) and select **Create Database**.
165+
4. Enter your Project ID (Found in the **General** tab in **Account Settings**) as the
166+
**Realtime Database reference**. Again, you can choose to set up the Realtime Database
167+
either in the locked mode or in the test mode.
168+
169+
170+
4. Enable Storage:
171+
1. Go to the Firebase Console, and select **Storage** from the **Build** menu.
172+
2. Click on the **Get started** button. You can choose to set up Cloud Storage
173+
either in the production mode or in the test mode.
174+
175+
176+
5. Enable the IAM API:
177+
1. Go to the [Google Cloud console](https://console.cloud.google.com)
178+
and make sure your Firebase project is selected.
179+
2. Select **APIs & Services** from the main menu, and click the
180+
**ENABLE APIS AND SERVICES** button.
181+
3. Search for and enable **Identity and Access Management (IAM) API** by Google Enterprise API.
182+
183+
184+
6. Enable Tenant Management:
185+
1. Go to
186+
[Google Cloud console | Identity Platform](https://console.cloud.google.com/customer-identity/)
187+
and if it is not already enabled, click **Enable**.
188+
2. Then
189+
[enable multi-tenancy](https://cloud.google.com/identity-platform/docs/multi-tenancy-quickstart#enabling_multi-tenancy)
190+
for your project.
191+
192+
193+
7. Ensure your service account has the **Firebase Authentication Admin** role. This is required
194+
to ensure that exported user records contain the password hashes of the user accounts:
195+
1. Go to [Google Cloud console | IAM & admin](https://console.cloud.google.com/iam-admin).
196+
2. Find your service account in the list. If not added click the pencil icon to edit its
197+
permissions.
198+
3. Click **ADD ANOTHER ROLE** and choose **Firebase Authentication Admin**.
199+
4. Click **SAVE**.
200+
147201

148202
Now you can invoke the test suite as follows:
149203

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ For more information, visit the
2626

2727
## Installation
2828

29-
The Firebase Admin Go SDK can be installed using the `go install` utility:
29+
The Firebase Admin Go SDK can be installed using the `go get` utility:
3030

3131
```
3232
# Install the latest version:
33-
go install firebase.google.com/go/v4@latest
33+
go get firebase.google.com/go/v4@latest
3434
3535
# Or install a specific version:
36-
go install firebase.google.com/go/[email protected]
36+
go get firebase.google.com/go/[email protected]
3737
```
3838

3939
## Contributing
@@ -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.17 and higher.
48+
We currently support Go v1.20 and higher.
4949
[Continuous integration](https://github.com/firebase/firebase-admin-go/actions) system
50-
tests the code on Go v1.17 through v1.19.
50+
tests the code on Go v1.20 through v1.22.
5151

5252
## Documentation
5353

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.13.0"
42+
const Version = "4.14.0"
4343

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

go.mod

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
11
module firebase.google.com/go/v4
22

3-
go 1.17
3+
go 1.20
44

55
require (
6-
cloud.google.com/go/firestore v1.9.0
7-
cloud.google.com/go/storage v1.30.1
6+
cloud.google.com/go/firestore v1.15.0
7+
cloud.google.com/go/storage v1.40.0
88
github.com/MicahParks/keyfunc v1.9.0
99
github.com/golang-jwt/jwt/v4 v4.5.0
10-
github.com/google/go-cmp v0.5.9
11-
golang.org/x/oauth2 v0.7.0
12-
google.golang.org/api v0.114.0
10+
github.com/google/go-cmp v0.6.0
11+
golang.org/x/oauth2 v0.18.0
12+
google.golang.org/api v0.170.0
1313
google.golang.org/appengine/v2 v2.0.2
1414
)
1515

1616
require (
17-
cloud.google.com/go v0.110.0 // indirect
18-
cloud.google.com/go/compute v1.19.1 // indirect
17+
cloud.google.com/go v0.112.1 // indirect
18+
cloud.google.com/go/compute v1.24.0 // indirect
1919
cloud.google.com/go/compute/metadata v0.2.3 // indirect
20-
cloud.google.com/go/iam v0.13.0 // indirect
21-
cloud.google.com/go/longrunning v0.4.1 // indirect
20+
cloud.google.com/go/iam v1.1.7 // indirect
21+
cloud.google.com/go/longrunning v0.5.5 // indirect
22+
github.com/felixge/httpsnoop v1.0.4 // indirect
23+
github.com/go-logr/logr v1.4.1 // indirect
24+
github.com/go-logr/stdr v1.2.2 // indirect
2225
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
23-
github.com/golang/protobuf v1.5.3 // indirect
24-
github.com/google/uuid v1.3.0 // indirect
25-
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
26-
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
26+
github.com/golang/protobuf v1.5.4 // indirect
27+
github.com/google/s2a-go v0.1.7 // indirect
28+
github.com/google/uuid v1.6.0 // indirect
29+
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
30+
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
2731
go.opencensus.io v0.24.0 // indirect
28-
golang.org/x/net v0.17.0 // indirect
29-
golang.org/x/sync v0.1.0 // indirect
30-
golang.org/x/sys v0.13.0 // indirect
31-
golang.org/x/text v0.13.0 // indirect
32-
golang.org/x/time v0.3.0 // indirect
33-
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
34-
google.golang.org/appengine v1.6.7 // indirect
35-
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
36-
google.golang.org/grpc v1.56.3 // indirect
37-
google.golang.org/protobuf v1.30.0 // indirect
32+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
33+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
34+
go.opentelemetry.io/otel v1.24.0 // indirect
35+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
36+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
37+
golang.org/x/crypto v0.21.0 // indirect
38+
golang.org/x/net v0.22.0 // indirect
39+
golang.org/x/sync v0.6.0 // indirect
40+
golang.org/x/sys v0.18.0 // indirect
41+
golang.org/x/text v0.14.0 // indirect
42+
golang.org/x/time v0.5.0 // indirect
43+
google.golang.org/appengine v1.6.8 // indirect
44+
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
45+
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
46+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2 // indirect
47+
google.golang.org/grpc v1.62.1 // indirect
48+
google.golang.org/protobuf v1.33.0 // indirect
3849
)

0 commit comments

Comments
 (0)