Skip to content

Commit

Permalink
feat: Adds jwt param to malleus.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Jan 11, 2024
1 parent 9a671e0 commit 9dba872
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 3 additions & 1 deletion scripts/malleus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ set_defaults() {
MALLEUS_SET_SAVELOGS=false
fi

# Null is a fine default for MALLEUS_EXTRA_SENDER_PARAMS and MALLEUS_EXTRA_RECEIVER_PARAMS
# Null is a fine default for MALLEUS_EXTRA_SENDER_PARAMS, MALLEUS_EXTRA_RECEIVER_PARAMS and MALLEUS_JWT
}

case $1 in
Expand Down Expand Up @@ -144,6 +144,7 @@ case $1 in
--extra-receiver-params) MALLEUS_EXTRA_RECEIVER_PARAMS=$optvalue;;
--max-disrupted-bridges-pct) MALLEUS_MAX_DISRUPTED_BRIDGES_PCT=$optvalue;;
--debug) set -x;;
--jwt) MALLEUS_JWT=$optvalue;;
*)
usage
;;
Expand Down Expand Up @@ -232,6 +233,7 @@ mvn \
-Dremote.address=$MALLEUS_HUB_URL \
-DallowInsecureCerts=$MALLEUS_ALLOW_INSECURE_CERTS \
-Djitsi-meet.tests.toRun=$MALLEUS_TESTS_TO_RUN \
-Dorg.jitsi.token=$MALLEUS_JWT \
-Dwdm.gitHubTokenName=jitsi-jenkins \
-Dremote.resource.path=/usr/share/jitsi-meet-torture \
-Djitsi-meet.instance.url=$MALLEUS_INSTANCE_URL \
Expand Down
16 changes: 3 additions & 13 deletions src/test/java/org/jitsi/meet/test/base/AbstractBaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public abstract class AbstractBaseTest<P extends Participant>
* used in tests
*/
public static final String TOKEN_PNAME = "org.jitsi.token";

/**
* Default.
*/
Expand Down Expand Up @@ -232,23 +232,13 @@ public List<P> getAllParticipants()
}

/**
* Return new {@link JitsiMeetUrl} instance which has only
* {@link JitsiMeetUrl#serverUrl} field initialized with the value from
* {@link ParticipantOptions#JITSI_MEET_URL_PROP} system property.
* Return new {@link JitsiMeetUrl} instance.
*
* @return a new instance of {@link JitsiMeetUrl}.
*/
public JitsiMeetUrl getJitsiMeetUrl()
{
String token = System.getProperty(TOKEN_PNAME);

JitsiMeetUrl u = participants.getJitsiMeetUrl().setRoomName(currentRoomName);
if (StringUtils.isNotBlank(token))
{
u.addRoomParameter("jwt", token);
}

return u;
return participants.getJitsiMeetUrl().setRoomName(currentRoomName);
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/org/jitsi/meet/test/base/ParticipantHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.concurrent.*;

import static org.jitsi.meet.test.base.ParticipantOptions.GLOBAL_PROP_PREFIX;
import static org.jitsi.meet.test.base.AbstractBaseTest.TOKEN_PNAME;

/**
* Helper class for managing {@link Participant}s.
Expand Down Expand Up @@ -263,6 +264,13 @@ public JitsiMeetUrl getJitsiMeetUrl()
}

url.setServerUrl(serverUrl);

String token = System.getProperty(TOKEN_PNAME);
if (StringUtils.isNotBlank(token))
{
url.addRoomParameter("jwt", token);
}

return url;
}

Expand Down

0 comments on commit 9dba872

Please sign in to comment.