spid-es 0.0.38 → 0.0.43
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 +4 -4
- data/lib/spid/ruby-saml/authrequest.rb +5 -5
- data/lib/spid/ruby-saml/response.rb +11 -1
- data/spid-es.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eaf5a650af9277b2c8d6e155d7615b0bbf2a68ff496cc847e4994135908f28f0
|
|
4
|
+
data.tar.gz: 4a94569b9af662ed0ef5c741cef6b8da3d9a164105986e6e8dea0411843b319a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37f5919ca120e1ad9ca46b6848aad7e5ee7fd58af5fdf974d28b44972ce267c0a4dd0f43c63ca53c9ba72d8169c12e64c7615d21b53c86bdbeddb9b77cdc53e1
|
|
7
|
+
data.tar.gz: 325d9c5bd0b521921014a1571e40b6ebb6f92b49c5ab528c186d61548eefefab7bbce6972d788844db909475b82a1b5972a344dcf620ae73a98e7529f3accb66
|
|
@@ -30,7 +30,7 @@ module Spid::Saml
|
|
|
30
30
|
request_doc = Spid::XMLSecurityNew::Document.new
|
|
31
31
|
request_doc.context[:attribute_quote] = :quote
|
|
32
32
|
root = request_doc.add_element "saml2p:AuthnRequest", { "xmlns:saml2p" => "urn:oasis:names:tc:SAML:2.0:protocol",
|
|
33
|
-
"xmlns:
|
|
33
|
+
"xmlns:saml2" => "urn:oasis:names:tc:SAML:2.0:assertion"
|
|
34
34
|
}
|
|
35
35
|
root.attributes['ID'] = uuid
|
|
36
36
|
root.attributes['IssueInstant'] = time
|
|
@@ -53,9 +53,9 @@ module Spid::Saml
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
unless @settings.issuer.blank?
|
|
56
|
-
issuer = root.add_element "
|
|
57
|
-
#l'attributo NameQualifier deve essere presente, non rispetta saml...
|
|
58
|
-
issuer.attributes['NameQualifier'] = @settings.issuer
|
|
56
|
+
issuer = root.add_element "saml2:Issuer", { "xmlns:saml2" => "urn:oasis:names:tc:SAML:2.0:assertion" }
|
|
57
|
+
#l'attributo NameQualifier deve essere presente, non rispetta saml...
|
|
58
|
+
issuer.attributes['NameQualifier'] = ( @settings.aggregato ? @settings.sp_name_qualifier : @settings.issuer )
|
|
59
59
|
issuer.attributes['Format'] = "urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
|
|
60
60
|
issuer.text = @settings.issuer #questo valore deve essere uguale al #entityID dei metadata che usa @settings.issuer
|
|
61
61
|
end
|
|
@@ -88,7 +88,7 @@ module Spid::Saml
|
|
|
88
88
|
}
|
|
89
89
|
context_class = []
|
|
90
90
|
@settings.authn_context.each_with_index{ |context, index|
|
|
91
|
-
context_class[index] = requested_context.add_element "
|
|
91
|
+
context_class[index] = requested_context.add_element "saml2:AuthnContextClassRef"
|
|
92
92
|
context_class[index].text = context
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -248,7 +248,9 @@ module Spid
|
|
|
248
248
|
if settings
|
|
249
249
|
idp_metadata = Spid::Saml::Metadata.new(settings).get_idp_metadata
|
|
250
250
|
end
|
|
251
|
-
|
|
251
|
+
#verifico se sono stati scaricati i metadati dell'idp
|
|
252
|
+
return false if validate_metadata_idp(idp_metadata) == false
|
|
253
|
+
|
|
252
254
|
#carico nei setting l'idp_entity_id
|
|
253
255
|
entity_descriptor_element = REXML::XPath.first(idp_metadata,"/EntityDescriptor")
|
|
254
256
|
if !entity_descriptor_element.nil?
|
|
@@ -334,6 +336,14 @@ module Spid
|
|
|
334
336
|
end
|
|
335
337
|
|
|
336
338
|
|
|
339
|
+
#validate presenza dei metadata per idp
|
|
340
|
+
def validate_metadata_idp(metadata_idp)
|
|
341
|
+
if metadata_idp.blank?
|
|
342
|
+
validation_error("Metadata idp non raggiungibile per #{settings.idp_entity_id}")
|
|
343
|
+
else
|
|
344
|
+
return true
|
|
345
|
+
end
|
|
346
|
+
end
|
|
337
347
|
|
|
338
348
|
# Validates the SAML version (2.0)
|
|
339
349
|
# If fails, the error is added to the errors array.
|
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.
|
|
5
|
+
s.version = '0.0.43'
|
|
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.
|
|
4
|
+
version: 0.0.43
|
|
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-
|
|
11
|
+
date: 2020-12-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: canonix
|