spid-es 0.0.23 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spid/ruby-saml/metadata.rb +4 -2
- data/lib/spid/ruby-saml/response.rb +23 -16
- 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: cb8b587fc1cfcdcd48c3036862abaeb4ead7a9cdc4dd49e5d8eff6aa3f957b21
|
4
|
+
data.tar.gz: 02c2db9b713ff0660ba9866fe3ad4b85f2ffb7329993df80a41da35f1f94d65a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a505c385493da04481b3ff5846b4f7202485468946d10b6270fa9c5058aed656368784a383b73bfe6f8e046a78b06d4b91240ace162fd26859da25719d9ad44e
|
7
|
+
data.tar.gz: 9b4f324436969186405ff0c76caa5bd9ef8dc00250266924d549c6d7244307635da631002758c0aaf9fb45c2aa0314f7274dd7b54df3dadd2421988fff2be706
|
@@ -5,7 +5,6 @@ require "uri"
|
|
5
5
|
require "digest/md5"
|
6
6
|
require "nokogiri"
|
7
7
|
require_relative "../xml_security_new" #fa il require della nokogiri
|
8
|
-
require "uuid"
|
9
8
|
|
10
9
|
# Class to return SP metadata based on the settings requested.
|
11
10
|
# Return this XML in a controller, then give that URL to the the
|
@@ -47,7 +46,10 @@ module Spid
|
|
47
46
|
if settings.issuer != nil
|
48
47
|
root.attributes["entityID"] = settings.issuer
|
49
48
|
end
|
50
|
-
|
49
|
+
#Tolto per non far cambiare sempre il metadata
|
50
|
+
#uuid = "_" + UUID.new.generate
|
51
|
+
#genero l'id come hash dell'entityID
|
52
|
+
uuid = "_"+Digest::MD5.hexdigest(settings.issuer)
|
51
53
|
self.uuid = uuid
|
52
54
|
root.attributes["ID"] = uuid
|
53
55
|
|
@@ -268,6 +268,8 @@ module Spid
|
|
268
268
|
return false if validate_destination(soft) == false
|
269
269
|
#validazione status
|
270
270
|
return false if validate_status(soft) == false
|
271
|
+
#validazione inresponseto
|
272
|
+
return false if validate_presence_inresponseto(soft) == false
|
271
273
|
#validazione issuer
|
272
274
|
return false if validate_issuer(soft) == false
|
273
275
|
#validazioni varie su asserzioni
|
@@ -312,6 +314,11 @@ module Spid
|
|
312
314
|
end
|
313
315
|
end
|
314
316
|
|
317
|
+
def validate_presence_inresponseto(soft=true)
|
318
|
+
response_to_id_value = response_to_id
|
319
|
+
return (soft ? false : validation_error("InResponseTo non specificato o mancante")) if response_to_id_value.blank?
|
320
|
+
end
|
321
|
+
|
315
322
|
|
316
323
|
|
317
324
|
#validate status e status code
|
@@ -344,16 +351,16 @@ module Spid
|
|
344
351
|
end
|
345
352
|
|
346
353
|
def version_assertion(document)
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
354
|
+
assertion_nodes = xpath_from_signed_assertion()
|
355
|
+
@version_assertion = "2.0"
|
356
|
+
#ciclo sui nodi delle asserzioni, se uno ha una versione diversa da 2.0 ritorno nil
|
357
|
+
unless assertion_nodes.blank?
|
358
|
+
assertion_nodes.each{ |ass_node|
|
359
|
+
return nil if ass_node.attributes['Version'] != "2.0"
|
360
|
+
}
|
361
|
+
end
|
362
|
+
@version_assertion
|
363
|
+
end
|
357
364
|
|
358
365
|
def validate_version(soft = true)
|
359
366
|
unless version(self.document) == "2.0"
|
@@ -364,12 +371,12 @@ module Spid
|
|
364
371
|
end
|
365
372
|
|
366
373
|
def validate_version_assertion(soft = true)
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
374
|
+
unless version_assertion(self.document) == "2.0"
|
375
|
+
#return append_error("Unsupported SAML version")
|
376
|
+
return soft ? false : validation_error("Unsupported SAML Assertion version")
|
377
|
+
end
|
378
|
+
true
|
379
|
+
end
|
373
380
|
|
374
381
|
def validate_signed_elements(soft = true)
|
375
382
|
signature_nodes = REXML::XPath.match(decrypted_document.nil? ? document : decrypted_document,"//ds:Signature",{"ds"=>DSIG})
|
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.28'
|
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.28
|
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-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: canonix
|