Skip to content

Conversation

chemidy
Copy link
Contributor

@chemidy chemidy commented Dec 29, 2017

Replace of makeHTTPCall by google-api-go-client identitytoolkit/v3

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot. The email used to register you as an authorized contributor must be the email used for the Git commit.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@chemidy
Copy link
Contributor Author

chemidy commented Dec 29, 2017

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

Copy link
Contributor

@avishalom avishalom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this !!!
A tiny nit, and a request for a small refactor below (can we set the header in a single place?)

auth/user_mgt.go Outdated
return params, nil
}

func (u *UserToUpdate) preparePayload() (map[string]interface{}, error) {
func (u *UserToUpdate) preparePayload(user *identitytoolkit.IdentitytoolkitRelyingpartySetAccountInfoRequest) (map[string]interface{}, error) {
Copy link
Contributor

@avishalom avishalom Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first output is always ignored, might as well omit it here. (and in the parallel function)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

auth/user_mgt.go Outdated
if err := c.makeHTTPCall(ctx, "signupNewUser", payload, &rur); err != nil {

relyingpartySignupNewUserCall := c.is.Relyingparty.SignupNewUser(request)
relyingpartySignupNewUserCall.Header().Set("X-Client-Version", c.version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the fact that the header is set in 5 different places.
(I.e. if we ever change the header, or want to add new identifiers to every call, we'd like to do it in one place)
I don't see a super elegant way to fix this though.

maybe something along the lines of:
(this isn't ideal, ideally I'd also refactor in the next line (and add "Do() (interface{}, error)", and "Context(ctx) *<interfaceName>" to the new interface), but returning an interface{} from Do() and casting it later seems ugly.)

// Create a new interface
type headerable interface {
    Header() http.Header
}

// refactor this lines 
func (c *Client)execute(ic *headerable) (){
    ic.Header().Set("X-Client-Version", c.version)
}

WDYT? do you have another solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good compromise, i was looking for a better solution, but i didn't find anything more elegant :(

@avishalom avishalom assigned chemidy and unassigned avishalom Jan 2, 2018
@avishalom avishalom self-assigned this Jan 3, 2018
auth/user_mgt.go Outdated
@@ -38,6 +39,16 @@ var commonValidators = map[string]func(interface{}) error{
"localId": validateUID,
}

// Create a new interface
type headerable interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change!
and I apologize for this secondary nit pick, but I don't like the example names I suggested.
execute would have been a good name if we rolled the ".Do()" line into it.
as it is maybe "prepareCall", or "setHeader", or "beforeCall" or a similar name that describes the fact that this is a needed step before the call, that adds some params to the header...

Likewise maybe instead of headerable "relayingpartyCall" would be a better descriptor.
(again my apologies for not thinking of these names when I suggested the change.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, my first idea was setHeader so i keep it.

avishalom
avishalom previously approved these changes Jan 3, 2018
Copy link
Contributor

@avishalom avishalom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has my approval.
Pending Hiranya's approval. (and a small naming nit)

@avishalom avishalom dismissed their stale review January 3, 2018 15:57

I don't want to green this at this stage.

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks mostly good. Thanks for putting it together. I've pointed out a few areas for improvement.

@avishalom once the requested changes are made, do one more review and merge if you feel good about it.

auth/user_mgt.go Outdated
@@ -37,6 +39,16 @@ var commonValidators = map[string]func(interface{}) error{
"localId": validateUID,
}

// Create a new interface
type relayingpartyCall interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend calling this identitytoolkitCall

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not easy to find the right name :)

auth/user_mgt.go Outdated

var lur listUsersResponse
err := it.client.makeHTTPCall(it.ctx, "downloadAccount", params, &lur)
relyingpartyDownloadAccountCall := it.client.is.Relyingparty.DownloadAccount(request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to call? Go advocates shorter names for local variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect 👍

auth/user_mgt.go Outdated
@@ -525,27 +602,45 @@ func makeExportedUser(r responseUserRecord) (*ExportedUserRecord, error) {
}
}

var providerID string
if len(r.ProviderUserInfo) == 1 {
providerID = r.ProviderUserInfo[0].ProviderId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avishalom can you verify this logic is correct? Looks a little strange.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a mistake, i will fix it.
This is Because on the UserRecord, the UserInfo struct is used for ProviderUserInfo and for UserInfo. But providerID is only set for a ProviderUserInfo.

// UserRecord contains metadata associated with a Firebase user account.
type UserRecord struct {
	*UserInfo
	CustomClaims     map[string]interface{}
	Disabled         bool
	EmailVerified    bool
	ProviderUserInfo []*UserInfo
	UserMetadata     *UserMetadata
}
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to add a test that would have failed in this case?

@@ -49,9 +50,11 @@ var testUser = &UserRecord{
DisplayName: "Test User",
PhotoURL: "http://www.example.com/testuser/photo.png",
Email: "[email protected]",
UID: "[email protected]",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention here? Setting UID to email (and phone number below) looks unusual.

@@ -683,6 +705,10 @@ func echoServer(resp interface{}, t *testing.T) *mockAuthServer {
t.Fatal(err)
}
s.Rbody = reqBody
// remove extra newline for reflect.DeepEqual
if string(s.Rbody[len(s.Rbody)-1]) == "\n" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.TrimSpace(s.Rbody)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see why you added the LocalId property above. I'd recommend changing this to testuid so the intention is clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fix

ks: newHTTPKeySource(googleCertURL, hc),
projectID: c.ProjectID,
snr: snr,
url: idToolKitURL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also remove url from the definition of Client type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course

@hiranya911 hiranya911 removed their assignment Jan 3, 2018
resp := &ExportedUserRecord{
UserRecord: &UserRecord{
UserInfo: &UserInfo{
DisplayName: r.DisplayName,
Email: r.Email,
PhoneNumber: r.PhoneNumber,
PhotoURL: r.PhotoURL,
ProviderID: r.ProviderID,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should actually set ProviderID to the constant string firebase here. That's what our other Admin SDKs do, and it's a documented behavior. @avishalom can you make the necessary changes in a follow up PR and update the tests?

@avishalom
Copy link
Contributor

Resolve conflicts and it looks good to me.
(if it makes sense to add a test that would have failed on the ProviderUserInfo issue, then add a test for that.)

@avishalom avishalom merged commit eccb159 into firebase:dev Jan 8, 2018
@chemidy chemidy deleted the identitytoolkit branch January 8, 2018 20:57
hiranya911 pushed a commit that referenced this pull request Jan 11, 2018
* Documentation fix md file (#43)

* Clarify certificate download comment

* Fix Link

* Adding User Management utils, including Custom Claims in the auth package. (#42)

Adding the user management go SDK.
This includes the customClaims and the iterator over all users. (as well as Create, Update, Delete User, and GetUser (by UID, Phone or Email))

Proposal : go/firebase-go-user-mgt

Code snippets: 
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/manage-users
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/custom-claims

TODO: clean up the case of an http.DefaultClient when there are no options.

* Minor improvements to user management code (#44)

* some changes to auth

* Implemented a reusable HTTP client API

* Added test cases

* Comment clean up

* Simplified the usage by adding HTTPClient

* Using the old ctx import

* Support for arbitrary entity types in the request

* Renamed fields; Added documentation

* Removing a redundant else case

* initial

* more integration tests

* set custom - still needs guessing the type for unmarshaling.

* tests

* server

* server

* .

* json

* json

* move testdata

* get

* tests

* updated to param struct of pointers to call create and update

* Comments

* cleanup

* cleanup

* cleanup

* cleanup minor test changes

* Changing the iteraator pattern

* last page iterator test fix

* clean up tests next.

* make the fetch tidier

* fetch cleanup

* cc change

* custom claims

* newline

* adding error propagation to makeExportedUser

* remove trivial claims map type

* list users test data

* rename p ptr, and remove the with... options for the iterator

* rename p ptr

* some unit tests

* adding integration tests for custom claims

* NO ERROR

* unit tests

* comments hkj

* addressing comments

* delete unneeded json file

* phone NUMBER

* typo

* remove cc from create

* refactor param structs

* remove package ptr

* test refactor

* cleanup comments

* cleanup debug.test

* Adding back the default http client

* fix httpClient for tests

* creds

* creds

* fix default http client

* cleanupPrintfs

* disable

* Reanme payload vars

* Revert newHTTPKeySource function

* add back defaultClient in newClient

* reenable testNewHTTPClientNoOpts)

* reverting keysource tests)

* Take the httpClient from the keysource

* Removethe +1 second for the token timestamp.

* Adding tests

* White spaces

* Redesign the error validators

* prepare returns an error.

* cleanup

* dissolve

* dissolve

* clean tests

* split integration tests

* addressing comments

* addressing comments opt branch/ BEFORE hc change

* Removing the defaultClient from the NewClient, and extracting the NewClient creation outside of KeySource

* closer from echoServer

* cleanup + 500 error unit test

* unify error messages

* Refactor stop side effect for params preparation

* +1 to timestamp for flakiness

* removing +1

* disallow defaultClient

* whitespaces

* http default

* add TODO

* Code clean up and refactoring

* Refactored integration tests (#46)

* Refactored integration tests

* Minor cleanup

* Auth Unit Test Improvements (#45)

* Cleaning up new auth tests

* More updates to tests; Dissolved commonParams type

* More test updates

* More argument validation for auth

* Fixed a bug in enable/disable user; Added more tests; Cleaned up unit tests

* Removed debug file

* Create the 5th user in the integration tests for user management. (#47)

* Bump version to 2.2.0 (#49)

* Adding version, stat counter header and test (#50)

* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Auth Package Internal Cleanup (#53)

* Release v2.2.1 (#51)

* Adding version, stat counter header and test (#50)
* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Experimental auth cleanup

* Using a mock token source in tests

* Further cleaning up the test cases

* Implemented IID Delete API (#41)

* Implemented IID Delete API

* Cleaned up code

* Updated test case

* Updating comments

* Improved error handling

* Fixing malformed error messages due to extra format placeholders; Using the recommended Go error message format (no caps or punctuation)

* Bumped version to 2.3.0 (#56)

* use const for Common HTTP methods and HTTP status codes (#58)

* use const for Common HTTP methods and HTTP status codes

* fix format verbs  %q to %d

* golint - remove redundant if ...; err != nil check (#59)

* golint - remove redundant if ...; err != nil check

* add golint check on travis.yml

* update readme with Authentication Guide & Release Notes (#61)

* update readme with Authentication Guide & Release Notes

* fix a misspelling : separately

* fix missing newline before package

* Format JSON test data (#63)

* use identitytoolkit/v3 go client instead of makeHTTPCall (#60)

* use identitytoolkit/v3 go client instead of makeHTTPCall

* remove unnecessary if because empty values are not sent with identitytoolkit

* refactoring to avoid multiple header set

* change execute func to setHeader

* remove url from Client type, rename relayingpartyCall interface + fix providerID mistake

* change rawId value in test to 'testuid'

* Firebase App auto init (#54)

* FIREBASE_CONFIG env variable auto init, allows calling initialize_app with not arguments using the env variable

* allow env var to contain json

* add tests for json string in env file

* constant provider id plus tests (#64)

* Constant provider id plus tests

* Cleaning up the json tags in the structs following the identitytoolkit PR

* Expand comment about ProviderID

* Contributing (#65)

* [docs update] How to view test coverage.

* Release Version 2.3.0 (#57) (#67)

* Documentation fix md file (#43)

* Clarify certificate download comment

* Fix Link

* Adding User Management utils, including Custom Claims in the auth package. (#42)

Adding the user management go SDK.
This includes the customClaims and the iterator over all users. (as well as Create, Update, Delete User, and GetUser (by UID, Phone or Email))

Proposal : go/firebase-go-user-mgt

Code snippets: 
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/manage-users
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/custom-claims

TODO: clean up the case of an http.DefaultClient when there are no options.

* Minor improvements to user management code (#44)

* some changes to auth

* Implemented a reusable HTTP client API

* Added test cases

* Comment clean up

* Simplified the usage by adding HTTPClient

* Using the old ctx import

* Support for arbitrary entity types in the request

* Renamed fields; Added documentation

* Removing a redundant else case

* initial

* more integration tests

* set custom - still needs guessing the type for unmarshaling.

* tests

* server

* server

* .

* json

* json

* move testdata

* get

* tests

* updated to param struct of pointers to call create and update

* Comments

* cleanup

* cleanup

* cleanup

* cleanup minor test changes

* Changing the iteraator pattern

* last page iterator test fix

* clean up tests next.

* make the fetch tidier

* fetch cleanup

* cc change

* custom claims

* newline

* adding error propagation to makeExportedUser

* remove trivial claims map type

* list users test data

* rename p ptr, and remove the with... options for the iterator

* rename p ptr

* some unit tests

* adding integration tests for custom claims

* NO ERROR

* unit tests

* comments hkj

* addressing comments

* delete unneeded json file

* phone NUMBER

* typo

* remove cc from create

* refactor param structs

* remove package ptr

* test refactor

* cleanup comments

* cleanup debug.test

* Adding back the default http client

* fix httpClient for tests

* creds

* creds

* fix default http client

* cleanupPrintfs

* disable

* Reanme payload vars

* Revert newHTTPKeySource function

* add back defaultClient in newClient

* reenable testNewHTTPClientNoOpts)

* reverting keysource tests)

* Take the httpClient from the keysource

* Removethe +1 second for the token timestamp.

* Adding tests

* White spaces

* Redesign the error validators

* prepare returns an error.

* cleanup

* dissolve

* dissolve

* clean tests

* split integration tests

* addressing comments

* addressing comments opt branch/ BEFORE hc change

* Removing the defaultClient from the NewClient, and extracting the NewClient creation outside of KeySource

* closer from echoServer

* cleanup + 500 error unit test

* unify error messages

* Refactor stop side effect for params preparation

* +1 to timestamp for flakiness

* removing +1

* disallow defaultClient

* whitespaces

* http default

* add TODO

* Code clean up and refactoring

* Refactored integration tests (#46)

* Refactored integration tests

* Minor cleanup

* Auth Unit Test Improvements (#45)

* Cleaning up new auth tests

* More updates to tests; Dissolved commonParams type

* More test updates

* More argument validation for auth

* Fixed a bug in enable/disable user; Added more tests; Cleaned up unit tests

* Removed debug file

* Create the 5th user in the integration tests for user management. (#47)

* Bump version to 2.2.0 (#49)

* Adding version, stat counter header and test (#50)

* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Auth Package Internal Cleanup (#53)

* Release v2.2.1 (#51)

* Adding version, stat counter header and test (#50)
* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Experimental auth cleanup

* Using a mock token source in tests

* Further cleaning up the test cases

* Implemented IID Delete API (#41)

* Implemented IID Delete API

* Cleaned up code

* Updated test case

* Updating comments

* Improved error handling

* Fixing malformed error messages due to extra format placeholders; Using the recommended Go error message format (no caps or punctuation)

* Bumped version to 2.3.0 (#56)

* Bumped Version 2.4.0 (#66)

* Release Version 2.3.0 (#57) (#68)
hiranya911 pushed a commit that referenced this pull request Jan 11, 2018
* Release Version 2.4.0 (#69)

* Documentation fix md file (#43)

* Clarify certificate download comment

* Fix Link

* Adding User Management utils, including Custom Claims in the auth package. (#42)

Adding the user management go SDK.
This includes the customClaims and the iterator over all users. (as well as Create, Update, Delete User, and GetUser (by UID, Phone or Email))

Proposal : go/firebase-go-user-mgt

Code snippets: 
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/manage-users
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/custom-claims

TODO: clean up the case of an http.DefaultClient when there are no options.

* Minor improvements to user management code (#44)

* some changes to auth

* Implemented a reusable HTTP client API

* Added test cases

* Comment clean up

* Simplified the usage by adding HTTPClient

* Using the old ctx import

* Support for arbitrary entity types in the request

* Renamed fields; Added documentation

* Removing a redundant else case

* initial

* more integration tests

* set custom - still needs guessing the type for unmarshaling.

* tests

* server

* server

* .

* json

* json

* move testdata

* get

* tests

* updated to param struct of pointers to call create and update

* Comments

* cleanup

* cleanup

* cleanup

* cleanup minor test changes

* Changing the iteraator pattern

* last page iterator test fix

* clean up tests next.

* make the fetch tidier

* fetch cleanup

* cc change

* custom claims

* newline

* adding error propagation to makeExportedUser

* remove trivial claims map type

* list users test data

* rename p ptr, and remove the with... options for the iterator

* rename p ptr

* some unit tests

* adding integration tests for custom claims

* NO ERROR

* unit tests

* comments hkj

* addressing comments

* delete unneeded json file

* phone NUMBER

* typo

* remove cc from create

* refactor param structs

* remove package ptr

* test refactor

* cleanup comments

* cleanup debug.test

* Adding back the default http client

* fix httpClient for tests

* creds

* creds

* fix default http client

* cleanupPrintfs

* disable

* Reanme payload vars

* Revert newHTTPKeySource function

* add back defaultClient in newClient

* reenable testNewHTTPClientNoOpts)

* reverting keysource tests)

* Take the httpClient from the keysource

* Removethe +1 second for the token timestamp.

* Adding tests

* White spaces

* Redesign the error validators

* prepare returns an error.

* cleanup

* dissolve

* dissolve

* clean tests

* split integration tests

* addressing comments

* addressing comments opt branch/ BEFORE hc change

* Removing the defaultClient from the NewClient, and extracting the NewClient creation outside of KeySource

* closer from echoServer

* cleanup + 500 error unit test

* unify error messages

* Refactor stop side effect for params preparation

* +1 to timestamp for flakiness

* removing +1

* disallow defaultClient

* whitespaces

* http default

* add TODO

* Code clean up and refactoring

* Refactored integration tests (#46)

* Refactored integration tests

* Minor cleanup

* Auth Unit Test Improvements (#45)

* Cleaning up new auth tests

* More updates to tests; Dissolved commonParams type

* More test updates

* More argument validation for auth

* Fixed a bug in enable/disable user; Added more tests; Cleaned up unit tests

* Removed debug file

* Create the 5th user in the integration tests for user management. (#47)

* Bump version to 2.2.0 (#49)

* Adding version, stat counter header and test (#50)

* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Auth Package Internal Cleanup (#53)

* Release v2.2.1 (#51)

* Adding version, stat counter header and test (#50)
* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Experimental auth cleanup

* Using a mock token source in tests

* Further cleaning up the test cases

* Implemented IID Delete API (#41)

* Implemented IID Delete API

* Cleaned up code

* Updated test case

* Updating comments

* Improved error handling

* Fixing malformed error messages due to extra format placeholders; Using the recommended Go error message format (no caps or punctuation)

* Bumped version to 2.3.0 (#56)

* use const for Common HTTP methods and HTTP status codes (#58)

* use const for Common HTTP methods and HTTP status codes

* fix format verbs  %q to %d

* golint - remove redundant if ...; err != nil check (#59)

* golint - remove redundant if ...; err != nil check

* add golint check on travis.yml

* update readme with Authentication Guide & Release Notes (#61)

* update readme with Authentication Guide & Release Notes

* fix a misspelling : separately

* fix missing newline before package

* Format JSON test data (#63)

* use identitytoolkit/v3 go client instead of makeHTTPCall (#60)

* use identitytoolkit/v3 go client instead of makeHTTPCall

* remove unnecessary if because empty values are not sent with identitytoolkit

* refactoring to avoid multiple header set

* change execute func to setHeader

* remove url from Client type, rename relayingpartyCall interface + fix providerID mistake

* change rawId value in test to 'testuid'

* Firebase App auto init (#54)

* FIREBASE_CONFIG env variable auto init, allows calling initialize_app with not arguments using the env variable

* allow env var to contain json

* add tests for json string in env file

* constant provider id plus tests (#64)

* Constant provider id plus tests

* Cleaning up the json tags in the structs following the identitytoolkit PR

* Expand comment about ProviderID

* Contributing (#65)

* [docs update] How to view test coverage.

* Release Version 2.3.0 (#57) (#67)

* Documentation fix md file (#43)

* Clarify certificate download comment

* Fix Link

* Adding User Management utils, including Custom Claims in the auth package. (#42)

Adding the user management go SDK.
This includes the customClaims and the iterator over all users. (as well as Create, Update, Delete User, and GetUser (by UID, Phone or Email))

Proposal : go/firebase-go-user-mgt

Code snippets: 
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/manage-users
  https://firebase-dot-devsite.googleplex.com/docs/auth/admin/custom-claims

TODO: clean up the case of an http.DefaultClient when there are no options.

* Minor improvements to user management code (#44)

* some changes to auth

* Implemented a reusable HTTP client API

* Added test cases

* Comment clean up

* Simplified the usage by adding HTTPClient

* Using the old ctx import

* Support for arbitrary entity types in the request

* Renamed fields; Added documentation

* Removing a redundant else case

* initial

* more integration tests

* set custom - still needs guessing the type for unmarshaling.

* tests

* server

* server

* .

* json

* json

* move testdata

* get

* tests

* updated to param struct of pointers to call create and update

* Comments

* cleanup

* cleanup

* cleanup

* cleanup minor test changes

* Changing the iteraator pattern

* last page iterator test fix

* clean up tests next.

* make the fetch tidier

* fetch cleanup

* cc change

* custom claims

* newline

* adding error propagation to makeExportedUser

* remove trivial claims map type

* list users test data

* rename p ptr, and remove the with... options for the iterator

* rename p ptr

* some unit tests

* adding integration tests for custom claims

* NO ERROR

* unit tests

* comments hkj

* addressing comments

* delete unneeded json file

* phone NUMBER

* typo

* remove cc from create

* refactor param structs

* remove package ptr

* test refactor

* cleanup comments

* cleanup debug.test

* Adding back the default http client

* fix httpClient for tests

* creds

* creds

* fix default http client

* cleanupPrintfs

* disable

* Reanme payload vars

* Revert newHTTPKeySource function

* add back defaultClient in newClient

* reenable testNewHTTPClientNoOpts)

* reverting keysource tests)

* Take the httpClient from the keysource

* Removethe +1 second for the token timestamp.

* Adding tests

* White spaces

* Redesign the error validators

* prepare returns an error.

* cleanup

* dissolve

* dissolve

* clean tests

* split integration tests

* addressing comments

* addressing comments opt branch/ BEFORE hc change

* Removing the defaultClient from the NewClient, and extracting the NewClient creation outside of KeySource

* closer from echoServer

* cleanup + 500 error unit test

* unify error messages

* Refactor stop side effect for params preparation

* +1 to timestamp for flakiness

* removing +1

* disallow defaultClient

* whitespaces

* http default

* add TODO

* Code clean up and refactoring

* Refactored integration tests (#46)

* Refactored integration tests

* Minor cleanup

* Auth Unit Test Improvements (#45)

* Cleaning up new auth tests

* More updates to tests; Dissolved commonParams type

* More test updates

* More argument validation for auth

* Fixed a bug in enable/disable user; Added more tests; Cleaned up unit tests

* Removed debug file

* Create the 5th user in the integration tests for user management. (#47)

* Bump version to 2.2.0 (#49)

* Adding version, stat counter header and test (#50)

* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Auth Package Internal Cleanup (#53)

* Release v2.2.1 (#51)

* Adding version, stat counter header and test (#50)
* Adding version to the header for the stat counter + tests
* bump version to 2.2.1
* Adding comment for manual cleanup

* Experimental auth cleanup

* Using a mock token source in tests

* Further cleaning up the test cases

* Implemented IID Delete API (#41)

* Implemented IID Delete API

* Cleaned up code

* Updated test case

* Updating comments

* Improved error handling

* Fixing malformed error messages due to extra format placeholders; Using the recommended Go error message format (no caps or punctuation)

* Bumped version to 2.3.0 (#56)

* Bumped Version 2.4.0 (#66)

* Release Version 2.3.0 (#57) (#68)

* Comment on NewApp describing getting the options from the env var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants