Skip to content

Filter users #70

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

Merged
merged 146 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
fe9b8b9
An initial and somewhat naive implementation of list users
oguzkocer Apr 3, 2024
98b30bc
Add the remaining fields to UserListParams
oguzkocer Apr 3, 2024
a2c4940
Implements user_retrieve_request
oguzkocer Apr 3, 2024
498fe32
Change UserListParams.slug to be Vec<String>
oguzkocer Apr 4, 2024
8765f53
Merge remote-tracking branch 'origin/trunk' into users_types
oguzkocer Apr 4, 2024
5b73f8e
Add UserCreateParams
oguzkocer Apr 4, 2024
f9bdd0b
Implement create user request
oguzkocer Apr 4, 2024
4c9046c
Implement user_update_request
oguzkocer Apr 4, 2024
884faea
Implement user_delete_request
oguzkocer Apr 4, 2024
61f962c
Add a header_map helper to WPApiHelper
oguzkocer Apr 4, 2024
3e50d00
Implements UsersEndpoint
oguzkocer Apr 4, 2024
f3d2f80
Rename user requests to start with verb
oguzkocer Apr 5, 2024
40559a7
Implements retrieve current user
oguzkocer Apr 5, 2024
8061a5b
Adds UserId new type
oguzkocer Apr 5, 2024
62cf189
Use UserId for retrieve, update & delete user requests
oguzkocer Apr 5, 2024
c604808
Implements update & delete current user
oguzkocer Apr 5, 2024
798770e
Update capabilities & avatar_urls types for SparseUser
oguzkocer Apr 5, 2024
9f6da9c
Move parsing code for users to users module
oguzkocer Apr 5, 2024
f71b212
Extract generic error parsing to a helper
oguzkocer Apr 5, 2024
a8aa1b7
Move WPApiParamOrder to wp_api lib.rs
oguzkocer Apr 5, 2024
d3fbcd1
Replace Display trait with as_str for WPContext
oguzkocer Apr 5, 2024
d9f5535
Rename retrieve_current_user as retrieve_current_user_request
oguzkocer Apr 5, 2024
301014e
Replace Display trait with as_str for WPApiParamOrder
oguzkocer Apr 5, 2024
858e10f
Remove unused list_posts from wp_networking
oguzkocer Apr 5, 2024
151ffec
Add body argument to WPNetworkRequest in WordPressAPI.swift
oguzkocer Apr 5, 2024
ec6f364
Merge remote-tracking branch 'origin/trunk' into users_types
oguzkocer Apr 5, 2024
a5f6a91
Update test_credentials file format to use url, username & token
oguzkocer Apr 8, 2024
49ffd28
Add application/json header to WPNetworkRequest for post requests
oguzkocer Apr 9, 2024
c46d3d8
Prefer from_utf8_lossy over from_utf8
oguzkocer Apr 9, 2024
66508da
Replace Display trait with as_str for WPApiParamUsersOrderBy
oguzkocer Apr 9, 2024
9656d8c
Use references for user request parameters
oguzkocer Apr 10, 2024
6c9fe91
Refactor UserListParams.query_pairs() to be more readable
oguzkocer Apr 11, 2024
24fcd6b
Remove the Option from parse retrieve user results
oguzkocer Apr 11, 2024
618e099
update_current_user_request should use post request header map
oguzkocer Apr 11, 2024
b8f0b8d
Add 'Accept' header to all WPRequests
oguzkocer Apr 11, 2024
2023d8d
Update breaking changes in Swift for headerMap becoming non-optional
oguzkocer Apr 11, 2024
45fbbba
Merge branch 'users_types' into update/test_credentials_format
oguzkocer Apr 11, 2024
c12b4b4
A poor implementation of endpoint types
oguzkocer Apr 11, 2024
67b072d
Use the new users endpoint type
oguzkocer Apr 11, 2024
12c111d
Rename WpOrgApiBaseUrl to ApiEndpoint
oguzkocer Apr 11, 2024
d9c975c
Introduce ApiBaseUrl
oguzkocer Apr 12, 2024
e1d9113
Change users to be a field instead of method in ApiEndpoint
oguzkocer Apr 12, 2024
cc7d9bb
Unit tests for append and extend url
oguzkocer Apr 12, 2024
5782f21
Unit test for ApiBaseUrl
oguzkocer Apr 12, 2024
4ce2043
Create and update_me endpoint unit tests for users
oguzkocer Apr 12, 2024
388508e
Extract users_endpoint into its own module
oguzkocer Apr 12, 2024
80da1f2
Merge remote-tracking branch 'origin/trunk' into endpoint
oguzkocer Apr 12, 2024
3e42bae
Remove unused fixtures in endpoint unit tests
oguzkocer Apr 12, 2024
ce965c9
ApiBaseUrl::new_from_str should call new
oguzkocer Apr 12, 2024
199323e
Use a helper to validate users endpoints
oguzkocer Apr 12, 2024
a5f5f09
Add unit tests for delete & delete_me endpoints of users
oguzkocer Apr 12, 2024
b587de8
Don't include empty roles, slug & capabilities in UserListParams quer…
oguzkocer Apr 12, 2024
9345e01
Add unit tests for list, retrieve, retrieve me and update user endpoints
oguzkocer Apr 12, 2024
13b4cc3
Add unit test for list user endpoint that has params
oguzkocer Apr 12, 2024
7217dcf
Merge branch 'trunk' into endpoint
oguzkocer Apr 12, 2024
9d98d15
Setup Rust integration tests
oguzkocer Apr 8, 2024
24d6038
Use a test network for rust integration test
oguzkocer Apr 8, 2024
80209c8
Create a docker network to run Rust integration tests
oguzkocer Apr 8, 2024
29ba501
Trying a very simple mysql connection with sqlx
oguzkocer Apr 10, 2024
4a9a84f
Try asserting list users by comparing it to DB
oguzkocer Apr 15, 2024
3a2fe90
Add end to end to test for updating a user
oguzkocer Apr 16, 2024
d0aa6c0
End to end test for create user
oguzkocer Apr 16, 2024
b653920
Dump and restore mysql before user tests
oguzkocer Apr 17, 2024
51b5627
Run Rust integration tests sequentially
oguzkocer Apr 18, 2024
8a5d806
Add response string to ServerError
oguzkocer Apr 18, 2024
b7837bc
Implement self-restoring WordPressDb for testing
oguzkocer Apr 18, 2024
9ca8535
Add list user integration tests
oguzkocer Apr 18, 2024
e046139
Use mut_ and immut_ prefixes for integration tests
oguzkocer Apr 18, 2024
379749f
Add retrieve user integration tests
oguzkocer Apr 18, 2024
6ce214b
Unwrap immediately from user integration test helpers
oguzkocer Apr 18, 2024
7f2729b
Backup the DB as part of test-rust-integration make task
oguzkocer Apr 19, 2024
035eee7
Implement delete user integration tests
oguzkocer Apr 19, 2024
ec93870
Remove wp_cli crate
oguzkocer Apr 19, 2024
8b71c0b
Remove WPNetworking implementation in favor of AsyncWPNetworking
oguzkocer Apr 19, 2024
2d507ba
Extract password to variable in user integration tests
oguzkocer Apr 19, 2024
9a77a74
Merge remote-tracking branch 'origin/trunk' into test/users_success
oguzkocer Apr 23, 2024
5f84fb8
Re-enable wp_derive integration tests
oguzkocer Apr 23, 2024
b610bf0
Split mutable and immutable users integration tests
oguzkocer Apr 23, 2024
ac84f81
Introduce test_helpers module for integration tests
oguzkocer Apr 23, 2024
042f0a1
Extract test_credentials helper for integration tests
oguzkocer Apr 23, 2024
1f75c49
Move list & retrieve users to test_helpers
oguzkocer Apr 23, 2024
52b00b4
Don't unwrap the result for test helpers
oguzkocer Apr 23, 2024
940aed6
Disable wp_derive integration tests
oguzkocer Apr 23, 2024
6d57e01
Add a test for unauthorized client error
oguzkocer Apr 23, 2024
c41b110
Implement WPCodedError and test InvalidUserId
oguzkocer Apr 23, 2024
2e87ef5
Implement coded unauthorized error
oguzkocer Apr 23, 2024
5288f17
Implement UserInvalidReassign error type and its integration test
oguzkocer Apr 24, 2024
eb04f29
Implement AssertWpError trait
oguzkocer Apr 24, 2024
f754ba5
Split WPApiHelper from AsyncWPNetworking
oguzkocer Apr 24, 2024
e8f110a
Implement WPNetworkResponseParser
oguzkocer Apr 24, 2024
b8bcb5c
Use the new parser trait in tests and remove unnecessary helpers
oguzkocer Apr 24, 2024
e570b17
Implement Default trait for AsyncWPNetworking
oguzkocer Apr 24, 2024
991cf37
Implement ForbiddenContext error type and its integration test
oguzkocer Apr 24, 2024
c2bfe97
Implement status_code function for WPErrorCode
oguzkocer Apr 24, 2024
9fd869a
Implement UserCannotView error and its integration tests
oguzkocer Apr 24, 2024
5d17be8
Implement ForbiddenOrderBy error, fix orderby param and add tests
oguzkocer Apr 24, 2024
e578b27
Implement ForbiddenWho error and its integration test
oguzkocer Apr 24, 2024
62e04fd
Use assert_wp_error in test_common_err
oguzkocer Apr 24, 2024
f169541
Implement CannotCreateUser error and its integration test
oguzkocer Apr 24, 2024
1407962
Implement UserExists error and its integration test
oguzkocer Apr 24, 2024
e165b9c
Adds rest_user_create error
oguzkocer Apr 25, 2024
cf61dad
Implement CannotEditRoles error and its integration test
oguzkocer Apr 25, 2024
9b47ad3
Implement CannotEdit error and its integration test
oguzkocer Apr 25, 2024
ba017f9
Rename WPCodedError as WPRestError, WPErrorCode as WPRestErrorCode
oguzkocer Apr 25, 2024
7cedbf7
Remove ClientErrorType
oguzkocer Apr 25, 2024
747660d
Add message field to WPRestError
oguzkocer Apr 25, 2024
01dc416
Implement InvalidParam error and its integration test
oguzkocer Apr 25, 2024
e8278dc
Implement UserInvalidEmail error and its integration tests
oguzkocer Apr 25, 2024
a126599
Unify test naming for test_users_err
oguzkocer Apr 25, 2024
b3e8f03
Implement UserInvalidArgument error and its integration test
oguzkocer Apr 25, 2024
4aa3450
Implement UserInvalidSlug and its integration test
oguzkocer Apr 25, 2024
141459f
Implement TrashNotSupported and its integration test
oguzkocer Apr 25, 2024
df06b9b
Remove ClientError and ServerError types in favor of RestError
oguzkocer Apr 25, 2024
4c72d39
Implement UserCannotDelete error and its integration tests
oguzkocer Apr 26, 2024
89f9a55
Implement a fallback for WPRestError
oguzkocer Apr 26, 2024
b8782ee
Implement UserInvalidRole error and its integration test
oguzkocer Apr 26, 2024
ad7be1e
Implement InvalidUsername error and organize error types
oguzkocer Apr 26, 2024
eb392b4
Order users error tests alphabetically
oguzkocer Apr 26, 2024
4c26de6
Implement update user password invalid param error test
oguzkocer Apr 26, 2024
df04412
Implement test_user_list_params and fix include/exclude params
oguzkocer Apr 28, 2024
7fa07cc
Implement orderby tests for users
oguzkocer Apr 28, 2024
ff4f8fe
Implement list user with slug, roles and capabilities tests
oguzkocer Apr 28, 2024
9cb8d5a
Implement who & has_published_posts user tests
oguzkocer Apr 28, 2024
c19ca3e
Implement WPApiParamUsersWho
oguzkocer Apr 28, 2024
e64d9f7
Extract test_update_user helper
oguzkocer Apr 28, 2024
8976155
Remove derive_builder
oguzkocer Apr 28, 2024
28cf81e
Implement update_user_first_name test
oguzkocer Apr 28, 2024
04bbf9f
Implement several update user tests
oguzkocer Apr 28, 2024
8a2c9e4
Implement update user roles & password tests
oguzkocer Apr 28, 2024
91193ef
Fix test_users_err due to the removal of derive_builder
oguzkocer Apr 28, 2024
0d8e088
Prefer fn new() over default() for UserCreateParams
oguzkocer Apr 29, 2024
3eb03bf
Revert integration test in CI related changes
oguzkocer Apr 29, 2024
e9addb2
Re-enable wp_derive tests
oguzkocer Apr 29, 2024
86351b9
Add serde & serde_json to root Cargo.toml
oguzkocer Apr 29, 2024
50a471a
Simplify WordPressDb function names
oguzkocer Apr 29, 2024
71c0d79
Fix users_endpoint unit tests for include & exclude field changes
oguzkocer Apr 29, 2024
60a9a5b
Implement filter_list_users
oguzkocer Apr 30, 2024
297df5d
Implement filter list users integration tests
oguzkocer Apr 30, 2024
c90341a
Prefer slice over Vec for passing user filter fields
oguzkocer Apr 30, 2024
41d53ce
Use fn list in fn filter_list of users_endpoint
oguzkocer Apr 30, 2024
fbd3bba
Implement filter retrieve user and its integration tests
oguzkocer Apr 30, 2024
607fd33
Use rstest to test filter list users & filter retrieve user
oguzkocer Apr 30, 2024
166f785
Use rstest_reuse to use the same test cases for filter list & retriev…
oguzkocer Apr 30, 2024
31068a8
Implement filter_retrieve_current_user_request and its integration tests
oguzkocer Apr 30, 2024
65a3ef2
Merge remote-tracking branch 'origin/trunk' into filter_users
oguzkocer May 1, 2024
819b2e9
Resolve a conflict from the previous merge
oguzkocer May 1, 2024
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
95 changes: 59 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ resolver = "2"
[workspace.dependencies]
base64 = "0.22"
http = "1.1"
rstest = "0.19"
rstest_reuse = "0.6.0"
serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion wp_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uniffi = { workspace = true }
wp_derive = { path = "../wp_derive" }

[dev-dependencies]
rstest = "0.19"
rstest = { workspace = true }

[build-dependencies]
uniffi = { workspace = true , features = [ "build", "cli" ] }
Loading