You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add token source API for fetching LiveKit tokens (#177)
* Adds new public API token_source.h, allowing users to now mint tokens using the following paths:
* Literal: user-provided token (basically the legacy livekit-cli minted path)
* Sandbox: enable a sandbox token server via LiveKit cloud, and allow users insecurely mint tokens (development only)
* Endpoint: production-level server support
* Custom: additional user token minting support
|`docker/`| Dockerfile for CI and SDK distribution images |
82
82
|`scripts/`| Developer / CI helper scripts (e.g. `clang-tidy.sh`) |
83
83
|`docs/`| Documentation root. `docs/` holds hand-written long-form Markdown intended to also read well on GitHub. |
@@ -338,6 +338,7 @@ Adhere to clang-tidy checks configured in `.clang-tidy`. After C++ code changes,
338
338
|------------|-------|-------|
339
339
| protobuf | Private (built-in) | Vendored via FetchContent (Unix) or vcpkg (Windows) |
340
340
| spdlog |**Private**| FetchContent or system package; must NOT leak into public API |
341
+
| nlohmann/json |**Private**| Header-only; vendored via FetchContent (Unix) or vcpkg (Windows); must NOT leak into public API |
341
342
| client-sdk-rust | Build-time | Git submodule, built via cargo during CMake build |
342
343
| Google Test | Test only | FetchContent in `src/tests/CMakeLists.txt`|
343
344
@@ -356,7 +357,7 @@ Tests are under `src/tests/` using Google Test:
356
357
cd build-debug && ctest
357
358
```
358
359
359
-
Integration tests (`src/tests/integration/`) cover: room connections, callbacks, data tracks, RPC, logging, audio processing, and the subscription thread dispatcher.
360
+
Integration tests (`src/tests/integration/`) cover: room connections, callbacks, data tracks, RPC, logging, audio processing, and the subscription thread dispatcher. The token source HTTP/JSON wire contract (request serialization, response parsing, header passthrough, GET support, sandbox URL/header resolution) is covered by mocked unit tests in `src/tests/unit/test_token_source.cpp`, which inject a stub HTTP transport so no live server is needed. For a full end-to-end check, `TokenSourceEndpointConnectTest` connects a `Room` with a real JWT minted by the `livekit/token-server-action` token server pointed at the local dev `livekit-server`. The action exposes its `/createToken` endpoint as a `token-url` output; `tests.yml` passes that to the integration test step as `LIVEKIT_CREATE_TOKEN_URL`, which the test reads to locate the endpoint. The server is started in the `e2e-testing` jobs via the token server's reusable GitHub Action, pinned by SHA in `tests.yml`.
360
361
361
362
When adding new client facing functionality, add a new test case to the existing test suite.
362
363
When adding new client facing functionality, add benchmarking to understand the limitations of the new functionality.
@@ -401,6 +402,13 @@ all filtered stages; normal pull requests and pushes use the path filters.
401
402
-`.github/workflows/docker-images.yml` — Reusable Docker image smoke-test and
402
403
publish workflow (optional push via input), called by CI and release workflows.
403
404
405
+
The `tests.yml` e2e jobs consume two external, pinned composite actions:
406
+
`livekit/dev-server-action` (local `livekit-server`) and
407
+
`livekit/token-server-action` (a real `/createToken` endpoint used by
408
+
`TokenSourceEndpointConnectTest`). Both are referenced by commit SHA. The token
409
+
server action lives in its own repo on purpose — it is general-purpose like
410
+
`dev-server-action` and is not bundled here.
411
+
404
412
When adding or renaming files that affect a CI stage, update the matching
405
413
`ci.yml``changes` filter in the same PR. For example, new build scripts,
406
414
CMake files, package manifests, or reusable build workflows should be added to
0 commit comments