spid-es 0.0.22 → 0.0.23

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
  SHA256:
3
- metadata.gz: 244667e7dd811bf49843a3db7a7921b9ce0b7353878c5d76927a1ed10bdcb241
4
- data.tar.gz: 72f4366b04da1269c97c38ea0d2926529647b2d4662016bc523cb632369b5f20
3
+ metadata.gz: 94627fabd1026d5ef9e46d3753d3c350fd84dc84d9e976b52582c9188c959580
4
+ data.tar.gz: de6042d8cc7089415ab31f12c6ebe7f4d4e45a509f71c01aeca53cb0df30c889
5
5
  SHA512:
6
- metadata.gz: '0954a0cde4c39b3bba87502731981d075d036344899d2ecc7fd0dfec2588d1839201d46101db098df950cb3fa3729605831e42d28b16233054d1b33784f397cf'
7
- data.tar.gz: 8b56bd6fe0010da58eff3d0094dfe7efdc3b645a14128ba8d9ff67c0246d2fa7e7a9a2b62e492539aa58441f579b6685dfd065945b28a9b9b9d02e3a54709811
6
+ metadata.gz: 22186ddb76b20451e0ac1171fab10ddfba0dfc2c033c42e540876e8a75f0975e109e2d3a894e41ca3353794fecd6714708c825b807c93762659e44914bfedd3a
7
+ data.tar.gz: 7c731740767fb10fd71833522ac9603ea3dbb983a2854c5ea711f80b835328f997ad76fa9771f2b91043db784ce56d375ebb48bb72a17f267fa0c88012b7bb99
@@ -31,10 +31,19 @@ module Spid
31
31
  def generate(settings)
32
32
  #meta_doc = REXML::Document.new
33
33
  meta_doc = Spid::XMLSecurityNew::Document.new
34
- root = meta_doc.add_element "md:EntityDescriptor", {
34
+ if settings.aggregato
35
+ root = meta_doc.add_element "md:EntityDescriptor", {
36
+ "xmlns:md" => "urn:oasis:names:tc:SAML:2.0:metadata",
37
+ "xmlns:xml" => "http://www.w3.org/XML/1998/namespace",
38
+ "xmlns:spid" => "https://spid.gov.it/saml-extensions",
39
+ }
40
+ else
41
+ root = meta_doc.add_element "md:EntityDescriptor", {
35
42
  "xmlns:md" => "urn:oasis:names:tc:SAML:2.0:metadata",
36
43
  "xmlns:xml" => "http://www.w3.org/XML/1998/namespace"
37
- }
44
+ }
45
+ end
46
+
38
47
  if settings.issuer != nil
39
48
  root.attributes["entityID"] = settings.issuer
40
49
  end
@@ -201,39 +210,6 @@ module Spid
201
210
  }
202
211
 
203
212
 
204
-
205
-
206
- #Per EIDAS
207
- # #AttributeConsumingService
208
- # attr_cons_service = sp_sso.add_element "md:AttributeConsumingService", {
209
- # "index" => "99",
210
- # }
211
- # service_name
212
- # = attr_cons_service.add_element "md:ServiceName", {
213
- # "xml:lang" => "it"
214
- # }
215
- # service_name.text = "eIDAS Natural Person Minimum Attribute Set"
216
- # settings.requested_attribute.each_with_index{ |attribute, index|
217
- # attr_cons_service.add_element "md:RequestedAttribute", {
218
- # "Name" => attribute
219
- # }
220
- # }
221
-
222
- # #AttributeConsumingService
223
- # attr_cons_service = sp_sso.add_element "md:AttributeConsumingService", {
224
- # "index" => "100",
225
- # }
226
- # service_name = attr_cons_service.add_element "md:ServiceName", {
227
- # "xml:lang" => "it"
228
- # }
229
- # service_name.text = "eIDAS Natural Person Full Attribute Set"
230
- # settings.requested_attribute.each_with_index{ |attribute, index|
231
- # attr_cons_service.add_element "md:RequestedAttribute", {
232
- # "Name" => attribute
233
- # }
234
- # }
235
-
236
-
237
213
  end
