Skip to content

Commit

Permalink
feat: Adds option to generate tokens for the moderator.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Dec 9, 2024
1 parent d9964d4 commit d173ebc
Show file tree
Hide file tree
Showing 8 changed files with 298 additions and 14 deletions.
204 changes: 204 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
"@types/dom-screen-wake-lock": "1.0.1",
"@types/jasmine": "5.1.4",
"@types/js-md5": "0.4.3",
"@types/jsonwebtoken": "9.0.7",
"@types/lodash-es": "4.17.12",
"@types/moment-duration-format": "2.2.6",
"@types/offscreencanvas": "2019.7.2",
Expand Down Expand Up @@ -178,6 +179,7 @@
"eslint-plugin-react-native": "4.0.0",
"eslint-plugin-typescript-sort-keys": "2.3.0",
"jetifier": "1.6.4",
"jsonwebtoken": "9.0.2",
"metro-react-native-babel-preset": "0.77.0",
"patch-package": "6.4.7",
"process": "0.11.10",
Expand Down
5 changes: 5 additions & 0 deletions tests/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@

# The grid host url (https://mygrid.com/wd/hub)
#GRID_HOST_URL=

# The path to the private key used for generating JWT token (.pk)
#JWT_PRIVATE_KEY_PATH=
# The kid to use in the token
#JWT_KID=
8 changes: 7 additions & 1 deletion tests/helpers/Participant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class Participant {
*/
private _name: string;
private _endpointId: string;
private _jwt?: string;

/**
* The default config to use when joining.
Expand Down Expand Up @@ -61,9 +62,11 @@ export class Participant {
* Creates a participant with given name.
*
* @param {string} name - The name of the participant.
* @param {string }jwt - The jwt if any.
*/
constructor(name: string) {
constructor(name: string, jwt?: string) {
this._name = name;
this._jwt = jwt;
}

/**
Expand Down Expand Up @@ -141,6 +144,9 @@ export class Participant {
url = `${url}&tenant="${baseUrl.pathname.substring(1)}"`;
}
}
if (this._jwt) {
url = `${url}&jwt="${this._jwt}"`;
}

await this.driver.setTimeout({ 'pageLoad': 30000 });

Expand Down
Loading

0 comments on commit d173ebc

Please sign in to comment.