Skip to content

feat(auth): add support for user-based auth, OAPI client codegen#902

Draft
rektdeckard wants to merge 1 commit into
mainfrom
tobiasfried/devx-577-implement-dual-mode-auth-routing-in-the-cli
Draft

feat(auth): add support for user-based auth, OAPI client codegen#902
rektdeckard wants to merge 1 commit into
mainfrom
tobiasfried/devx-577-implement-dual-mode-auth-routing-in-the-cli

Conversation

@rektdeckard

@rektdeckard rektdeckard commented Jul 10, 2026

Copy link
Copy Markdown
Member

https://linear.app/livekit/issue/DEVX-575/build-cli-poc-for-user-auth-and-list-projects
https://linear.app/livekit/issue/DEVX-577/implement-dual-mode-auth-routing-in-the-cli

Adds experimental user-based authentication to begin implementing the new Public API service. Adds client codegen for the OpenAPI spec. Implements lk project list command using it.

Architecture

The CLI config file now stores a list of authenticated User credentials, including name, session token, and other metadata. This lives alongside the existing Project credentials, and either can be used interchangeably for supported commands. Once the Public API is complete, this will be the default authentication mode for all commands.

Commands that support user-based authentication are routed through the API client in pkg/public. Client code is automatically generated with oapi-codegen based on the current public OpenAPI spec into pkg/public/oapi. Codegen is gated by the oapigen build tag. In order to run all codegen, including the client code:

go generate -tags oapigen ./...

This process assumes the public spec to be available at https://api.livekit.io/openapi.yaml, but this can be overridden, for example when running the public API server locally, by setting LK_OPENAPI_SPEC_URL:

LK_OPENAPI_SPEC_URL=http://localhost:8000/openapi.yaml go generate -tags oapigen ./...

Usage

A hidden global --experimental-auth flag gates all experimental API variants of commands. Unimplemented commands return an error. The default API URL can be overridden with the --experimental-api-url flag when running the API server locally:

lk project list --experimental-auth --experimental-api-url "http://localhost:8000/v1"

@rektdeckard rektdeckard changed the title feat(auth): add support for user-based auth, OpenAPI spec client codegen feat(auth): add support for user-based auth, OAPI client codegen Jul 10, 2026
@rektdeckard rektdeckard requested review from a team, cacheonly, kuba-- and shishirng July 10, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant