Sha256: 47f0626020e670db25889e7629f3fee861e62ded8c189e194f7ef8ade76a15fb

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 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)
          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

1 entries across 1 versions & 1 rubygems

Version Path
faye-authentication-0.4.0 lib/faye/authentication/client_extension.rb