libsaml 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81a13cb314576536016f612b508d878a2a9d88f7
4
- data.tar.gz: 9d0559a6b9c14acbb190c15ef9526ed85d30fa5e
3
+ metadata.gz: 28262d5056cc229c82f14228014ca599f70a8537
4
+ data.tar.gz: f5f806bc93542801609c661a541d74990468c28a
5
5
  SHA512:
6
- metadata.gz: af29451a08f4467d0527adb001ad649c3c137700772c6e714fa99b9a3c6886de524cb21cad909e3cca90a1febafe70aca1d480d822adb679f5ede02d2015b35c
7
- data.tar.gz: 365600e541bdd2dd46a24fba6c6a9d1f121bd25a2054bc3565ce0b49518c5bd43fb63a4b546e1b66e14c1b756dfe02d08bf7302e867b875648564ca00f44cad5
6
+ metadata.gz: ce857803eb0f96f886578fd9cb2c565eecfd0220a898d0b9ae53811c8fe472bdfe5c7ffe8a5800da47b5711539e8b11c0d0394c59dbdda58efc4ab450c1b8fd3
7
+ data.tar.gz: 67a08315d3742cea97a9817679ac6604a231e5e50e30fc1e32986ddf475061042d7a5a5e15a068b8a3a79988b7af85ba03a6e21d19c609a55fd375c59079aa23
data/README.md CHANGED
@@ -188,7 +188,7 @@ class SamlController < ActionController::Base
188
188
  elsif account_signed_in?
189
189
  build_success_response
190
190
  else
191
- build_failure(Saml::TopLevelCodes::RESPONDER, Saml::SubStatusCodes::NO_AUTHN_CONTEXT)
191
+ build_failure(Saml::TopLevelCodes::RESPONDER, Saml::SubStatusCodes::NO_AUTHN_CONTEXT, 'cancelled')
192
192
  end
193
193
 
194
194
  if authn_request.protocol_binding == Saml::ProtocolBinding::HTTP_POST
@@ -201,8 +201,11 @@ class SamlController < ActionController::Base
201
201
 
202
202
  private
203
203
 
204
- def build_failure(status_value, sub_status_value)
205
- Saml::Response.new(in_response_to: session[:saml_request][:request_id], status_value: status_value, sub_status_value: sub_status_value)
204
+ def build_failure(status_value, sub_status_value, status_detail)
205
+ Saml::Response.new(in_response_to: session[:saml_request][:request_id],
206
+ status_value: status_value,
207
+ sub_status_value: sub_status_value,
208
+ status_detail: status_detail)
206
209
  end
207
210
 
208
211
  def build_success_response(authn_request)
@@ -212,8 +215,7 @@ class SamlController < ActionController::Base
212
215
  authn_context_class_ref: Saml::ClassRefs::PASSWORD_PROTECTED,
213
216
  in_response_to: authn_request._id,
214
217
  recipient: authn_request.assertion_url,
215
- audience: authn_request.issuer
216
- }
218
+ audience: authn_request.issuer)
217
219
 
218
220
  # adding custom attributes
219
221
  assertion.add_attribute('name', 'value')
@@ -86,6 +86,7 @@ module Saml
86
86
  end
87
87
 
88
88
  module ComplexTypes
89
+ require 'saml/complex_types/role_descriptor_type'
89
90
  require 'saml/complex_types/request_abstract_type'
90
91
  require 'saml/complex_types/status_response_type'
91
92
  require 'saml/complex_types/endpoint_type'
@@ -104,6 +105,7 @@ module Saml
104
105
  require 'saml/elements/audience_restriction'
105
106
  require 'saml/elements/sub_status_code'
106
107
  require 'saml/elements/status_code'
108
+ require 'saml/elements/status_detail'
107
109
  require 'saml/elements/status'
108
110
  require 'saml/elements/subject_confirmation_data'
109
111
  require 'saml/elements/subject_confirmation'
@@ -120,6 +122,7 @@ module Saml
120
122
  require 'saml/elements/requested_attribute'
121
123
  require 'saml/elements/attribute_consuming_service'
122
124
  require 'saml/elements/name_id'
125
+ require 'saml/elements/name_id_format'
123
126
  require 'saml/elements/subject'
124
127
  require 'saml/elements/conditions'
125
128
  require 'saml/elements/authn_statement'
@@ -132,6 +135,7 @@ module Saml
132
135
  require 'saml/elements/contact_person'
133
136
  require 'saml/elements/idp_sso_descriptor'
134
137
  require 'saml/elements/sp_sso_descriptor'
138
+ require 'saml/elements/attribute_authority_descriptor'
135
139
  require 'saml/elements/entity_descriptor'
