Sha256: 189d7b2bcd000b3f47e06c59ba3cc9e99369004180dedfb6a35ab47d5c70d87e

Contents?: true

Size: 340 Bytes

Versions: 3

Compression:

Stored size: 340 Bytes

Contents

module LiveKit
  # Create authenticated headers when keys are provided
  module AuthMixin
    def auth_header(video_grant)
      headers = {}
      t = ::LiveKit::AccessToken.new(api_key: @api_key, api_secret: @api_secret)
      t.add_grant(video_grant)
      headers["Authorization"] = "Bearer #{t.to_jwt}"
      headers
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
livekit-server-sdk-0.2.2 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.2.1 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.2.0 lib/livekit/auth_mixin.rb