spid-es 0.0.54 → 0.0.55
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/logout_request.rb +61 -46
- data/spid-es.gemspec +1 -1
- 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: 7b17fe32559b948252a346fd6bfd106dbe35198bdf300c0802c081f0170ef241
|
|
4
|
+
data.tar.gz: dc1bae993b385975f6d93268bc6a7ecf3b1adebf438972a1283010a15118edb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b7b27b6b710c4141a458cb8c17b707ef6839b7f2a4adce81b79d5bdcea9f5f8faa82e322cdf95246fd1e3e117da41af85a6ff62d46601ce53668af40b1a0d72
|
|
7
|
+
data.tar.gz: c905e74ddda1b01a684c71188e542c5ba2672831f014a224320d0993166d757ff765c5258401773c9ab91aa8daa5467de094e0f1ca81bce31ffe03e79f2791cc
|
|
@@ -9,7 +9,7 @@ module Spid::Saml
|
|
|
9
9
|
include Coding
|
|
10
10
|
include Request
|
|
11
11
|
attr_reader :transaction_id
|
|
12
|
-
attr_accessor :settings
|
|
12
|
+
attr_accessor :settings, :request
|
|
13
13
|
|
|
14
14
|
def initialize( options = {} )
|
|
15
15
|
opt = { :request => nil, :settings => nil }.merge(options)
|
|
@@ -37,11 +37,11 @@ module Spid::Saml
|
|
|
37
37
|
opt = { :name_id => nil, :session_index => nil, :extra_parameters => nil }.merge(options)
|
|
38
38
|
return nil unless opt[:name_id]
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
request_doc = Spid::XMLSecurityNew::Document.new
|
|
41
|
+
request_doc.context[:attribute_quote] = :quote
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
root =
|
|
44
|
+
root = request_doc.add_element "saml2p:LogoutRequest", { "xmlns:saml2p" => PROTOCOL }
|
|
45
45
|
root.attributes['ID'] = @transaction_id
|
|
46
46
|
root.attributes['IssueInstant'] = @issue_instant
|
|
47
47
|
root.attributes['Version'] = "2.0"
|
|
@@ -65,62 +65,77 @@ module Spid::Saml
|
|
|
65
65
|
session_index = root.add_element "saml2p:SessionIndex" #, { "xmlns:samlp" => PROTOCOL }
|
|
66
66
|
session_index.text = opt[:session_index]
|
|
67
67
|
end
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
request_doc << REXML::XMLDecl.new("1.0", "UTF-8")
|
|
71
|
+
@request = request_doc.to_s
|
|
68
72
|
Logging.debug "Created LogoutRequest: #{@request}"
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
|
|
74
|
+
#meta = Metadata.new(@settings)
|
|
75
|
+
#return meta.create_slo_request( to_s, opt[:extra_parameters] )
|
|
76
|
+
|
|
71
77
|
#action, content = binding_select("SingleLogoutService")
|
|
72
78
|
#Logging.debug "action: #{action} content: #{content}"
|
|
73
79
|
#return [action, content]
|
|
74
|
-
|
|
80
|
+
#faccio il return come su authnrequest
|
|
81
|
+
return self
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
|
|
75
85
|
|
|
76
86
|
# function to return the created request as an XML document
|
|
77
87
|
def to_xml
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
text = ""
|
|
89
|
+
@request.write(text, 1)
|
|
80
90
|
return text
|
|
81
91
|
end
|
|
82
|
-
def to_s
|
|
83
|
-
@request.to_s
|
|
84
|
-
end
|
|
85
|
-
# Functions for pulling values out from an IdP initiated LogoutRequest
|
|
86
|
-
def name_id
|
|
87
|
-
element = REXML::XPath.first(@request, "/p:LogoutRequest/a:NameID", {
|
|
88
|
-
"p" => PROTOCOL, "a" => ASSERTION } )
|
|
89
|
-
return nil if element.nil?
|
|
90
|
-
# Can't seem to get this to work right...
|
|
91
|
-
#element.context[:compress_whitespace] = ["NameID"]
|
|
92
|
-
#element.context[:compress_whitespace] = :all
|
|
93
|
-
str = element.text.gsub(/^\s+/, "")
|
|
94
|
-
str.gsub!(/\s+$/, "")
|
|
95
|
-
return str
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def transaction_id
|
|
99
|
-
return @transaction_id if @transaction_id
|
|
100
|
-
element = REXML::XPath.first(@request, "/p:LogoutRequest", {
|
|
101
|
-
"p" => PROTOCOL} )
|
|
102
|
-
return nil if element.nil?
|
|
103
|
-
return element.attributes["ID"]
|
|
104
|
-
end
|
|
105
|
-
def is_valid?
|
|
106
|
-
validate(soft = true)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
def validate!
|
|
110
|
-
validate( soft = false )
|
|
111
|
-
end
|
|
112
|
-
def validate( soft = true )
|
|
113
|
-
return false if @request.nil?
|
|
114
|
-
return false if @request.validate(@settings, soft) == false
|
|
115
92
|
|
|
116
|
-
|
|
93
|
+
def to_s
|
|
94
|
+
@request.to_s
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Functions for pulling values out from an IdP initiated LogoutRequest
|
|
98
|
+
def name_id
|
|
99
|
+
element = REXML::XPath.first(@request, "/p:LogoutRequest/a:NameID", {
|
|
100
|
+
"p" => PROTOCOL, "a" => ASSERTION } )
|
|
101
|
+
return nil if element.nil?
|
|
102
|
+
# Can't seem to get this to work right...
|
|
103
|
+
#element.context[:compress_whitespace] = ["NameID"]
|
|
104
|
+
#element.context[:compress_whitespace] = :all
|
|
105
|
+
str = element.text.gsub(/^\s+/, "")
|
|
106
|
+
str.gsub!(/\s+$/, "")
|
|
107
|
+
return str
|
|
108
|
+
end
|
|
117
109
|
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
def transaction_id
|
|
111
|
+
return @transaction_id if @transaction_id
|
|
112
|
+
element = REXML::XPath.first(@request, "/p:LogoutRequest", {
|
|
113
|
+
"p" => PROTOCOL} )
|
|
114
|
+
return nil if element.nil?
|
|
115
|
+
return element.attributes["ID"]
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def is_valid?
|
|
119
|
+
validate(soft = true)
|
|
120
|
+
end
|
|
120
121
|
|
|
122
|
+
def validate!
|
|
123
|
+
validate( soft = false )
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def validate( soft = true )
|
|
127
|
+
return false if @request.nil?
|
|
128
|
+
return false if @request.validate(@settings, soft) == false
|
|
129
|
+
|
|
130
|
+
return true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
private
|
|
134
|
+
|
|
121
135
|
def self.timestamp
|
|
122
136
|
Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
123
137
|
end
|
|
124
|
-
|
|
138
|
+
|
|
125
139
|
end
|
|
140
|
+
|
|
126
141
|
end
|
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.55'
|
|
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.55
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fabiano Pavan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-26 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.
|
|
143
|
+
rubygems_version: 3.0.9
|
|
144
144
|
signing_key:
|
|
145
145
|
specification_version: 4
|
|
146
146
|
summary: SAML Ruby Tookit Spid
|