Skip to content

Commit 5d761a6

Browse files
authored
Documentation update (#19)
* Release 1.0.1 (#16) * Using the ClientOptions provided at App initialization to create the … (#12) * Using the ClientOptions provided at App initialization to create the HTTPClient in auth package. * Fixed context import * Updated test case * Fixing a test failure; Calling transport.NewHTTPClient() only when ctx and opts are available to avoid an unnecessary default credentials lookup. * Passing a non-nil context to AuthConfig during testing; Replacing Print+Exit calls with log.Fatal() (#13) * Bumped version to 1.0.1 (#15) * Removed unused package variable; Updated godocs
1 parent a2e1a20 commit 5d761a6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

auth/auth_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"firebase.google.com/go/internal"
3434
)
3535

36-
var creds *google.DefaultCredentials
3736
var client *Client
3837
var testIDToken string
3938

@@ -255,7 +254,7 @@ func TestVerifyIDTokenError(t *testing.T) {
255254
}
256255

257256
func TestNoProjectID(t *testing.T) {
258-
c, err := NewClient(&internal.AuthConfig{Ctx: context.Background(), Creds: creds})
257+
c, err := NewClient(&internal.AuthConfig{Ctx: context.Background()})
259258
if err != nil {
260259
t.Fatal(err)
261260
}
@@ -287,6 +286,9 @@ func TestCertificateRequestError(t *testing.T) {
287286
}
288287
}
289288

289+
// aeKeySource provides access to the public keys associated with App Engine apps. This
290+
// is used in tests to verify custom tokens and mock ID tokens when they are signed with
291+
// App Engine private keys.
290292
type aeKeySource struct {
291293
keys []*publicKey
292294
}

auth/crypto.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ import (
3737
"google.golang.org/api/transport"
3838
)
3939

40+
// publicKey represents a parsed RSA public key along with its unique key ID.
4041
type publicKey struct {
4142
Kid string
4243
Key *rsa.PublicKey
4344
}
4445

46+
// clock is used to query the current local time.
4547
type clock interface {
4648
Now() time.Time
4749
}
@@ -60,6 +62,8 @@ func (m *mockClock) Now() time.Time {
6062
return m.now
6163
}
6264

65+
// keySource is used to obtain a set of public keys, which can be used to verify cryptographic
66+
// signatures.
6367
type keySource interface {
6468
Keys() ([]*publicKey, error)
6569
}

0 commit comments

Comments
 (0)