cie-es 0.0.5 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +0 -0
- data/Gemfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/cie-es.gemspec +1 -1
- data/lib/cie-es.rb +0 -0
- data/lib/cie/ruby-saml/authrequest.rb +1 -1
- data/lib/cie/ruby-saml/coding.rb +0 -0
- data/lib/cie/ruby-saml/error_handling.rb +0 -0
- data/lib/cie/ruby-saml/logging.rb +0 -0
- data/lib/cie/ruby-saml/logout_request.rb +0 -0
- data/lib/cie/ruby-saml/logout_response.rb +0 -0
- data/lib/cie/ruby-saml/metadata.rb +95 -36
- data/lib/cie/ruby-saml/request.rb +0 -0
- data/lib/cie/ruby-saml/response.rb +8 -8
- data/lib/cie/ruby-saml/settings.rb +1 -1
- data/lib/cie/ruby-saml/utils.rb +0 -0
- data/lib/cie/ruby-saml/validation_error.rb +0 -0
- data/lib/cie/ruby-saml/version.rb +0 -0
- data/lib/cie/xml_security.rb +0 -0
- data/lib/cie/xml_security_new.rb +1 -1
- data/lib/schemas/saml20assertion_schema.xsd +0 -0
- data/lib/schemas/saml20protocol_schema.xsd +0 -0
- data/lib/schemas/xenc_schema.xsd +0 -0
- data/lib/schemas/xmldsig_schema.xsd +0 -0
- data/test/certificates/certificate1 +0 -0
- data/test/logoutrequest_test.rb +0 -0
- data/test/request_test.rb +0 -0
- data/test/response_test.rb +0 -0
- data/test/responses/adfs_response_sha1.xml +0 -0
- data/test/responses/adfs_response_sha256.xml +0 -0
- data/test/responses/adfs_response_sha384.xml +0 -0
- data/test/responses/adfs_response_sha512.xml +0 -0
- data/test/responses/no_signature_ns.xml +0 -0
- data/test/responses/open_saml_response.xml +0 -0
- data/test/responses/response1.xml.base64 +0 -0
- data/test/responses/response2.xml.base64 +0 -0
- data/test/responses/response3.xml.base64 +0 -0
- data/test/responses/response4.xml.base64 +0 -0
- data/test/responses/response5.xml.base64 +0 -0
- data/test/responses/response_with_ampersands.xml +0 -0
- data/test/responses/response_with_ampersands.xml.base64 +0 -0
- data/test/responses/simple_saml_php.xml +0 -0
- data/test/responses/wrapped_response_2.xml.base64 +0 -0
- data/test/settings_test.rb +0 -0
- data/test/test_helper.rb +0 -0
- data/test/xml_security_test.rb +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ed0afe45b80482d7cc8cbf65c97f592c1595b203b41cc2365b905bfaea1470
|
4
|
+
data.tar.gz: beaa7182a70b1495c20f2e55ae7785e96e8cace2bf6eed366c3bf092fd9a48f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c675e3233b3796500ecc65fb155d05cb8dc312379b424e2f9047b5c8434a2ef77422771853a80ff348d8e2575edaf7b53bd898335b8cabbab12ab2f78934e7ef
|
7
|
+
data.tar.gz: a67af70e3e4168dcd3d2b49090d74c13e834eeff7917671ae33b34fda286cafe658f6dc2929049140308e84f571fb4d37f9d7a3e2e8a7a0432557318a478bf7b
|
data/.document
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/cie-es.gemspec
CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'cie-es'
|
5
|
-
s.version = '0.0.
|
5
|
+
s.version = '0.0.10'
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Fabiano Pavan"]
|
data/lib/cie-es.rb
CHANGED
File without changes
|
@@ -35,7 +35,7 @@ module Cie::Saml
|
|
35
35
|
root.attributes['ID'] = uuid
|
36
36
|
root.attributes['IssueInstant'] = time
|
37
37
|
root.attributes['Version'] = "2.0"
|
38
|
-
root.attributes['ProtocolBinding'] =
|
38
|
+
root.attributes['ProtocolBinding'] = HTTP_POST
|
39
39
|
root.attributes['AttributeConsumingServiceIndex'] = @settings.assertion_consumer_service_index
|
40
40
|
root.attributes['ForceAuthn'] = "true"
|
41
41
|
root.attributes["AssertionConsumerServiceURL"] = @settings.assertion_consumer_service_url
|
data/lib/cie/ruby-saml/coding.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -33,7 +33,8 @@ module Cie
|
|
33
33
|
meta_doc = Cie::XMLSecurityNew::Document.new
|
34
34
|
root = meta_doc.add_element "md:EntityDescriptor", {
|
35
35
|
"xmlns:md" => "urn:oasis:names:tc:SAML:2.0:metadata",
|
36
|
-
"xmlns:xml" => "http://www.w3.org/XML/1998/namespace"
|
36
|
+
"xmlns:xml" => "http://www.w3.org/XML/1998/namespace",
|
37
|
+
"xmlns:cie" => "https://www.cartaidentita.interno.gov.it/saml-extensions"
|
37
38
|
}
|
38
39
|
if settings.issuer != nil
|
39
40
|
root.attributes["entityID"] = settings.issuer
|
@@ -150,7 +151,7 @@ module Cie
|
|
150
151
|
|
151
152
|
sp_sso.add_element "md:AssertionConsumerService", {
|
152
153
|
"Binding" => settings.assertion_consumer_service_binding,
|
153
|
-
"Location" =>
|
154
|
+
"Location" => hash_service['url_consumer'],
|
154
155
|
"isDefault" => hash_service['default'],
|
155
156
|
"index" => index
|
156
157
|
}
|
@@ -202,40 +203,6 @@ module Cie
|
|
202
203
|
end
|
203
204
|
}
|
204
205
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
#Per EIDAS
|
209
|
-
# #AttributeConsumingService
|
210
|
-
# attr_cons_service = sp_sso.add_element "md:AttributeConsumingService", {
|
211
|
-
# "index" => "99",
|
212
|
-
# }
|
213
|
-
# service_name
|
214
|
-
# = attr_cons_service.add_element "md:ServiceName", {
|
215
|
-
# "xml:lang" => "it"
|
216
|
-
# }
|
217
|
-
# service_name.text = "eIDAS Natural Person Minimum Attribute Set"
|
218
|
-
# settings.requested_attribute.each_with_index{ |attribute, index|
|
219
|
-
# attr_cons_service.add_element "md:RequestedAttribute", {
|
220
|
-
# "Name" => attribute
|
221
|
-
# }
|
222
|
-
# }
|
223
|
-
|
224
|
-
# #AttributeConsumingService
|
225
|
-
# attr_cons_service = sp_sso.add_element "md:AttributeConsumingService", {
|
226
|
-
# "index" => "100",
|
227
|
-
# }
|
228
|
-
# service_name = attr_cons_service.add_element "md:ServiceName", {
|
229
|
-
# "xml:lang" => "it"
|
230
|
-
# }
|
231
|
-
# service_name.text = "eIDAS Natural Person Full Attribute Set"
|
232
|
-
# settings.requested_attribute.each_with_index{ |attribute, index|
|
233
|
-
# attr_cons_service.add_element "md:RequestedAttribute", {
|
234
|
-
# "Name" => attribute
|
235
|
-
# }
|
236
|
-
# }
|
237
|
-
|
238
|
-
|
239
206
|
end
|
240
207
|
#organization
|
241
208
|
organization = root.add_element "md:Organization"
|
@@ -252,6 +219,98 @@ module Cie
|
|
252
219
|
}
|
253
220
|
org_url.text = settings.organization['org_url']
|
254
221
|
|
222
|
+
#Nuovi tag contactperson
|
223
|
+
|
224
|
+
contact_person_administrative = root.add_element "md:ContactPerson", {
|
225
|
+
"contactType" => "administrative"
|
226
|
+
}
|
227
|
+
|
228
|
+
extensions_administrative = contact_person_administrative.add_element "md:Extensions"
|
229
|
+
|
230
|
+
public_extension = extensions_administrative.add_element "cie:Public"
|
231
|
+
public_extension.text = ""
|
232
|
+
|
233
|
+
unless settings.hash_ente['ipa_code'].blank?
|
234
|
+
ipa_code_ente = extensions_administrative.add_element "cie:IPACode"
|
235
|
+
ipa_code_ente.text = settings.hash_ente['ipa_code']
|
236
|
+
end
|
237
|
+
|
238
|
+
ipa_code_catente = extensions_administrative.add_element "cie:IPACategory"
|
239
|
+
|
240
|
+
unless settings.hash_ente['belfiore'].blank?
|
241
|
+
belfiore_ente = extensions_administrative.add_element "cie:Municipality"
|
242
|
+
belfiore_ente.text = ( settings.hash_ente['belfiore'].blank? ? '' : settings.hash_ente['belfiore'].upcase )
|
243
|
+
end
|
244
|
+
|
245
|
+
unless settings.hash_ente['organization_name'].blank?
|
246
|
+
company_ente = contact_person_administrative.add_element "md:Company"
|
247
|
+
company_ente.text = settings.hash_ente['organization_name']
|
248
|
+
end
|
249
|
+
|
250
|
+
unless settings.hash_ente['organization_email'].blank?
|
251
|
+
email_address_ente = contact_person_administrative.add_element "md:EmailAddress"
|
252
|
+
email_address_ente.text = settings.hash_ente['organization_email']
|
253
|
+
end
|
254
|
+
|
255
|
+
unless settings.hash_ente['organization_tel'].blank?
|
256
|
+
telephone_number_ente = contact_person_administrative.add_element "md:TelephoneNumber"
|
257
|
+
telephone_number_ente.text = settings.hash_ente['organization_tel']
|
258
|
+
end
|
259
|
+
|
260
|
+
|
261
|
+
contact_person_technical = root.add_element "md:ContactPerson", {
|
262
|
+
"contactType" => "technical"
|
263
|
+
}
|
264
|
+
|
265
|
+
extensions_private = contact_person_technical.add_element "md:Extensions"
|
266
|
+
|
267
|
+
private_extension = extensions_private.add_element "cie:Private"
|
268
|
+
private_extension.text = ""
|
269
|
+
|
270
|
+
unless settings.hash_fornitore_servizi['p_iva'].blank?
|
271
|
+
vat_number_fornitore = extensions_private.add_element "cie:VATNumber"
|
272
|
+
vat_number_fornitore.text = settings.hash_fornitore_servizi['p_iva']
|
273
|
+
end
|
274
|
+
|
275
|
+
unless settings.hash_fornitore_servizi['cf'].blank?
|
276
|
+
cf_fornitore = extensions_private.add_element "cie:FiscalCode"
|
277
|
+
cf_fornitore.text = settings.hash_fornitore_servizi['cf']
|
278
|
+
end
|
279
|
+
|
280
|
+
unless settings.hash_fornitore_servizi['cod_ateco'].blank?
|
281
|
+
cod_ateco_fornitore = extensions_private.add_element "cie:NACE2Code"
|
282
|
+
cod_ateco_fornitore.text = settings.hash_fornitore_servizi['cod_ateco']
|
283
|
+
end
|
284
|
+
|
285
|
+
unless settings.hash_fornitore_servizi['cod_istat'].blank?
|
286
|
+
cod_istat_fornitore = extensions_private.add_element "cie:Municipality"
|
287
|
+
cod_istat_fornitore.text = settings.hash_fornitore_servizi['cod_istat']
|
288
|
+
end
|
289
|
+
|
290
|
+
unless settings.hash_fornitore_servizi['prov'].blank?
|
291
|
+
prov_fornitore = extensions_private.add_element "cie:Province"
|
292
|
+
prov_fornitore.text = settings.hash_fornitore_servizi['prov']
|
293
|
+
end
|
294
|
+
|
295
|
+
stato_fornitore = extensions_private.add_element "cie:Country"
|
296
|
+
stato_fornitore.text = 'IT'
|
297
|
+
|
298
|
+
unless settings.hash_fornitore_servizi['nome_fornitore'].blank?
|
299
|
+
company_aggregatore = contact_person_technical.add_element "md:Company"
|
300
|
+
company_aggregatore.text = settings.hash_fornitore_servizi['nome_fornitore']
|
301
|
+
end
|
302
|
+
|
303
|
+
unless settings.hash_fornitore_servizi['email_fornitore'].blank?
|
304
|
+
email_address_aggregatore = contact_person_technical.add_element "md:EmailAddress"
|
305
|
+
email_address_aggregatore.text = settings.hash_fornitore_servizi['email_fornitore']
|
306
|
+
end
|
307
|
+
|
308
|
+
unless settings.hash_fornitore_servizi['tel_fornitore'].blank?
|
309
|
+
telephone_number_aggregatore = contact_person_technical.add_element "md:TelephoneNumber"
|
310
|
+
telephone_number_aggregatore.text = settings.hash_fornitore_servizi['tel_fornitore']
|
311
|
+
end
|
312
|
+
|
313
|
+
|
255
314
|
#meta_doc << REXML::XMLDecl.new(version='1.0', encoding='UTF-8')
|
256
315
|
meta_doc << REXML::XMLDecl.new("1.0", "UTF-8")
|
257
316
|
|
File without changes
|
@@ -160,17 +160,17 @@ module Cie
|
|
160
160
|
return (soft ? false : validation_error("Issuer of the Assertion not found or multiple."))
|
161
161
|
end
|
162
162
|
|
163
|
-
issuer_response_nodes.each{ |iss|
|
164
|
-
|
165
|
-
|
163
|
+
# issuer_response_nodes.each{ |iss|
|
164
|
+
# #controllo: L'attributo Format di Issuer deve essere presente con il valore urn:oasis:names:tc:SAML:2.0:nameid-format:entity
|
165
|
+
# return (soft ? false : validation_error("Elemento Issuer non ha formato corretto ")) if !iss.attributes['Format'].nil? && iss.attributes['Format'] != 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity'
|
166
166
|
|
167
|
-
}
|
167
|
+
# }
|
168
168
|
|
169
|
-
issuer_assertion_nodes.each{ |iss|
|
170
|
-
|
171
|
-
|
169
|
+
# issuer_assertion_nodes.each{ |iss|
|
170
|
+
# #controllo: L'attributo Format di Issuer deve essere presente con il valore urn:oasis:names:tc:SAML:2.0:nameid-format:entity
|
171
|
+
# return (soft ? false : validation_error("Elemento Issuer non ha formato corretto ")) if iss.attributes['Format'] != 'urn:oasis:names:tc:SAML:2.0:nameid-format:entity'
|
172
172
|
|
173
|
-
}
|
173
|
+
# }
|
174
174
|
|
175
175
|
nodes = issuer_response_nodes + issuer_assertion_nodes
|
176
176
|
|
@@ -10,7 +10,7 @@ module Cie
|
|
10
10
|
attr_accessor :name_identifier_value, :name_identifier_format
|
11
11
|
attr_accessor :sessionindex, :issuer, :destination_service_url, :authn_context, :requester_identificator
|
12
12
|
attr_accessor :single_logout_service_url, :single_logout_service_binding, :single_logout_destination
|
13
|
-
attr_accessor :skip_validation
|
13
|
+
attr_accessor :skip_validation, :hash_ente, :hash_fornitore_servizi
|
14
14
|
|
15
15
|
def initialize(config = {})
|
16
16
|
config.each do |k,v|
|
data/lib/cie/ruby-saml/utils.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/cie/xml_security.rb
CHANGED
File without changes
|
data/lib/cie/xml_security_new.rb
CHANGED
@@ -126,7 +126,7 @@ module Cie
|
|
126
126
|
signed_info_element.add_element("ds:SignatureMethod", {"Algorithm"=>signature_method})
|
127
127
|
|
128
128
|
# Add Reference
|
129
|
-
reference_element = signed_info_element.add_element("ds:Reference", {"URI" => "
|
129
|
+
reference_element = signed_info_element.add_element("ds:Reference", {"URI" => ""})
|
130
130
|
|
131
131
|
# Add Transforms
|
132
132
|
transforms_element = reference_element.add_element("ds:Transforms")
|
File without changes
|
File without changes
|
data/lib/schemas/xenc_schema.xsd
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/test/logoutrequest_test.rb
CHANGED
File without changes
|
data/test/request_test.rb
CHANGED
File without changes
|
data/test/response_test.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/settings_test.rb
CHANGED
File without changes
|
data/test/test_helper.rb
CHANGED
File without changes
|
data/test/xml_security_test.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cie-es
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabiano Pavan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: canonix
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
- !ruby/object:Gem::Version
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
|
-
rubygems_version: 3.0.
|
115
|
+
rubygems_version: 3.0.8
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: SAML Ruby Toolkit Cie
|