Sha256: d98c911ad977e8796c7f52da9c1d0ac6fd3f6c4d8171907ed78c2e7ba515bfb4

Contents?: true

Size: 420 Bytes

Versions: 2

Compression:

Stored size: 420 Bytes

Contents

# frozen_string_literal: true

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["User-Agent"] = "LiveKit Ruby SDK"
      headers
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
livekit-server-sdk-0.7.0 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.6.5 lib/livekit/auth_mixin.rb