@@ -30,6 +30,8 @@ import (
30
30
const maxReturnedResults = 1000
31
31
const maxLenPayloadCC = 1000
32
32
33
+ const defaultProviderID = "firebase"
34
+
33
35
var commonValidators = map [string ]func (interface {}) error {
34
36
"displayName" : validateDisplayName ,
35
37
"email" : validateEmail ,
@@ -51,14 +53,15 @@ func (c *Client) setHeader(ic identitytoolkitCall) {
51
53
52
54
// UserInfo is a collection of standard profile information for a user.
53
55
type UserInfo struct {
54
- DisplayName string `json:"displayName,omitempty"`
55
- Email string `json:"email,omitempty"`
56
- PhoneNumber string `json:"phoneNumber,omitempty"`
57
- PhotoURL string `json:"photoUrl,omitempty"`
58
- // ProviderID can be a short domain name (e.g. google.com),
56
+ DisplayName string
57
+ Email string
58
+ PhoneNumber string
59
+ PhotoURL string
60
+ // In the ProviderUserInfo[] ProviderID can be a short domain name (e.g. google.com),
59
61
// or the identity of an OpenID identity provider.
60
- ProviderID string `json:"providerId,omitempty"`
61
- UID string `json:"localId,omitempty"`
62
+ // In UserRecord.UserInfo it will return the constant string "firebase".
63
+ ProviderID string
64
+ UID string
62
65
}
63
66
64
67
// UserMetadata contains additional metadata associated with a user account.
@@ -498,32 +501,32 @@ func (u *UserToUpdate) preparePayload(user *identitytoolkit.IdentitytoolkitRelyi
498
501
// Response Types -------------------------------
499
502
500
503
type getUserResponse struct {
501
- RequestType string `json:"kind,omitempty"`
502
- Users []responseUserRecord `json:"users,omitempty"`
504
+ RequestType string
505
+ Users []responseUserRecord
503
506
}
504
507
505
508
type responseUserRecord struct {
506
- UID string `json:"localId,omitempty"`
507
- DisplayName string `json:"displayName,omitempty"`
508
- Email string `json:"email,omitempty"`
509
- PhoneNumber string `json:"phoneNumber,omitempty"`
510
- PhotoURL string `json:"photoUrl,omitempty"`
511
- CreationTimestamp int64 `json:"createdAt,string,omitempty"`
512
- LastLogInTimestamp int64 `json:"lastLoginAt,string,omitempty"`
513
- ProviderID string `json:"providerId,omitempty"`
514
- CustomClaims string `json:"customAttributes,omitempty"`
515
- Disabled bool `json:"disabled,omitempty"`
516
- EmailVerified bool `json:"emailVerified,omitempty"`
517
- ProviderUserInfo []* UserInfo `json:"providerUserInfo,omitempty"`
518
- PasswordHash string `json:"passwordHash,omitempty"`
519
- PasswordSalt string `json:"salt,omitempty"`
520
- ValidSince int64 `json:"validSince,string,omitempty"`
509
+ UID string
510
+ DisplayName string
511
+ Email string
512
+ PhoneNumber string
513
+ PhotoURL string
514
+ CreationTimestamp int64
515
+ LastLogInTimestamp int64
516
+ ProviderID string
517
+ CustomClaims string
518
+ Disabled bool
519
+ EmailVerified bool
520
+ ProviderUserInfo []* UserInfo
521
+ PasswordHash string
522
+ PasswordSalt string
523
+ ValidSince int64
521
524
}
522
525
523
526
type listUsersResponse struct {
524
- RequestType string `json:"kind,omitempty"`
525
- Users []responseUserRecord `json:"users,omitempty"`
526
- NextPage string `json:"nextPageToken,omitempty"`
527
+ RequestType string
528
+ Users []responseUserRecord
529
+ NextPage string
527
530
}
528
531
529
532
// Helper functions for retrieval and HTTP calls.
@@ -622,6 +625,7 @@ func makeExportedUser(r *identitytoolkit.UserInfo) (*ExportedUserRecord, error)
622
625
Email : r .Email ,
623
626
PhoneNumber : r .PhoneNumber ,
624
627
PhotoURL : r .PhotoUrl ,
628
+ ProviderID : defaultProviderID ,
625
629
UID : r .LocalId ,
626
630
},
627
631
CustomClaims : cc ,
0 commit comments