Class: Wampproto::Auth::Ticket

Inherits:
Base
  • Object
show all
Defined in:
lib/wampproto/auth/ticket.rb

Overview

generates ticket authentication signature

Constant Summary collapse

AUTH_METHOD =
"ticket"

Instance Attribute Summary collapse

Attributes inherited from Base

#authextra, #authid, #authmethod

Instance Method Summary collapse

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

#secretObject (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