Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go: [1.12, 1.16]
go: [1.15, 1.16, 1.17]

steps:
- name: Set up Go ${{ matrix.go }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.12
go-version: 1.15

- name: Install golint
run: go get golang.org/x/lint/golint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.12
go-version: 1.15

- name: Install golint
run: go get golang.org/x/lint/golint
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ requests, code review feedback, and also pull requests.

## Supported Go Versions

We support Go v1.12 and higher.
The Admin Go SDK is compatible with at least the three most recent, major Go releases.
We currently support Go v1.15 and higher.
[Continuous integration](https://github.com/firebase/firebase-admin-go/actions) system
tests the code on Go v1.12 through v1.14.
tests the code on Go v1.15 through v1.17.

## Documentation

Expand Down
1 change: 1 addition & 0 deletions auth/auth_appengine.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build appengine
// +build appengine

// Copyright 2017 Google Inc. All Rights Reserved.
Expand Down
1 change: 1 addition & 0 deletions auth/auth_std.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !appengine
// +build !appengine

// Copyright 2017 Google Inc. All Rights Reserved.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module firebase.google.com/go/v4

go 1.11
go 1.15

require (
cloud.google.com/go/firestore v1.5.0
Expand Down
27 changes: 18 additions & 9 deletions snippets/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,26 +553,35 @@ func importWithBcrypt(ctx context.Context, client *auth.Client) {

func importWithScrypt(ctx context.Context, client *auth.Client) {
// [START import_with_scrypt]
users := []*auth.UserToImport{
(&auth.UserToImport{}).
UID("some-uid").
Email("user@example.com").
PasswordHash([]byte("password-hash")).
PasswordSalt([]byte("salt")),
b64URLdecode := func(s string) []byte {
b, err := base64.URLEncoding.DecodeString(s)
if err != nil {
log.Fatalln("Failed to decode string", err)
}

return b
}
b64decode := func(s string) []byte {
b64Stddecode := func(s string) []byte {
b, err := base64.StdEncoding.DecodeString(s)
if err != nil {
log.Fatalln("Failed to decode string", err)
}
return b
}
// Users retrieved from Firebase Auth's backend need to be base64URL decoded
users := []*auth.UserToImport{
(&auth.UserToImport{}).
UID("some-uid").
Email("user@example.com").
PasswordHash(b64URLdecode("password-hash")).
PasswordSalt(b64URLdecode("salt")),
}

// All the parameters below can be obtained from the Firebase Console's "Users"
// section. Base64 encoded parameters must be decoded into raw bytes.
h := hash.Scrypt{
Key: b64decode("base64-secret"),
SaltSeparator: b64decode("base64-salt-separator"),
Key: b64Stddecode("base64-secret"),
SaltSeparator: b64Stddecode("base64-salt-separator"),
Rounds: 8,
MemoryCost: 14,
}
Expand Down