-
Notifications
You must be signed in to change notification settings - Fork 0
feat(llc)!: bound and authenticate a connection attempt #160
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
Open
Open
Changes from all commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
56bf6dc
feat(llc)!: let a TokenManager switch users
xsahil03x 84e948e
docs(llc): drop the AuthInterceptor user_id entry from the changelog
xsahil03x 8e963f4
test(llc): cover the deliberate user_id/token divergence in AuthInter…
xsahil03x ed252e8
fix(llc): discard a token load invalidated while it was in flight
xsahil03x a64dbb0
refactor(llc): make token provider mismatches assertable without thei…
xsahil03x 64a85e0
refactor(llc): drop the redundant prefix from token mismatch messages
xsahil03x 07db567
test(llc): share one JWT builder across the token tests
xsahil03x c91b3af
refactor(llc)!: remove AuthInterceptor.withProvider
xsahil03x 0d88226
style(llc): align with STYLE_GUIDE and TESTING conventions
xsahil03x b9d1928
test(llc): keep the JWT builder local to each test file
xsahil03x 8f834a4
test(llc): share one JWT builder, and document the pattern
xsahil03x 500beee
docs(repo): drop the incident detail from the test-fixture rule
xsahil03x 5215424
refactor(llc): restore the original token mismatch messages
xsahil03x df2d4f9
refactor(llc): drop the ArgumentError name argument
xsahil03x 6c5eeca
docs(llc): drop an inaccurate comment on the token type check
xsahil03x a6bb26c
test(llc): reach the type check now that the user id is validated first
xsahil03x 1d50f2c
feat(llc): let a TokenManager exist before its user does
xsahil03x 1abd7d4
feat(llc)!: bound and authenticate a connection attempt
xsahil03x 06747e0
fix(llc): report a wrong-type token as such, not as a wrong user
xsahil03x 1ed6718
fix(llc): stop serving a token for a user the manager has dropped
xsahil03x 7541144
fix(llc): keep the token-expired error when there is no user to refre…
xsahil03x 49f63f3
docs(llc): record the behaviour changes raised in review
xsahil03x 15e5016
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x 64c7af7
fix(llc)!: return the result's own type from Result's failure-side he…
xsahil03x 705123f
fix(llc): make a connection going down report why, once, and stay down
xsahil03x ba79c6a
docs(llc): document fromUser and record this round of changes
xsahil03x bc46b99
docs(llc): show how to widen a Result now that the helpers do not
xsahil03x 39952e5
docs(llc): note where widening happens for recover
xsahil03x c03f7fd
fix(llc): compare a replacement provider by instance, not by equality
xsahil03x 32c5a40
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x b0f94d1
fix(llc): do not open a socket while the previous one is still closing
xsahil03x 0605c01
feat(llc): bound a token load so one provider cannot block the rest
xsahil03x 47b346d
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x 19a1a91
Revert "feat(llc): bound a token load so one provider cannot block th…
xsahil03x e321b8e
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x e3d700b
fix(llc): allow 30 seconds for a connection to establish, not 15
xsahil03x 7c772d5
test(llc): keep a connection alive the way production does
xsahil03x 68cedda
test(llc): let the connect-timeout tests reach the state they are about
xsahil03x 4253b38
docs(llc): say that a provider's equality is never consulted
xsahil03x d88bb57
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x 7a19674
Revert "fix(llc): compare a replacement provider by instance, not by …
xsahil03x c613345
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x a2e4abe
refactor(llc): name the anonymous token's claim as the user id it is
xsahil03x b3454b7
Merge feat/token-manager-user-switching into feat/ws-connection-lifec…
xsahil03x 300908c
fix(llc): recover connections that existed, not attempts that never l…
xsahil03x 0737726
fix(llc): hand connecting back to the caller after a deliberate disco…
xsahil03x 2ad554c
docs(llc): describe the recovery gate as it ended up
xsahil03x f4a8f73
refactor(llc): make the connection-state switch a dispatch, not a body
xsahil03x 72b1447
feat(llc): reconnect an expired token only when another one exists
xsahil03x 1949cbc
fix(llc): classify token errors the way the iOS SDK does
xsahil03x 0a6d8e6
refactor(llc): keep the reconnection rules in the switch
xsahil03x e4ac1b4
refactor(llc): name the close code with the type that models close codes
xsahil03x dd48bce
fix(llc): reconnect after a rate limit, which clears on its own
xsahil03x 0e4b96a
fix(llc): let the caller replace a refused token, and stop trying to …
xsahil03x 7ef363f
feat(llc): give a token an expiry it can be asked about
xsahil03x 52d8a57
Merge branch 'feat/token-manager-user-switching' into feat/ws-connect…
xsahil03x ae08d2a
refactor(llc): read the token's expiry claim directly
xsahil03x 2e3e2c6
Merge branch 'feat/token-manager-user-switching' into feat/ws-connect…
xsahil03x d568f05
feat(llc)!: keep an authenticated attempt to the attempt it belongs to
xsahil03x b30ab0f
fix(llc): read a Stream error from a body the server sent as text
xsahil03x b33ef0a
docs(llc): tighten the docs the connection work touched
xsahil03x e7bd778
test(llc): drive the websocket client through a fake server
xsahil03x 89db687
test(llc): rebuild the auth interceptor tests around one fake backend
xsahil03x 55c8f6c
test(llc): drop tests that restate the source
xsahil03x 0ad17b3
docs(llc): record the connection work in the changelog
xsahil03x 863c881
fix(llc): replace a cached token the server would refuse for having e…
xsahil03x 086bdc9
Merge branch 'feat/token-manager-user-switching' into feat/ws-connect…
xsahil03x ba53f98
fix(llc): stop an auth retry crossing a user switch
xsahil03x f95b138
fix(llc): record an authentication failure on a connection already down
xsahil03x b5c34ee
refactor(llc): ask a disconnection source whether it is worth reconne…
xsahil03x 9c666e0
test(llc): pin the refusal handed on after a closure not worth retrying
xsahil03x cc4ae54
fix(llc): report why a handshake failed, so a retry does not end the …
xsahil03x a790721
docs(llc): correct the connection docs that describe what the code do…
xsahil03x 03d5648
docs(repo): follow Effective Dart on referring to parameters
xsahil03x ece0b67
docs(llc): document what a Dio error converts into, not how it is read
xsahil03x 0763f3f
docs(llc): name whose response, and say the fallback once
xsahil03x bd9b2dd
refactor(llc): read a Stream error from one place, whichever way it a…
xsahil03x 616fc9c
docs(llc): drop what the field these two methods write already says
xsahil03x d08dfd3
docs(llc): say it plainly
xsahil03x c4c0839
refactor(llc): abandon a failed attempt as a chain, not a branch
xsahil03x 990707a
refactor(llc): report a failed close as a chain too
xsahil03x 049e1a1
fix(llc): do not leave a failed attempt disconnecting when its socket…
xsahil03x 49679be
refactor(llc): abandon a failed attempt through disconnect
xsahil03x 32ff783
refactor(llc): read the error off the result rather than destructurin…
xsahil03x 8421c01
refactor(llc): abandon a failed attempt with getOrElse
xsahil03x 86ab178
refactor(llc): use getOrElse on both failure paths
xsahil03x c8807dc
feat(llc): report an attempt that never opened a socket as its own so…
xsahil03x 927bdee
Revert "feat(llc): report an attempt that never opened a socket as it…
xsahil03x 223d643
docs(llc): drop a changelog entry for a bug that never shipped, and f…
xsahil03x c1f707a
docs(llc): name the right product, and key the reconnection rules to …
xsahil03x d4c9de2
docs(llc): share the reconnection rules through a macro
xsahil03x 33deddb
style(llc): name the engine exception through the dot shorthand
xsahil03x be4bc4a
docs(llc): trim the changelog to what a consumer needs
xsahil03x dd17dae
docs(llc): fold the changelog entries that share a cause
xsahil03x 1b0af24
Merge branch 'main' into feat/ws-connection-lifecycle
xsahil03x 24fd7a9
docs(llc): state the engine contract as obligations, not as observations
xsahil03x d096fe4
docs(llc): describe the engine's behaviour, not the implementer's duty
xsahil03x 885a3fa
fix(llc): keep a stale handshake or closure from reporting on its suc…
xsahil03x c2b7959
fix(llc): ignore a pong that lands before the credentials go out
xsahil03x e7c5236
fix(llc): tell a newer refusal from the one being answered by identity
xsahil03x 8756fa4
docs(changelog): log the Dart SDK bump as a breaking change
xsahil03x 1bb50a4
fix(llc): leave the unset connect details out of the payload
xsahil03x 61a0045
test(llc): cover how a refused request is turned into an exception
xsahil03x a0e5762
docs(llc): say the connection comments in one line where one will do
xsahil03x df49bb8
revert(llc): restore the logger files this PR never meant to remove
xsahil03x File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| tags: | ||
| # Tests that drive a fully wired `StreamWebSocketClient` against a fake server. | ||
| ws-client: |
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
2 changes: 1 addition & 1 deletion
2
packages/stream_core/lib/src/api/interceptors/api_key_interceptor.dart
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
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
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
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
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
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
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
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
10 changes: 5 additions & 5 deletions
10
packages/stream_core/lib/src/user/connect_user_details_request.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Nit: no doc comment on new public API. The class has none either so it's consistent as-is — but the two decisions worth writing down are the ones a caller can't infer:
role/teamsomitted because the server assigns them, andnamecoming fromoriginalNameso a user with no name doesn't get their id sent as one. That last part is a good catch; every product was getting it wrong by hand.