-
Notifications
You must be signed in to change notification settings - Fork 13.1k
refactor: improve the way we send DDP connection data to hooks #38294
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
nazabucciarelli
wants to merge
36
commits into
develop
Choose a base branch
from
chore/ddp-headers
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
49051b1
wip: extract required fields from DDP connection in auth hooks
nazabucciarelli 3ca9f16
wip: flag commit
nazabucciarelli 0b0a9a2
run linter and fix DeviceLoginPayload type issue
nazabucciarelli 7bbe051
add LogoutSesionPayload type use
nazabucciarelli d02ff34
add properties funneling on sau events
nazabucciarelli 3d6bfed
move types to sau folder, enhance socket.disconnected parameters
nazabucciarelli 83f3da5
Merge branch 'develop' into chore/ddp-headers
nazabucciarelli 4aea9c5
prettier fix
nazabucciarelli 11eaf8c
edit logger message
nazabucciarelli 668c2a3
remove unreachable code
nazabucciarelli fe4ed1f
Merge branch 'develop' into chore/ddp-headers
nazabucciarelli ba3990c
add forgotten loginToken
nazabucciarelli 3c5c1e0
Merge branch 'chore/ddp-headers' of github.com:RocketChat/Rocket.Chat…
nazabucciarelli ecf59a7
remove use of created types
nazabucciarelli e76d829
add optional operator to loginToken
nazabucciarelli 4ed51c6
add optional to loginToken
nazabucciarelli b94212c
Merge branch 'develop' into chore/ddp-headers
nazabucciarelli 7586e19
modify instanceId param
nazabucciarelli 9c2b6db
Merge branch 'chore/ddp-headers' of github.com:RocketChat/Rocket.Chat…
nazabucciarelli 5cf8c84
Merge branch 'develop' into chore/ddp-headers
nazabucciarelli eac64ef
rollback deno.lock changes by accident
nazabucciarelli b65be50
Merge branch 'chore/ddp-headers' of github.com:RocketChat/Rocket.Chat…
nazabucciarelli 9ce09a4
make code cleaner
nazabucciarelli f86de12
Apply suggestion from @KevLehman
nazabucciarelli 73403e2
enhance getHeader method and add unit tests
nazabucciarelli 2a47751
Merge branch 'chore/ddp-headers' of github.com:RocketChat/Rocket.Chat…
nazabucciarelli 64cf87c
rollback deno.lock (again)
nazabucciarelli 6d3d051
change hashLoginToken method
nazabucciarelli cef0138
improve getHeader tool
nazabucciarelli 2361dad
add loginToken data to device-management hook
nazabucciarelli fa604e3
overload getHeader, update tests
nazabucciarelli 497e50d
remove getClientAddress, make getHeader generic
nazabucciarelli 0700e17
change ?? by ||
nazabucciarelli a9830a4
Merge branch 'develop' into chore/ddp-headers
nazabucciarelli 1616785
move loginToken conditional upstream preventing device-login duplicat…
nazabucciarelli 5b2120c
Merge branch 'develop' into chore/ddp-headers
jessicaschelly 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
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 |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import type { ISocketConnectionLogged } from '@rocket.chat/core-typings'; | ||
| import { Emitter } from '@rocket.chat/emitter'; | ||
|
|
||
| export const deviceManagementEvents = new Emitter<{ | ||
| 'device-login': { userId: string; connection: ISocketConnectionLogged }; | ||
| 'device-login': { userId: string; userAgent: string; clientAddress: string }; | ||
| }>(); |
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 |
|---|---|---|
| @@ -1,9 +1,16 @@ | ||
| import type { ISocketConnection, ISocketConnectionLogged } from '@rocket.chat/core-typings'; | ||
| import { Emitter } from '@rocket.chat/emitter'; | ||
|
|
||
| export const sauEvents = new Emitter<{ | ||
| 'accounts.login': { userId: string; connection: ISocketConnectionLogged }; | ||
| 'accounts.logout': { userId: string; connection: ISocketConnection }; | ||
| 'socket.connected': ISocketConnection; | ||
| 'socket.disconnected': ISocketConnection; | ||
| 'sau.accounts.login': { | ||
| userId: string; | ||
| instanceId: string; | ||
| connectionId: string; | ||
| loginToken?: string; | ||
| clientAddress: string; | ||
| userAgent: string; | ||
| host: string; | ||
| }; | ||
nazabucciarelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'sau.accounts.logout': { userId: string; sessionId: string }; | ||
| 'sau.socket.connected': { instanceId: string; connectionId: string }; | ||
| 'sau.socket.disconnected': { instanceId: string; connectionId: string }; | ||
| }>(); | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.