Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
class CachingConfigurableTokenSource(source: ConfigurableTokenSource, store: TokenStore, validator: TokenValidator) : BaseCachingTokenSource, ConfigurableTokenSource
Link copied to clipboard
class CachingFixedTokenSource(source: FixedTokenSource, store: TokenStore, validator: TokenValidator) : BaseCachingTokenSource, FixedTokenSource
Link copied to clipboard
A configurable token source takes in a TokenRequestOptions when requesting credentials.
Link copied to clipboard
A non-configurable token source that does not take any options.
Link copied to clipboard
@Serializable
Link copied to clipboard
@Serializable
Link copied to clipboard
Link copied to clipboard
Decodes a LiveKit connection token and grabs relevant information from it.
Link copied to clipboard
data class TokenRequestOptions(val roomName: String? = null, val participantName: String? = null, val participantIdentity: String? = null, val participantMetadata: String? = null, val participantAttributes: Map<String, String>? = null, val agentName: String? = null, val agentMetadata: String? = null)
The options for a token request.
Link copied to clipboard
interface TokenSource
Link copied to clipboard
@Serializable
The JSON serializable format of the request sent to standard LiveKit token servers.
Link copied to clipboard
@Serializable
Link copied to clipboard
interface TokenStore
Link copied to clipboard
typealias TokenValidator = (options: TokenRequestOptions?, response: TokenSourceResponse) -> Boolean
Link copied to clipboard
Functions
Link copied to clipboard
fun ConfigurableTokenSource.cached(store: TokenStore = InMemoryTokenStore(), validator: TokenValidator = defaultValidator): CachingConfigurableTokenSource
fun FixedTokenSource.cached(store: TokenStore = InMemoryTokenStore(), validator: TokenValidator = defaultValidator): CachingFixedTokenSource
Wraps the token store with a cache so that it reuses the token as long as it is valid.
Link copied to clipboard
fun TokenSourceResponse.hasValidToken(tolerance: Duration = 60.seconds, date: Date = Date()): Boolean
Validates whether the JWT token is still valid.
Link copied to clipboard
Converts a TokenRequestOptions to TokenSourceRequest, a JSON serializable request body.