-
Notifications
You must be signed in to change notification settings - Fork 0
[PB-4258]: feat/jaas webhook #19
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d9ec1e3
feat: integrate Jitsi webhook handling for participant events
jzunigax2 fa63bb2
Merge branch 'master' of https://github.com/internxt/meet-server into…
jzunigax2 191a509
fix: missing config
jzunigax2 7cfcfac
Merge branch 'master' into feat/jaas-webhook
CandelR 8862a4b
Add email support to join call functionality and related tests
CandelR 3f29ea7
Merge pull request #25 from internxt/bugfix/correct-tests-and-types
CandelR 3a3e3a3
fix: webhook signature verification
f9fee2a
Added webhook event types
CandelR 713c2ad
Added correct type to payload of webhook service
CandelR 4915314
Merge pull request #29 from internxt/fix/webhook-signature-verification
CandelR 75415d3
Merge branch 'master' into feat/jaas-webhook
CandelR ccef4a7
Fixed tests
CandelR 664c725
Fixed call and webhook tests
CandelR 0c08bea
Changed user payload in one call service test
CandelR 925d712
Removed duplicated JitsiParticipantLeftData type from webhook
CandelR e30cda6
Close room in webhook event when owner participant left the room
CandelR 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
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 |
|---|---|---|
|
|
@@ -13,6 +13,10 @@ import { | |
| getJitsiJWTPayload, | ||
| getJitsiJWTSecret, | ||
| } from '../../lib/jitsi'; | ||
| import { UserTokenData } from '../auth/dto/user.dto'; | ||
| import { UserDataForToken } from '../user/user.attributes'; | ||
| import { User } from '../user/user.domain'; | ||
|
|
||
| export function SignWithRS256AndHeader( | ||
| payload: object, | ||
| secret: string, | ||
|
|
@@ -51,7 +55,8 @@ export class CallService { | |
| .getUserTier(userUuid) | ||
| .catch((err) => { | ||
| Logger.error( | ||
| `Failed to retrieve user tier from payment service: ${err.message}`, | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
| `Failed to retrieve user tier from payment service: ${err?.message}`, | ||
| ); | ||
| throw err; | ||
| }); | ||
|
|
@@ -61,8 +66,8 @@ export class CallService { | |
| return meetFeature; | ||
| } | ||
|
|
||
| async createCallToken(userUuid: string) { | ||
| const meetFeatures = await this.getMeetFeatureConfigForUser(userUuid); | ||
| async createCallToken(user: User | UserTokenData['payload']) { | ||
| const meetFeatures = await this.getMeetFeatureConfigForUser(user.uuid); | ||
|
|
||
| if (!meetFeatures.enabled) | ||
| throw new UnauthorizedException( | ||
|
|
@@ -72,9 +77,9 @@ export class CallService { | |
| const newRoom = v4(); | ||
| const token = generateJitsiJWT( | ||
| { | ||
| id: userUuid, | ||
| email: '[email protected]', | ||
| name: 'Example', | ||
| id: user.uuid, | ||
| email: user.email, | ||
| name: `${user.name} ${user.lastname}`, | ||
| }, | ||
| newRoom, | ||
| true, | ||
|
|
@@ -93,12 +98,13 @@ export class CallService { | |
| roomId: string, | ||
| isAnonymous: boolean, | ||
| isModerator: boolean, | ||
| user?: UserDataForToken, | ||
| ) { | ||
| const token = generateJitsiJWT( | ||
| { | ||
| id: userId, | ||
| email: isAnonymous ? '[email protected]' : 'user@inxt.com', | ||
| name: isAnonymous ? 'Anonymous' : 'User', | ||
| email: isAnonymous ? '[email protected]' : user.email, | ||
| name: isAnonymous ? 'Anonymous' : `${user.name} ${user?.lastName}`, | ||
| }, | ||
| roomId, | ||
| isModerator, | ||
|
|
||
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.
Just curious, what is the difference between
UserandUserTokenData['payload]? Is it the same? OrUseris for authenticated users andUserTokenData['payload']is for anonymous users?