-
Notifications
You must be signed in to change notification settings - Fork 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
[STREAM-350] - Accept a JWT for video conferencing. Fixed changelog and updated docs. #907
base: develop
Are you sure you want to change the base?
Conversation
…sdk into STREAM-350-1
@@ -376,8 +376,8 @@ export class GenesysCloudWebrtcSdk extends (EventEmitter as { new(): StrictEvent | |||
* @returns a promise with an object with the newly created `conversationId` | |||
*/ | |||
async startVideoConference (roomJid: string, inviteeJid?: string): Promise<{ conversationId: string }> { | |||
if (this.isGuest) { | |||
throw createAndEmitSdkError.call(this, SdkErrorTypes.not_supported, 'video conferencing not supported for guests'); | |||
if (!this._config.jwt && !this._config.accessToken) { |
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.
Why the change here? More curious than anything but to me it appears that isGuest
should still suffice here? isGuest
is the result of !this.isJwtAuth && !this._config.accessToken
and isJwtAuth
in turn is !!this._config.jwt
. These look to be the same unless I am misunderstanding or missing something.
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.
Yeah you're right, I didn't bother looking into what this.isGuest
was.
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.
Totally fair! I mean definitely a NIT but I curious more than anything and wanted to make sure I wasn't missing something
@@ -55,7 +55,8 @@ export interface IMediaChangeEventParticipant { | |||
} | |||
|
|||
export class VideoSessionHandler extends BaseSessionHandler { | |||
requestedSessions: { [roomJid: string]: boolean } = {}; | |||
/** Map of requested room IDs, either jid or conferenceId (JWT) */ | |||
requestedSessions: { [roomId: string]: boolean } = {}; |
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.
I don't exactly love roomId
as a name, but it can now either be a roomJid
or a conferenceId
. Thinking about it more, maybe we should have more checks below to see if we are using a JWT.
…ferenceId (JWT)." This reverts commit fb68f54.
@@ -60,7 +61,7 @@ describe('Client', () => { | |||
constructSdk = (config?: ISdkConfig) => { | |||
/* if we have no config, then use some defaults */ | |||
if (config === undefined) { | |||
config = { logger: mockLogger as any, accessToken: 'secure', environment: 'mypurecloud.com', optOutOfTelemetry: true }; | |||
config = { logger: mockLogger as any, accessToken: 'secure', jwt: 'test-jwt', environment: 'mypurecloud.com', optOutOfTelemetry: true }; |
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.
Codacy has a fix for the issue: Unexpected any. Specify a different type.
config = { logger: mockLogger as any, accessToken: 'secure', jwt: 'test-jwt', environment: 'mypurecloud.com', optOutOfTelemetry: true }; | |
config = { logger: mockLogger as unknown, accessToken: 'secure', jwt: 'test-jwt', environment: 'mypurecloud.com', optOutOfTelemetry: true }; |
No description provided.