mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-04 03:19:44 +00:00
feat(jitsi): add Jitsi auth provider and engine
This commit is contained in:
@@ -80,6 +80,11 @@ var (
|
||||
"019e23c2-a580-7550-b08a-7ac5342ca21f",
|
||||
"WB Stream room id for real e2e; autogenerated when empty",
|
||||
)
|
||||
realE2EJitsiRoom = flag.String( //nolint:gochecknoglobals // package-level state intentional
|
||||
"olcrtc.real-jitsi-room",
|
||||
"https://meet.cryptopro.ru/deadbeef",
|
||||
"Jitsi Meet room URL for real e2e (format https://host/room or host/room)",
|
||||
)
|
||||
realE2ETimeout = flag.Duration( //nolint:gochecknoglobals // package-level state intentional
|
||||
"olcrtc.real-timeout",
|
||||
90*time.Second,
|
||||
@@ -337,7 +342,7 @@ func registerMemoryCarrierAs(t *testing.T, name string) {
|
||||
}
|
||||
|
||||
func builtInCarrierNames() []string {
|
||||
return []string{"jazz", "telemost", "wbstream"} //nolint:goconst // test literal, repetition is intentional
|
||||
return []string{"jazz", "telemost", "wbstream", "jitsi"} //nolint:goconst // test literal, repetition is intentional
|
||||
}
|
||||
|
||||
func builtInTransportNames() []string {
|
||||
@@ -365,6 +370,21 @@ func realE2ECaseExpectation(carrierName, transportName string) realE2EExpectatio
|
||||
return realE2EExpectPass
|
||||
}
|
||||
return realE2EExpectFail
|
||||
case "jitsi":
|
||||
// Jitsi colibri-ws bridge channel maps cleanly onto the
|
||||
// datachannel transport (raw bytes broadcast through
|
||||
// EndpointMessage). Video transports go through pion's
|
||||
// PeerConnection negotiated via Jingle session-accept; results
|
||||
// are bridge/instance dependent (some operators throttle or
|
||||
// strip non-camera video), hence best-effort.
|
||||
switch transportName {
|
||||
case transportData:
|
||||
return realE2EExpectPass
|
||||
case transportVP8, transportVideo, transportSEI:
|
||||
return realE2EBestEffort
|
||||
default:
|
||||
return realE2EBestEffort
|
||||
}
|
||||
default:
|
||||
return realE2EExpectPass
|
||||
}
|
||||
@@ -432,6 +452,30 @@ func TestRealE2ECaseExpectation(t *testing.T) {
|
||||
transport: transportData,
|
||||
want: realE2EExpectFail,
|
||||
},
|
||||
{
|
||||
name: "jitsi datachannel is expected to pass",
|
||||
carrier: "jitsi",
|
||||
transport: transportData,
|
||||
want: realE2EExpectPass,
|
||||
},
|
||||
{
|
||||
name: "jitsi vp8channel is best effort",
|
||||
carrier: "jitsi",
|
||||
transport: transportVP8,
|
||||
want: realE2EBestEffort,
|
||||
},
|
||||
{
|
||||
name: "jitsi videochannel is best effort",
|
||||
carrier: "jitsi",
|
||||
transport: transportVideo,
|
||||
want: realE2EBestEffort,
|
||||
},
|
||||
{
|
||||
name: "jitsi seichannel is best effort",
|
||||
carrier: "jitsi",
|
||||
transport: transportSEI,
|
||||
want: realE2EBestEffort,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -484,6 +528,17 @@ func realRoomURL(ctx context.Context, t *testing.T, carrierName string) string {
|
||||
t.Skipf("skip wbstream real e2e: create room failed: %v", err)
|
||||
}
|
||||
return room
|
||||
case "jitsi":
|
||||
// Jitsi has no notion of "creating" a room — names are conjured
|
||||
// on first join. The default flag points at meet.cryptopro.ru
|
||||
// (a CryptoPro-operated public Jitsi instance) with a fixed
|
||||
// room slug so the server and client land in the same MUC.
|
||||
_ = ctx
|
||||
room := *realE2EJitsiRoom
|
||||
if room == "" {
|
||||
t.Skip("skip jitsi real e2e: empty -olcrtc.real-jitsi-room")
|
||||
}
|
||||
return room
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user