Class: Wampproto::Auth::Ticket
- Defined in:
- lib/wampproto/auth/ticket.rb
Overview
generates ticket authentication signature
Constant Summary collapse
- AUTH_METHOD =
"ticket"
Instance Attribute Summary collapse
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
Attributes inherited from Base
#authextra, #authid, #authmethod
Instance Method Summary collapse
- #authenticate(challenge) ⇒ Object
-
#initialize(secret, authid, authextra = {}) ⇒ Ticket
constructor
A new instance of Ticket.
Constructor Details
#initialize(secret, authid, authextra = {}) ⇒ Ticket
Returns a new instance of Ticket.
10 11 12 13 |
# File 'lib/wampproto/auth/ticket.rb', line 10 def initialize(secret, authid, authextra = {}) @secret = Validate.string!("Secret", secret) super(AUTH_METHOD, authid, authextra) end |
Instance Attribute Details
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
8 9 10 |
# File 'lib/wampproto/auth/ticket.rb', line 8 def secret @secret end |
Instance Method Details
#authenticate(challenge) ⇒ Object
15 16 17 18 |
# File 'lib/wampproto/auth/ticket.rb', line 15 def authenticate(challenge) signature = create_signature(challenge) Message::Authenticate.new(signature) end |