Class: RSAML::ProxyRestriction

Inherits:
Object
  • Object
show all
Defined in:
lib/rsaml/proxy_restriction.rb

Overview

Specifies limitations that the asserting party imposes on relying parties that in turn wish to act as asserting parties and issue subsequent assertions of their own on the basis of the information contained in the original assertion. A relying party acting as an asserting party MUST NOT issue an assertion that itself violates the restrictions specified in this condition on the basis of an assertion containing such a condition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Specifies the maximum number of indirections that the asserting party permits to exist between this assertion and an assertion which has ultimately been issued on the basis of it.



9
10
11
# File 'lib/rsaml/proxy_restriction.rb', line 9

def count
  @count
end

Instance Method Details

#audiencesObject



11
12
13
# File 'lib/rsaml/proxy_restriction.rb', line 11

def audiences
  @audiences ||= []
end

#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object

Construct an XML fragment representing the proxy restriction



21
22
23
24
25
26
27
# File 'lib/rsaml/proxy_restriction.rb', line 21

def to_xml(xml=Builder::XmlMarkup.new)
  attributes = {}
  attributes['Count'] = count unless count.nil?
  xml.tag!('saml:ProxyRestriction', attributes) {
    audiences.each { |audience| xml << audience.to_xml }
  }
end

#validateObject

Validate the structure

Raises:



16
17
18
# File 'lib/rsaml/proxy_restriction.rb', line 16

def validate
  raise ValidationError, "Count must be 0 or more if specified" if !count.nil? && count < 0
end