ruby-saml 0.8.9 → 0.8.10
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.
Potentially problematic release.
This version of ruby-saml might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/Gemfile +9 -1
- data/lib/onelogin/ruby-saml/authrequest.rb +82 -17
- data/lib/onelogin/ruby-saml/logoutrequest.rb +90 -18
- data/lib/onelogin/ruby-saml/settings.rb +73 -12
- data/lib/onelogin/ruby-saml/slo_logoutresponse.rb +157 -0
- data/lib/onelogin/ruby-saml/utils.rb +79 -0
- data/lib/onelogin/ruby-saml/version.rb +1 -1
- data/lib/ruby-saml.rb +2 -1
- data/lib/xml_security.rb +151 -28
- data/test/certificates/ruby-saml.crt +14 -0
- data/test/certificates/ruby-saml.key +15 -0
- data/test/logoutrequest_test.rb +176 -41
- data/test/logoutresponse_test.rb +2 -1
- data/test/request_test.rb +100 -37
- data/test/response_test.rb +1 -1
- data/test/slo_logoutresponse_test.rb +226 -0
- data/test/test_helper.rb +37 -1
- metadata +10 -4
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'test/unit'
|
3
|
+
require 'minitest/autorun'
|
3
4
|
require 'shoulda'
|
4
5
|
require 'mocha/setup'
|
5
6
|
require 'timecop'
|
@@ -76,7 +77,42 @@ class Test::Unit::TestCase
|
|
76
77
|
end
|
77
78
|
|
78
79
|
def response_multiple_attr_values
|
79
|
-
@response_multiple_attr_values = OneLogin::RubySaml::Response.new(fixture(:response_with_multiple_attribute_values))
|
80
|
+
@response_multiple_attr_values = OneLogin::RubySaml::Response.new(fixture(:response_with_multiple_attribute_values))
|
80
81
|
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def ruby_saml_cert_text
|
85
|
+
read_certificate("ruby-saml.crt")
|
86
|
+
end
|
87
|
+
|
88
|
+
def ruby_saml_key_text
|
89
|
+
read_certificate("ruby-saml.key")
|
90
|
+
end
|
91
|
+
|
92
|
+
def read_certificate(certificate)
|
93
|
+
File.read(File.join(File.dirname(__FILE__), "certificates", certificate))
|
94
|
+
end
|
95
|
+
|
96
|
+
def decode_saml_request_payload(unauth_url)
|
97
|
+
payload = CGI.unescape(unauth_url.split("SAMLRequest=").last)
|
98
|
+
decoded = Base64.decode64(payload)
|
99
|
+
|
100
|
+
zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
101
|
+
inflated = zstream.inflate(decoded)
|
102
|
+
zstream.finish
|
103
|
+
zstream.close
|
104
|
+
inflated
|
105
|
+
end
|
81
106
|
|
107
|
+
# decodes a base64 encoded SAML response for use in SloLogoutresponse tests
|
108
|
+
#
|
109
|
+
def decode_saml_response_payload(unauth_url)
|
110
|
+
payload = CGI.unescape(unauth_url.split("SAMLResponse=").last)
|
111
|
+
decoded = Base64.decode64(payload)
|
112
|
+
|
113
|
+
zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
114
|
+
inflated = zstream.inflate(decoded)
|
115
|
+
zstream.finish
|
116
|
+
zstream.close
|
117
|
+
inflated
|
82
118
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-saml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OneLogin LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uuid
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- lib/onelogin/ruby-saml/metadata.rb
|
63
63
|
- lib/onelogin/ruby-saml/response.rb
|
64
64
|
- lib/onelogin/ruby-saml/settings.rb
|
65
|
+
- lib/onelogin/ruby-saml/slo_logoutresponse.rb
|
65
66
|
- lib/onelogin/ruby-saml/utils.rb
|
66
67
|
- lib/onelogin/ruby-saml/validation_error.rb
|
67
68
|
- lib/onelogin/ruby-saml/version.rb
|
@@ -74,6 +75,8 @@ files:
|
|
74
75
|
- ruby-saml.gemspec
|
75
76
|
- test/certificates/certificate1
|
76
77
|
- test/certificates/r1_certificate2_base64
|
78
|
+
- test/certificates/ruby-saml.crt
|
79
|
+
- test/certificates/ruby-saml.key
|
77
80
|
- test/logoutrequest_test.rb
|
78
81
|
- test/logoutresponse_test.rb
|
79
82
|
- test/request_test.rb
|
@@ -101,6 +104,7 @@ files:
|
|
101
104
|
- test/responses/starfield_response.xml.base64
|
102
105
|
- test/responses/wrapped_response_2.xml.base64
|
103
106
|
- test/settings_test.rb
|
107
|
+
- test/slo_logoutresponse_test.rb
|
104
108
|
- test/test_helper.rb
|
105
109
|
- test/utils_test.rb
|
106
110
|
- test/xml_security_test.rb
|
@@ -123,14 +127,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
127
|
- !ruby/object:Gem::Version
|
124
128
|
version: '0'
|
125
129
|
requirements: []
|
126
|
-
|
127
|
-
rubygems_version: 2.5.2.1
|
130
|
+
rubygems_version: 3.0.4
|
128
131
|
signing_key:
|
129
132
|
specification_version: 4
|
130
133
|
summary: SAML Ruby Tookit
|
131
134
|
test_files:
|
132
135
|
- test/certificates/certificate1
|
133
136
|
- test/certificates/r1_certificate2_base64
|
137
|
+
- test/certificates/ruby-saml.crt
|
138
|
+
- test/certificates/ruby-saml.key
|
134
139
|
- test/logoutrequest_test.rb
|
135
140
|
- test/logoutresponse_test.rb
|
136
141
|
- test/request_test.rb
|
@@ -158,6 +163,7 @@ test_files:
|
|
158
163
|
- test/responses/starfield_response.xml.base64
|
159
164
|
- test/responses/wrapped_response_2.xml.base64
|
160
165
|
- test/settings_test.rb
|
166
|
+
- test/slo_logoutresponse_test.rb
|
161
167
|
- test/test_helper.rb
|
162
168
|
- test/utils_test.rb
|
163
169
|
- test/xml_security_test.rb
|