Sha256: 310213e797f68120ab428c62728cd4784b834a840d8d7f0942d9ff4fda0444e1

Contents?: true

Size: 673 Bytes

Versions: 6

Compression:

Stored size: 673 Bytes

Contents

# encoding: UTF-8

module Vines
  class Stream
    class Server
      class Outbound
        class AuthResult < State
          def initialize(stream, success=FinalRestart)
            super
          end

          def node(node)
            raise StreamErrors::NotAuthorized unless namespace(node) == NAMESPACES[:sasl]
            case node.name
              when 'success'
                stream.start(node)
                stream.reset
                advance
              when 'failure'
                stream.close_connection
              else
                raise StreamErrors::NotAuthorized
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vines-0.4.2 lib/vines/stream/server/outbound/auth_result.rb
vines-0.4.1 lib/vines/stream/server/outbound/auth_result.rb
vines-0.4.0 lib/vines/stream/server/outbound/auth_result.rb
vines-0.3.2 lib/vines/stream/server/outbound/auth_result.rb
vines-0.3.1 lib/vines/stream/server/outbound/auth_result.rb
vines-0.3.0 lib/vines/stream/server/outbound/auth_result.rb