-
Notifications
You must be signed in to change notification settings - Fork 144
Adding the ListUsers API #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I believe this API should be based on https://googleapis.github.io/google-cloud-dotnet/docs/guides/page-streaming.html |
I changed the paging-implementation. The drawback is that the previous internal classes used for the JSON-response have to be public. ATM I let them in the internal-folder. If this (internal --> public) is okay ,I would clean this up. |
Thanks @ChristopherLenz. The public API for this functionality should be something like this:
It might also be easier to implement this by extending from the Then there's the question of asynchrony. All public APIs in the SDK are currently asynchronous. Ideally we should keep it that way. In that case it makes more sense to implement the APIs to return |
I added the pageToken, but removed the maxResults and cancellationToken. These parameters are used in subsequent method-calls on the pagedEnumerable itself.
I will do this if you are satisfied with all other tasks.
I did, but I'm not sure if the pageToken-handling is as expected. The requestProvider of RestPagedAsyncEnumerable is called for every request. This means that the pageToken is reset for every subsequent call on ReadPageAsync.
Yes I made everything |
Thanks @ChristopherLenz. At a glance this looks correct. We just need the |
Ok, having taken another look at other gcloud SDKs, I think our public API should be something like this:
For comparison with a similar API, see: https://googleapis.github.io/google-cloud-dotnet/docs/Google.Cloud.Storage.V1/api/Google.Cloud.Storage.V1.StorageClient.html#Google_Cloud_Storage_V1_StorageClient_ListBucketsAsync_System_String_Google_Cloud_Storage_V1_ListBucketsOptions_ |
FirebaseAuth returns now: - DownloadAccountResponse --> ExportedUserRecords - UserRecord --> ExportedUserRecord FirebaseAuth takes now ListUsersOptions
Thanks for the tips @hiranya911. I've added all the requests you made. I don't know if I will find time to add some tests today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. I've left a few comments to work on. Plus we need tests to cover all new code.
extending userrecord added password hash and salt trailing newlines in files class documentation renamed page-manager and service-request to match the API-method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is starting to look good. There are few more changes that I'd like to make based on the API feedback I've received from the team, but I can do those changes myself, once this PR is merged. But we need some tests before we can proceed any further with this.
@hiranya911 is there any work to do for me? |
Hi @ChristopherLenz. This is still lacking tests for some of the functionality. Ideally we need to test that iterating over users via |
Okay I've added a test for that. Please let me know if it is okay now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ChristopherLenz. This looks good. I just had 2 points to make. Also please sync with the latest master branch. There are many changes in UserRecord
and a few other classes that are relevant to this PR.
FirebaseAdmin/FirebaseAdmin.Tests/Auth/FirebaseUserManagerTest.cs
Outdated
Show resolved
Hide resolved
FirebaseAdmin/FirebaseAdmin.Tests/Auth/FirebaseUserManagerTest.cs
Outdated
Show resolved
Hide resolved
@hiranya911 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a bit more clean up. But I can find some time to work on it after we merge this. Thanks,
/// </summary> | ||
public IUserInfo[] ProviderData { get; } | ||
|
||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I wasn't clear in my earlier review. But these properties are not needed. CreatedAt and LastLoginAt are already in UserMetadata and ValidSince is same as TokensValidAfterTimestamp
Added the "ListUsersAsync"-method to "FirebaseAuth"-class (resolves #51 )