Class: RSAML::Protocol::Query::AuthzDecisionQuery
- Inherits:
-
SubjectQuery
- Object
- Message
- Request
- SubjectQuery
- RSAML::Protocol::Query::AuthzDecisionQuery
- Defined in:
- lib/rsaml/protocol/query/authz_decision_query.rb
Overview
Used to make the query “Should these actions on this resource be allowed for this subject, given this evidence?” A successful response will be in the form of assertions containing authorization decision statements.
Instance Attribute Summary collapse
-
#evidence ⇒ Object
A set of assertions that the SAML authority MAY rely on in making its authorization decision.
-
#resource ⇒ Object
A URI reference indicating the resource for which authorization is requested.
Attributes inherited from SubjectQuery
Attributes inherited from Message
#consent, #destination, #id, #issue_instant, #issuer, #signature, #version
Instance Method Summary collapse
-
#actions ⇒ Object
The actions for which authorization is requested.
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the authorization decision query.
-
#validate ⇒ Object
Validate the query structure.
Methods inherited from SubjectQuery
Methods inherited from Request
Methods inherited from Message
Constructor Details
This class inherits a constructor from RSAML::Protocol::Query::SubjectQuery
Instance Attribute Details
#evidence ⇒ Object
A set of assertions that the SAML authority MAY rely on in making its authorization decision.
19 20 21 |
# File 'lib/rsaml/protocol/query/authz_decision_query.rb', line 19 def evidence @evidence end |
#resource ⇒ Object
A URI reference indicating the resource for which authorization is requested.
11 12 13 |
# File 'lib/rsaml/protocol/query/authz_decision_query.rb', line 11 def resource @resource end |
Instance Method Details
#actions ⇒ Object
The actions for which authorization is requested.
14 15 16 |
# File 'lib/rsaml/protocol/query/authz_decision_query.rb', line 14 def actions @actions ||= [] end |
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the authorization decision query
29 30 31 32 33 34 35 36 |
# File 'lib/rsaml/protocol/query/authz_decision_query.rb', line 29 def to_xml(xml=Builder::XmlMarkup.new) attributes = {'Resource' => resource} xml.tag!('samlp:AuthzDecisionQuery', attributes) { xml << subject.to_xml unless subject.nil? actions.each { |action| xml << action.to_xml } xml << evidence.to_xml unless evidence.nil? } end |
#validate ⇒ Object
Validate the query structure.
22 23 24 25 26 |
# File 'lib/rsaml/protocol/query/authz_decision_query.rb', line 22 def validate raise ValidationError, "Resource is required" if resource.nil? raise ValidationError, "At least one action is required" if actions.empty? actions.each { |action| action.validate } end |