Class: CAS::Receipt
- Inherits:
-
Object
- Object
- CAS::Receipt
- Defined in:
- lib/cas.rb
Instance Attribute Summary collapse
-
#pgt_iou ⇒ Object
Returns the value of attribute pgt_iou.
-
#primary_authentication ⇒ Object
Returns the value of attribute primary_authentication.
-
#proxy_callback_url ⇒ Object
Returns the value of attribute proxy_callback_url.
-
#proxy_list ⇒ Object
Returns the value of attribute proxy_list.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
-
#validate_url ⇒ Object
Returns the value of attribute validate_url.
Instance Method Summary collapse
-
#initialize(ptv) ⇒ Receipt
constructor
A new instance of Receipt.
- #primary_authentication? ⇒ Boolean
- #proxied? ⇒ Boolean
- #proxying_service ⇒ Object
- #to_s ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize(ptv) ⇒ Receipt
Returns a new instance of Receipt.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cas.rb', line 21 def initialize(ptv) if !ptv.successful_authentication? begin ptv.validate rescue ValidationException=>vald raise AuthenticationException, "Unable to validate ProxyTicketValidator [#{ptv}] [#{vald}]" end raise AuthenticationException, "Unable to validate ProxyTicketValidator because of no success with validation[#{ptv}]" unless ptv.successful_authentication? end self.validate_url = ptv.validate_url self.pgt_iou = ptv.pgt_iou self.user_name = ptv.user self.proxy_callback_url = ptv.proxy_callback_url self.proxy_list = ptv.proxy_list self.primary_authentication = ptv.renewed? raise AuthenticationException, "Validation of [#{ptv}] did not result in an internally consistent Receipt" unless validate end |
Instance Attribute Details
#pgt_iou ⇒ Object
Returns the value of attribute pgt_iou.
15 16 17 |
# File 'lib/cas.rb', line 15 def pgt_iou @pgt_iou end |
#primary_authentication ⇒ Object
Returns the value of attribute primary_authentication.
15 16 17 |
# File 'lib/cas.rb', line 15 def primary_authentication @primary_authentication end |
#proxy_callback_url ⇒ Object
Returns the value of attribute proxy_callback_url.
15 16 17 |
# File 'lib/cas.rb', line 15 def proxy_callback_url @proxy_callback_url end |
#proxy_list ⇒ Object
Returns the value of attribute proxy_list.
15 16 17 |
# File 'lib/cas.rb', line 15 def proxy_list @proxy_list end |
#user_name ⇒ Object
Returns the value of attribute user_name.
15 16 17 |
# File 'lib/cas.rb', line 15 def user_name @user_name end |
#validate_url ⇒ Object
Returns the value of attribute validate_url.
15 16 17 |
# File 'lib/cas.rb', line 15 def validate_url @validate_url end |
Instance Method Details
#primary_authentication? ⇒ Boolean
17 18 19 |
# File 'lib/cas.rb', line 17 def primary_authentication? primary_authentication end |
#proxied? ⇒ Boolean
39 40 41 |
# File 'lib/cas.rb', line 39 def proxied? !proxy_list.empty? end |
#proxying_service ⇒ Object
43 44 45 |
# File 'lib/cas.rb', line 43 def proxy_list.first end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/cas.rb', line 47 def to_s "[#{super} - userName=[#{user_name}] validateUrl=[#{validate_url}] proxyCallbackUrl=[#{proxy_callback_url}] pgtIou=[#{pgt_iou}] proxyList=[#{proxy_list}]" end |
#validate ⇒ Object
51 52 53 54 55 56 |
# File 'lib/cas.rb', line 51 def validate user_name && validate_url && proxy_list && !(primary_authentication? && !proxy_list.empty?) # May not be both primary authenitication and proxied. end |