Repository navigation
feat(rust/client): add sync client - #125
Merged
Merged
Conversation
Expose the server internals through a library target so the router and CLI can be reached from other crates. Add a `test-support` feature that gates the `testing` module and its optional dependencies. Drop the dead_code expectation on `Claims::auth_time`, which the library's public `AppState` now makes reachable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-api Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace the fail-closed access token arm: a call needs a live token, and a missing or expired one is refreshed under the AuthState mutex, so concurrent callers share one refresh. An invalid_token refreshes only if the generation still matches, then retries once. The rotated refresh token is saved before the access token is kept, a session_revoked or refresh_expired from any call ends the session, and logout always clears local state. Header, HttpRequest and HttpResponse stop printing header values and bodies in their Debug output. Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the logout could not be sent and the store could not be cleared, a refresh token the server still accepts stayed on disk, while logout returned a harmless looking Network error. The next call would load it and silently restore the session. end_session now returns the store's result. logout reports the store failure for that double fault only; after a sent logout the entry is dead on the server, so the send result stands. The session-revoked paths still discard it, since the server has already killed the token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds SyncClient::step_up, stub register/login, and the keygo-e2e crate. AuthState::replace_access keeps generation in step with access. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build the state test's token through serde, enable tokio/rt under test-support, zeroize sha2 in keygo-api itself, move the reset doc onto reset(), add core/sync/consumer-rules.pro, and cover the real client's logout against the real router. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A failed save dropped the new refresh token while the store still held the spent one, so the next refresh tripped reuse detection and signed the user out over a transient disk error. Following section 10 of the auth spec, the rotated session now stays in AuthState and wins over the store until a save succeeds, and each authenticated call writes it again. The call that hit the failure succeeds on the new token. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A review showed the refused-save tests would miss several ways of breaking the logic, two of which bring reuse detection back. Cover failed refreshes, a second rotation, invalid_token, a caller dropped during the write, every sign-out path, and trusting the store again once a retry succeeds. Also tell TokenStore implementers that save runs under the auth lock, and correct three comments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniffi's tokio support runs on async-compat. Its multi-thread feature keeps one slow call from blocking the others. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A macro now generates each endpoint and the route list together, so a fixed endpoint can no longer be left out of all_routes. That makes the source-counting every_endpoint_is_listed test unnecessary. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use Method::as_str and SystemClock instead of local copies, and send every server test request through one helper. Drop every_endpoint_is_routed, which every_endpoint_demands_its_declared_auth already walks the same routes for. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A public key the host cannot read is now reported by the client's own constructor, so the uniffi adapter no longer has to read it up front and cache it. TokenStore::save borrows the session, which saves copying the refresh token on every attempt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Split exchange into send_signed and an explicit single retry, move the nonce copy into exchange_unlocked, and let replace_access build its own AccessState. Stop exporting ForeignSigner. Move the duplicated client test helpers into sync::testing, and shorten the comments. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generate the callback error types with a macro, expose HttpResponse as a remote record, and make detached a method that hands out the client. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stop using OkHttp's internal HttpMethod, since POST is the only method the API sends that requires a body, and resume the continuation from one place. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.