238
214
  #organization
239
215
  organization = root.add_element "md:Organization"
@@ -244,12 +220,54 @@ module Spid
244
220
  org_display_name = organization.add_element "md:OrganizationDisplayName", {
245
221
  "xml:lang" => "it"
246
222
  }
247
- org_display_name.text = settings.organization['org_display_name']
223
+
224
+ org_display_name.text = settings.organization['org_display_name']+(settings.aggregato ? " tramite #{settings.hash_aggregatore['soggetto_aggregatore']}" : '')
248
225
  org_url = organization.add_element "md:OrganizationURL", {
249
226
  "xml:lang" => "it"
250
227
  }
251
228
  org_url.text = settings.organization['org_url']
252
229
 
230
+ #ContactPerson per sp aggregato
231
+ if settings.aggregato
232
+ contact_person_aggregatore = root.add_element "md:ContactPerson", {
233
+ "contactType" => "other",
234
+ "spid:entityType" => "spid:aggregator"
235
+ }
236
+ company = contact_person_aggregatore.add_element "md:Company"
237
+ company.text = settings.hash_aggregatore['soggetto_aggregatore']
238
+
239
+ extensions_aggregatore = contact_person_aggregatore.add_element "md:Extensions"
240
+ vat_number_aggregatore = extensions_aggregatore.add_element "spid:VATNumber"
241
+ vat_number_aggregatore.text = settings.hash_aggregatore['piva_aggregatore']
242
+
243
+ ipa_code_aggregatore = extensions_aggregatore.add_element "spid:IPACode"
244
+ ipa_code_aggregatore.text = settings.hash_aggregatore['cipa_aggregatore']
245
+
246
+ fiscal_code_aggregatore = extensions_aggregatore.add_element "spid:FiscalCode"
247
+ fiscal_code_aggregatore.text = settings.hash_aggregatore['cf_aggregatore']
248
+
249
+ contact_person_aggregato = root.add_element "md:ContactPerson", {
250
+ "contactType" => "other",
251
+ "spid:entityType" => "spid:aggregated"
252
+ }
253
+ company = contact_person_aggregato.add_element "md:Company"
254
+ company.text = settings.organization['org_name']
255
+
256
+ extensions_aggregato = contact_person_aggregato.add_element "md:Extensions"
257
+ unless settings.hash_aggregatore['soggetto_aggregato']['vat_number'].blank?
258
+ vat_number_aggregato = extensions_aggregato.add_element "spid:VATNumber"
259
+ vat_number_aggregato.text = settings.hash_aggregatore['soggetto_aggregato']['vat_number']
260
+ end
261
+ unless settings.hash_aggregatore['soggetto_aggregato']['ipa_code'].blank?
262
+ ipa_code_aggregato = extensions_aggregato.add_element "spid:IPACode"
263
+ ipa_code_aggregato.text = settings.hash_aggregatore['soggetto_aggregato']['ipa_code']
264
+ end
265
+ unless settings.hash_aggregatore['soggetto_aggregato']['fiscal_code'].blank?
266
+ fiscal_code_aggregato = extensions_aggregato.add_element "spid:FiscalCode"
267
+ fiscal_code_aggregato.text = settings.hash_aggregatore['soggetto_aggregato']['fiscal_code']
268
+ end
269
+ end
270
+
253
271
  #meta_doc << REXML::XMLDecl.new(version='1.0', encoding='UTF-8')
254
272
  meta_doc << REXML::XMLDecl.new("1.0", "UTF-8")
255
273
 
@@ -10,7 +10,7 @@ module Spid
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, :aggregato, :hash_aggregatore
14
14
 
15
15
  def initialize(config = {})
16
16
  config.each do |k,v|
data/spid-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 = 'spid-es'
5
- s.version = '0.0.22'
5
+ s.version = '0.0.23'
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"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spid-es
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabiano Pavan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: canonix
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.0.6
143
+ rubygems_version: 3.0.8
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: SAML Ruby Tookit Spid