Class: Vines::Stream::Server::Outbound::Auth
- Inherits:
-
Vines::Stream::State
- Object
- Vines::Stream::State
- Vines::Stream::Server::Outbound::Auth
- Defined in:
- lib/vines/stream/server/outbound/auth.rb
Constant Summary collapse
- NS =
NAMESPACES[:sasl]
Constants inherited from Vines::Stream::State
Vines::Stream::State::BODY, Vines::Stream::State::STREAM
Instance Attribute Summary
Attributes inherited from Vines::Stream::State
Instance Method Summary collapse
-
#initialize(stream, success = AuthResult) ⇒ Auth
constructor
A new instance of Auth.
- #node(node) ⇒ Object
Methods inherited from Vines::Stream::State
Methods included from Log
Constructor Details
#initialize(stream, success = AuthResult) ⇒ Auth
Returns a new instance of Auth.
10 11 12 |
# File 'lib/vines/stream/server/outbound/auth.rb', line 10 def initialize(stream, success=AuthResult) super end |
Instance Method Details
#node(node) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/vines/stream/server/outbound/auth.rb', line 14 def node(node) raise StreamErrors::NotAuthorized unless external?(node) authzid = Base64.strict_encode64(stream.domain) stream.write(%Q{<auth xmlns="#{NS}" mechanism="EXTERNAL">#{authzid}</auth>}) advance end |