Sha256: 898c47bdcb528ac430ea1c59032020595b42f5845363f1fa787eb5d283cc41fb

Contents?: true

Size: 522 Bytes

Versions: 12

Compression:

Stored size: 522 Bytes

Contents

module Faye
  module Authentication
    class ClientExtension

      def initialize(secret, options = {})
        @secret = secret
        @options = options
      end

      def outgoing(message, callback)
        if Faye::Authentication.authentication_required?(message, @options)
          message['signature'] = Faye::Authentication.sign({channel: message['subscription'] || message['channel'], clientId: message['clientId']}, @secret, @options)
        end
        callback.call(message)
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
faye-authentication-1.13 lib/faye/authentication/client_extension.rb
faye-authentication-1.12 lib/faye/authentication/client_extension.rb
faye-authentication-1.11.0 lib/faye/authentication/client_extension.rb
faye-authentication-1.10.0 lib/faye/authentication/client_extension.rb
faye-authentication-1.9.1 lib/faye/authentication/client_extension.rb
faye-authentication-1.9.0 lib/faye/authentication/client_extension.rb
faye-authentication-1.8.2 lib/faye/authentication/client_extension.rb
faye-authentication-1.8.1 lib/faye/authentication/client_extension.rb
faye-authentication-1.8.0 lib/faye/authentication/client_extension.rb
faye-authentication-1.7.0 lib/faye/authentication/client_extension.rb
faye-authentication-1.6.1 lib/faye/authentication/client_extension.rb
faye-authentication-1.6.0 lib/faye/authentication/client_extension.rb