136
140
  require 'saml/elements/entities_descriptor'
137
141
  end
@@ -0,0 +1,46 @@
1
+ module Saml
2
+ module ComplexTypes
3
+ module RoleDescriptorType
4
+ extend ActiveSupport::Concern
5
+ include Saml::Base
6
+
7
+ included do
8
+ namespace 'md'
9
+
10
+ PROTOCOL_SUPPORT_ENUMERATION = 'urn:oasis:names:tc:SAML:2.0:protocol' unless defined?(PROTOCOL_SUPPORT_ENUMERATION)
11
+
12
+ attribute :_id, String, :tag => 'ID'
13
+ attribute :valid_until, Time, :tag => 'validUntil'
14
+ attribute :cache_duration, String, :tag => 'cacheDuration'
15
+ attribute :protocol_support_enumeration, String, :tag => 'protocolSupportEnumeration'
16
+ attribute :error_url, String, :tag => 'errorURL'
17
+
18
+ has_many :key_descriptors, Saml::Elements::KeyDescriptor
19
+
20
+ validates :protocol_support_enumeration, :presence => true, :inclusion => [PROTOCOL_SUPPORT_ENUMERATION]
21
+ end
22
+
23
+ def initialize(*args)
24
+ super(*args)
25
+ @key_descriptors ||= []
26
+ @protocol_support_enumeration ||= PROTOCOL_SUPPORT_ENUMERATION
27
+ end
28
+
29
+ def find_key_descriptor(key_name, use)
30
+ key_descriptors_by_use = find_key_descriptors_by_use(use)
31
+
32
+ if key_name.present?
33
+ key_descriptors_by_use.find { |key| key.key_info.key_name == key_name }
34
+ else
35
+ key_descriptors_by_use.first
36
+ end
37
+ end
38
+
39
+ private
40
+
41
+ def find_key_descriptors_by_use(use)
42
+ key_descriptors.select { |key| key.use == use || key.use.blank? }
43
+ end
44
+ end
45
+ end
46
+ end
@@ -4,6 +4,8 @@ module Saml
4
4
  extend ActiveSupport::Concern
5
5
  include Saml::Base
6
6
 
7
+ include RoleDescriptorType
8
+
7
9
  class ArtifactResolutionService
8
10
  include Saml::ComplexTypes::IndexedEndpointType
9
11
 
@@ -21,43 +23,14 @@ module Saml
21
23
  included do
22
24
  namespace 'md'
23
25
 
24
- PROTOCOL_SUPPORT_ENUMERATION = "urn:oasis:names:tc:SAML:2.0:protocol" unless defined?(PROTOCOL_SUPPORT_ENUMERATION)
25
-
26
- attribute :protocol_support_enumeration, String, :tag => "protocolSupportEnumeration"
27
- attribute :valid_until, Time, :tag => "validUntil"
28
- attribute :cache_duration, String, :tag => "cacheDuration"
29
- attribute :error_url, String, :tag => "errorURL"
30
-
31
- has_many :key_descriptors, Saml::Elements::KeyDescriptor
32
-
33
26
  has_many :artifact_resolution_services, ArtifactResolutionService
34
27
  has_many :single_logout_services, SingleLogoutService
35
-
36
- validates :protocol_support_enumeration, :presence => true, :inclusion => [PROTOCOL_SUPPORT_ENUMERATION]
37
28
  end
38
29
 
39
30
  def initialize(*args)
40
31
  super(*args)
41
32
  @single_logout_services ||= []
42
- @key_descriptors ||= []
43
33
  @artifact_resolution_services ||= []
44
- @protocol_support_enumeration ||= PROTOCOL_SUPPORT_ENUMERATION
45
- end
46
-
47
- def find_key_descriptor(key_name, use)
48
- key_descriptors_by_use = find_key_descriptors_by_use(use)
49
-
50
- if key_name.present?
51
- key_descriptors_by_use.find { |key| key.key_info.key_name == key_name }
52
- else
53
- key_descriptors_by_use.first
54
- end
55
- end
56
-
57
- private
58
-
59
- def find_key_descriptors_by_use(use)
60
- key_descriptors.select { |key| key.use == use || key.use.blank? }
61
34
  end
62
35
  end
63
36
  end
@@ -16,8 +16,9 @@ module Saml
16
16
 
17
17
  def initialize(*args)
18
18
  options = args.extract_options!
