feat(auth): add support for user-based auth, OAPI client codegen#902
Draft
rektdeckard wants to merge 1 commit into
Draft
feat(auth): add support for user-based auth, OAPI client codegen#902rektdeckard wants to merge 1 commit into
rektdeckard wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 listcommand 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 withoapi-codegenbased on the current public OpenAPI spec intopkg/public/oapi. Codegen is gated by theoapigenbuild 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 settingLK_OPENAPI_SPEC_URL:LK_OPENAPI_SPEC_URL=http://localhost:8000/openapi.yaml go generate -tags oapigen ./...Usage
A hidden global
--experimental-authflag gates all experimental API variants of commands. Unimplemented commands return an error. The default API URL can be overridden with the--experimental-api-urlflag when running the API server locally:lk project list --experimental-auth --experimental-api-url "http://localhost:8000/v1"