Sha256: b7da57e2af24e3ef685928461e96613271b7ba5c1dfb8a482133ba811a1da88f

Contents?: true

Size: 389 Bytes

Versions: 14

Compression:

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
livekit-server-sdk-0.6.4 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.6.3 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.6.2 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.6.1 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.6 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.5 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.4 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.3 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.2 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.1 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.5.0 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.4.0 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.3.1 lib/livekit/auth_mixin.rb
livekit-server-sdk-0.3.0 lib/livekit/auth_mixin.rb