19
- @status = Saml::Elements::Status.new(:status_code => Saml::Elements::StatusCode.new(:value => options.delete(:status_value),
20
- :sub_status_value => options.delete(:sub_status_value)))
19
+ @status = Saml::Elements::Status.new(:status_code => Saml::Elements::StatusCode.new(:value => options.delete(:status_value),
20
+ :sub_status_value => options.delete(:sub_status_value)),
21
+ :status_detail => Saml::Elements::StatusDetail.new(:status_value => options.delete(:status_detail)))
21
22
  super(*(args << options))
22
23
  end
23
24
 
@@ -0,0 +1,20 @@
1
+ module Saml
2
+ module Elements
3
+ class AttributeAuthorityDescriptor
4
+ include Saml::ComplexTypes::RoleDescriptorType
5
+
6
+ class AttributeService
7
+ include Saml::ComplexTypes::EndpointType
8
+ tag 'AttributeService'
9
+ end
10
+
11
+ tag 'AttributeAuthorityDescriptor'
12
+
13
+ has_many :attribute_service, AttributeService
14
+ has_many :name_id_format, Saml::Elements::NameIdFormat
15
+
16
+ validates :attribute_service, :presence => true
17
+
18
+ end
19
+ end
20
+ end
@@ -21,6 +21,7 @@ module Saml
21
21
 
22
22
  has_one :idp_sso_descriptor, Saml::Elements::IDPSSODescriptor
23
23
  has_one :sp_sso_descriptor, Saml::Elements::SPSSODescriptor
24
+ has_one :attribute_authority_descriptor, Saml::Elements::AttributeAuthorityDescriptor
24
25
 
25
26
  has_one :organization, Saml::Elements::Organization
26
27
  has_many :contact_persons, Saml::Elements::ContactPerson
@@ -0,0 +1,14 @@
1
+ module Saml
2
+ module Elements
3
+ class NameIdFormat
4
+ include Saml::Base
5
+
6
+ tag 'NameIDFormat'
7
+ register_namespace 'md', Saml::MD_NAMESPACE
8
+ namespace 'md'
9
+
10
+ content :value, String
11
+ end
12
+ end
13
+ end
14
+
@@ -7,6 +7,7 @@ module Saml
7
7
  namespace 'samlp'
8
8
 
9
9
  has_one :status_code, Saml::Elements::StatusCode
10
+ has_one :status_detail, Saml::Elements::StatusDetail
10
11
 
11
12
  validates :status_code, :presence => true
12
13
 
@@ -0,0 +1,18 @@
1
+ module Saml
2
+ module Elements
3
+ class StatusDetail
4
+ include Saml::Base
5
+
6
+ tag "StatusDetail"
7
+ namespace 'samlp'
8
+
9
+ element :status_value, String, :tag => 'StatusValue'
10
+
11
+ def initialize(*args)
12
+ options = args.extract_options!
13
+ @status_value = options.delete(:status_value) if options[:status_value]
14
+ super(*(args << options))
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = "2.6.2"
2
+ VERSION = "2.6.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libsaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-03 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -138,11 +138,13 @@ files:
138
138
  - lib/saml/complex_types/indexed_endpoint_type.rb
139
139
  - lib/saml/complex_types/localized_name_type.rb
140
140
  - lib/saml/complex_types/request_abstract_type.rb
141
+ - lib/saml/complex_types/role_descriptor_type.rb
141
142
  - lib/saml/complex_types/sso_descriptor_type.rb
142
143
  - lib/saml/complex_types/statement_abstract_type.rb
143
144
  - lib/saml/complex_types/status_response_type.rb
144
145
  - lib/saml/config.rb
145
146
  - lib/saml/elements/attribute.rb
147
+ - lib/saml/elements/attribute_authority_descriptor.rb
146
148
  - lib/saml/elements/attribute_consuming_service.rb
147
149
  - lib/saml/elements/attribute_statement.rb
148
150
  - lib/saml/elements/audience_restriction.rb
@@ -162,6 +164,7 @@ files:
162
164
  - lib/saml/elements/key_info/x509_data.rb
163
165
  - lib/saml/elements/md_extensions.rb
164
166
  - lib/saml/elements/name_id.rb
167
+ - lib/saml/elements/name_id_format.rb
165
168
  - lib/saml/elements/organization.rb
166
169
  - lib/saml/elements/organization_display_name.rb
167
170
  - lib/saml/elements/organization_name.rb
@@ -184,6 +187,7 @@ files:
184
187
  - lib/saml/elements/sp_sso_descriptor.rb
185
188
  - lib/saml/elements/status.rb
186
189
  - lib/saml/elements/status_code.rb
190
+ - lib/saml/elements/status_detail.rb
187
191
  - lib/saml/elements/sub_status_code.rb
188
192
  - lib/saml/elements/subject.rb
189
193
  - lib/saml/elements/subject_confirmation.rb