Skip to content

Commit d7ac776

Browse files
committed
refactor: take access tokens from livekit-token, not livekit-api
The test suites in livekit and livekit-ffi were the last places reaching access tokens through livekit-api. Both now use livekit-token directly. livekit takes livekit-token as a dev-dependency rather than livekit-api: a member-level default-features override is ignored for an inherited workspace dep, so a livekit-api dev-dep would pull reqwest and the whole Twirp stack into test builds. No functional change; livekit_api::access_token is a re-export of these same types.
1 parent b019192 commit d7ac776

9 files changed

Lines changed: 11 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ prost-build = { workspace = true }
4949
webrtc-sys-build = { workspace = true }
5050

5151
[dev-dependencies]
52-
livekit-api = { workspace = true }
52+
livekit-token = { workspace = true }
5353

5454
[lib]
5555
crate-type = ["lib", "staticlib", "cdylib"]

livekit-ffi/src/server/audio_filter_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::{
3434
};
3535

3636
use livekit::prelude::DisconnectReason;
37-
use livekit_api::access_token::{AccessToken, VideoGrants};
37+
use livekit_token::{AccessToken, VideoGrants};
3838

3939
use crate::{
4040
proto,

livekit-ffi/src/server/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
/*
1616
use std::time::Duration;
17-
use livekit_api::access_token::{AccessToken, VideoGrants};
17+
use livekit_token::{AccessToken, VideoGrants};
1818
use crate::FfiHandleId;
1919
use crate::{proto, server};
20-
//use livekit_api::access_token::{AccessToken, VideoGrants};
20+
//use livekit_token::{AccessToken, VideoGrants};
2121
2222
// Small FfiClient implementation used for testing
2323
// This can be used as an example for a real implementation

livekit/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ flate2 = "1"
5858
base64 = "0.22"
5959

6060
[dev-dependencies]
61+
livekit-token = { workspace = true }
6162
# Enable data-stream test constructors (e.g. TextStreamReader::new_for_test) for our test suites.
6263
livekit-data-stream = { workspace = true, features = ["test-utils"] }
6364
# Async test runtime + timers, needed by the peer_transport deadlock reproducer.

livekit/tests/common/e2e/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use chrono::Utc;
1717
use futures_util::future::try_join_all;
1818
use libwebrtc::native::create_random_uuid;
1919
use livekit::{Room, RoomEvent, RoomOptions};
20-
use livekit_api::access_token::{AccessToken, VideoGrants};
20+
use livekit_token::{AccessToken, VideoGrants};
2121
use std::{env, time::Duration};
2222
use tokio::{
2323
sync::mpsc::UnboundedReceiver,

livekit/tests/data_track_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use {
2222
prelude::*,
2323
SimulateScenario,
2424
},
25-
livekit_api::access_token::VideoGrants,
25+
livekit_token::VideoGrants,
2626
std::time::{Duration, Instant},
2727
test_case::test_case,
2828
tokio::{

livekit/tests/peer_connection_signaling_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ use libwebrtc::video_source::native::NativeVideoSource;
5353
use livekit::options::TrackPublishOptions;
5454
use livekit::prelude::*;
5555
use livekit::{Room, RoomEvent, RoomOptions, SimulateScenario};
56-
use livekit_api::access_token::{AccessToken, VideoGrants};
56+
use livekit_token::{AccessToken, VideoGrants};
5757
use std::collections::HashSet;
5858
use std::env;
5959
use std::sync::Arc;

livekit/tests/reconnection_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use {
4141
common::test_rooms,
4242
libwebrtc::native::create_random_uuid,
4343
livekit::{ConnectionState, Room, RoomEvent, RoomOptions, SimulateScenario},
44-
livekit_api::access_token::{AccessToken, VideoGrants},
44+
livekit_token::{AccessToken, VideoGrants},
4545
std::{env, net::SocketAddr, time::Duration},
4646
tokio::{
4747
net::{TcpListener, TcpStream},

0 commit comments

Comments
 (0)