Class: Vines::Stream::Server::Outbound::AuthExternal

Inherits:
Vines::Stream::State show all
Defined in:
lib/vines/stream/server/outbound/auth_external.rb

Constant Summary

Constants included from Node

Node::BODY, Node::STREAM

Instance Attribute Summary

Attributes inherited from Vines::Stream::State

#stream

Instance Method Summary collapse

Methods inherited from Vines::Stream::State

#==, #eql?, #hash

Methods included from Node

body?, namespace, stream?, to_stanza

Methods included from Log

#log, set_log_file

Constructor Details

#initialize(stream, success = AuthExternalResult) ⇒ AuthExternal

Returns a new instance of AuthExternal.



8
9
10
# File 'lib/vines/stream/server/outbound/auth_external.rb', line 8

def initialize(stream, success=AuthExternalResult)
  super
end

Instance Method Details

#node(node) ⇒ Object



12
13
14
15
16
17
# File 'lib/vines/stream/server/outbound/auth_external.rb', line 12

def node(node)
  raise StreamErrors::NotAuthorized unless external?(node)
  authzid = Base64.strict_encode64(stream.domain)
  stream.write(%Q{<auth xmlns="#{NAMESPACES[:sasl]}" mechanism="EXTERNAL">#{authzid}</auth>})
  advance
end