saml_idp 0.8.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +49 -47
- data/lib/saml_idp/assertion_builder.rb +28 -3
- data/lib/saml_idp/configurator.rb +6 -1
- data/lib/saml_idp/controller.rb +19 -11
- data/lib/saml_idp/encryptor.rb +0 -1
- data/lib/saml_idp/fingerprint.rb +19 -0
- data/lib/saml_idp/incoming_metadata.rb +18 -0
- data/lib/saml_idp/metadata_builder.rb +23 -8
- data/lib/saml_idp/persisted_metadata.rb +4 -0
- data/lib/saml_idp/request.rb +13 -6
- data/lib/saml_idp/response_builder.rb +26 -6
- data/lib/saml_idp/saml_response.rb +62 -28
- data/lib/saml_idp/service_provider.rb +1 -6
- data/lib/saml_idp/signable.rb +1 -2
- data/lib/saml_idp/version.rb +1 -1
- data/lib/saml_idp/xml_security.rb +1 -1
- data/lib/saml_idp.rb +2 -1
- data/saml_idp.gemspec +31 -31
- data/spec/lib/saml_idp/assertion_builder_spec.rb +143 -0
- data/spec/lib/saml_idp/configurator_spec.rb +2 -0
- data/spec/lib/saml_idp/controller_spec.rb +24 -0
- data/spec/lib/saml_idp/fingerprint_spec.rb +14 -0
- data/spec/lib/saml_idp/incoming_metadata_spec.rb +20 -1
- data/spec/lib/saml_idp/metadata_builder_spec.rb +23 -0
- data/spec/lib/saml_idp/request_spec.rb +43 -9
- data/spec/lib/saml_idp/response_builder_spec.rb +3 -1
- data/spec/lib/saml_idp/saml_response_spec.rb +122 -7
- data/spec/rails_app/app/controllers/saml_controller.rb +1 -5
- data/spec/rails_app/app/controllers/saml_idp_controller.rb +55 -3
- data/{app → spec/rails_app/app}/views/saml_idp/idp/new.html.erb +1 -5
- data/{app → spec/rails_app/app}/views/saml_idp/idp/saml_post.html.erb +1 -1
- data/spec/rails_app/config/application.rb +1 -0
- data/spec/rails_app/config/boot.rb +1 -1
- data/spec/rails_app/config/environments/development.rb +2 -0
- data/spec/spec_helper.rb +20 -1
- data/spec/support/certificates/sp_cert_req.csr +12 -0
- data/spec/support/certificates/sp_private_key.pem +16 -0
- data/spec/support/certificates/sp_x509_cert.crt +18 -0
- data/spec/support/saml_request_macros.rb +62 -3
- data/spec/support/security_helpers.rb +10 -0
- metadata +83 -61
- data/app/controllers/saml_idp/idp_controller.rb +0 -59
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saml_idp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Phenow
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,72 +16,86 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.6.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.6.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rexml
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: xmlenc
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.7.1
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.7.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activeresource
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5.1'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '5.1'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: appraisal
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -95,117 +109,117 @@ dependencies:
|
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: byebug
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: capybara
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - ">="
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
131
|
+
version: '2.16'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '2.16'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rails
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
143
|
- - ">="
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
145
|
+
version: '5.2'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '5.2'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
154
|
+
name: rake
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - ">="
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
159
|
+
version: '0'
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - ">="
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
168
|
+
name: rspec
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
173
|
+
version: 3.7.0
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - ">="
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
180
|
+
version: 3.7.0
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
182
|
+
name: ruby-saml
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - ">="
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
187
|
+
version: 1.7.2
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - ">="
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
194
|
+
version: 1.7.2
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
196
|
+
name: simplecov
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
184
198
|
requirements:
|
185
199
|
- - ">="
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0
|
201
|
+
version: '0'
|
188
202
|
type: :development
|
189
203
|
prerelease: false
|
190
204
|
version_requirements: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
206
|
- - ">="
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0
|
208
|
+
version: '0'
|
195
209
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
210
|
+
name: timecop
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
213
|
- - ">="
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: '0'
|
215
|
+
version: '0.8'
|
202
216
|
type: :development
|
203
217
|
prerelease: false
|
204
218
|
version_requirements: !ruby/object:Gem::Requirement
|
205
219
|
requirements:
|
206
220
|
- - ">="
|
207
221
|
- !ruby/object:Gem::Version
|
208
|
-
version: '0'
|
222
|
+
version: '0.8'
|
209
223
|
description: SAML IdP (Identity Provider) Library for Ruby
|
210
224
|
email: jon.phenow@sportngin.com
|
211
225
|
executables: []
|
@@ -215,9 +229,6 @@ files:
|
|
215
229
|
- Gemfile
|
216
230
|
- LICENSE
|
217
231
|
- README.md
|
218
|
-
- app/controllers/saml_idp/idp_controller.rb
|
219
|
-
- app/views/saml_idp/idp/new.html.erb
|
220
|
-
- app/views/saml_idp/idp/saml_post.html.erb
|
221
232
|
- lib/saml_idp.rb
|
222
233
|
- lib/saml_idp/algorithmable.rb
|
223
234
|
- lib/saml_idp/assertion_builder.rb
|
@@ -228,6 +239,7 @@ files:
|
|
228
239
|
- lib/saml_idp/default.rb
|
229
240
|
- lib/saml_idp/encryptor.rb
|
230
241
|
- lib/saml_idp/engine.rb
|
242
|
+
- lib/saml_idp/fingerprint.rb
|
231
243
|
- lib/saml_idp/hashable.rb
|
232
244
|
- lib/saml_idp/incoming_metadata.rb
|
233
245
|
- lib/saml_idp/logout_builder.rb
|
@@ -254,6 +266,7 @@ files:
|
|
254
266
|
- spec/lib/saml_idp/configurator_spec.rb
|
255
267
|
- spec/lib/saml_idp/controller_spec.rb
|
256
268
|
- spec/lib/saml_idp/encryptor_spec.rb
|
269
|
+
- spec/lib/saml_idp/fingerprint_spec.rb
|
257
270
|
- spec/lib/saml_idp/incoming_metadata_spec.rb
|
258
271
|
- spec/lib/saml_idp/logout_request_builder_spec.rb
|
259
272
|
- spec/lib/saml_idp/logout_response_builder_spec.rb
|
@@ -279,6 +292,8 @@ files:
|
|
279
292
|
- spec/rails_app/app/mailers/.gitkeep
|
280
293
|
- spec/rails_app/app/models/.gitkeep
|
281
294
|
- spec/rails_app/app/views/layouts/application.html.erb
|
295
|
+
- spec/rails_app/app/views/saml_idp/idp/new.html.erb
|
296
|
+
- spec/rails_app/app/views/saml_idp/idp/saml_post.html.erb
|
282
297
|
- spec/rails_app/config.ru
|
283
298
|
- spec/rails_app/config/application.rb
|
284
299
|
- spec/rails_app/config/boot.rb
|
@@ -319,6 +334,9 @@ files:
|
|
319
334
|
- spec/spec_helper.rb
|
320
335
|
- spec/support/certificates/certificate1
|
321
336
|
- spec/support/certificates/r1_certificate2_base64
|
337
|
+
- spec/support/certificates/sp_cert_req.csr
|
338
|
+
- spec/support/certificates/sp_private_key.pem
|
339
|
+
- spec/support/certificates/sp_x509_cert.crt
|
322
340
|
- spec/support/responses/adfs_response_sha1.xml
|
323
341
|
- spec/support/responses/adfs_response_sha256.xml
|
324
342
|
- spec/support/responses/adfs_response_sha384.xml
|
@@ -347,22 +365,21 @@ metadata:
|
|
347
365
|
homepage_uri: https://github.com/saml-idp/saml_idp
|
348
366
|
source_code_uri: https://github.com/saml-idp/saml_idp
|
349
367
|
bug_tracker_uri: https://github.com/saml-idp/saml_idp/issues
|
350
|
-
documentation_uri: http://rdoc.info/gems/saml_idp/0.
|
351
|
-
post_install_message: |
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
If you just need to see the certificate `bundle open saml_idp` and go to
|
357
|
-
`lib/saml_idp/default.rb`
|
368
|
+
documentation_uri: http://rdoc.info/gems/saml_idp/0.15.0
|
369
|
+
post_install_message: |2
|
370
|
+
If you're just recently updating saml_idp - please be aware we've changed the default
|
371
|
+
certificate. See the PR and a description of why we've done this here:
|
372
|
+
https://github.com/saml-idp/saml_idp/pull/29
|
358
373
|
|
359
|
-
|
360
|
-
|
374
|
+
If you just need to see the certificate `bundle open saml_idp` and go to
|
375
|
+
`lib/saml_idp/default.rb`
|
361
376
|
|
362
|
-
|
377
|
+
Similarly, please see the README about certificates - you should avoid using the
|
378
|
+
defaults in a Production environment. Post any issues you to github.
|
363
379
|
|
364
|
-
|
365
|
-
|
380
|
+
** New in Version 0.3.0 **
|
381
|
+
Encrypted Assertions require the xmlenc gem. See the example in the Controller
|
382
|
+
section of the README.
|
366
383
|
rdoc_options:
|
367
384
|
- "--charset=UTF-8"
|
368
385
|
require_paths:
|
@@ -371,16 +388,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
371
388
|
requirements:
|
372
389
|
- - ">="
|
373
390
|
- !ruby/object:Gem::Version
|
374
|
-
version: '2.
|
391
|
+
version: '2.5'
|
375
392
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
376
393
|
requirements:
|
377
394
|
- - ">="
|
378
395
|
- !ruby/object:Gem::Version
|
379
396
|
version: '0'
|
380
397
|
requirements: []
|
381
|
-
|
382
|
-
|
383
|
-
signing_key:
|
398
|
+
rubygems_version: 3.3.7
|
399
|
+
signing_key:
|
384
400
|
specification_version: 4
|
385
401
|
summary: SAML Indentity Provider for Ruby
|
386
402
|
test_files:
|
@@ -392,6 +408,7 @@ test_files:
|
|
392
408
|
- spec/lib/saml_idp/configurator_spec.rb
|
393
409
|
- spec/lib/saml_idp/controller_spec.rb
|
394
410
|
- spec/lib/saml_idp/encryptor_spec.rb
|
411
|
+
- spec/lib/saml_idp/fingerprint_spec.rb
|
395
412
|
- spec/lib/saml_idp/incoming_metadata_spec.rb
|
396
413
|
- spec/lib/saml_idp/logout_request_builder_spec.rb
|
397
414
|
- spec/lib/saml_idp/logout_response_builder_spec.rb
|
@@ -417,6 +434,8 @@ test_files:
|
|
417
434
|
- spec/rails_app/app/mailers/.gitkeep
|
418
435
|
- spec/rails_app/app/models/.gitkeep
|
419
436
|
- spec/rails_app/app/views/layouts/application.html.erb
|
437
|
+
- spec/rails_app/app/views/saml_idp/idp/new.html.erb
|
438
|
+
- spec/rails_app/app/views/saml_idp/idp/saml_post.html.erb
|
420
439
|
- spec/rails_app/config.ru
|
421
440
|
- spec/rails_app/config/application.rb
|
422
441
|
- spec/rails_app/config/boot.rb
|
@@ -457,6 +476,9 @@ test_files:
|
|
457
476
|
- spec/spec_helper.rb
|
458
477
|
- spec/support/certificates/certificate1
|
459
478
|
- spec/support/certificates/r1_certificate2_base64
|
479
|
+
- spec/support/certificates/sp_cert_req.csr
|
480
|
+
- spec/support/certificates/sp_private_key.pem
|
481
|
+
- spec/support/certificates/sp_x509_cert.crt
|
460
482
|
- spec/support/responses/adfs_response_sha1.xml
|
461
483
|
- spec/support/responses/adfs_response_sha256.xml
|
462
484
|
- spec/support/responses/adfs_response_sha384.xml
|
@@ -1,59 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module SamlIdp
|
4
|
-
class IdpController < ActionController::Base
|
5
|
-
include SamlIdp::Controller
|
6
|
-
|
7
|
-
unloadable unless Rails::VERSION::MAJOR >= 4
|
8
|
-
protect_from_forgery
|
9
|
-
|
10
|
-
if Rails::VERSION::MAJOR >= 4
|
11
|
-
before_action :validate_saml_request, only: [:new, :create]
|
12
|
-
else
|
13
|
-
before_filter :validate_saml_request, only: [:new, :create]
|
14
|
-
end
|
15
|
-
|
16
|
-
def new
|
17
|
-
render template: "saml_idp/idp/new"
|
18
|
-
end
|
19
|
-
|
20
|
-
def show
|
21
|
-
render xml: SamlIdp.metadata.signed
|
22
|
-
end
|
23
|
-
|
24
|
-
def create
|
25
|
-
unless params[:email].blank? && params[:password].blank?
|
26
|
-
person = idp_authenticate(params[:email], params[:password])
|
27
|
-
if person.nil?
|
28
|
-
@saml_idp_fail_msg = "Incorrect email or password."
|
29
|
-
else
|
30
|
-
@saml_response = idp_make_saml_response(person)
|
31
|
-
render :template => "saml_idp/idp/saml_post", :layout => false
|
32
|
-
return
|
33
|
-
end
|
34
|
-
end
|
35
|
-
render :template => "saml_idp/idp/new"
|
36
|
-
end
|
37
|
-
|
38
|
-
def logout
|
39
|
-
idp_logout
|
40
|
-
@saml_response = idp_make_saml_response(nil)
|
41
|
-
render :template => "saml_idp/idp/saml_post", :layout => false
|
42
|
-
end
|
43
|
-
|
44
|
-
def idp_logout
|
45
|
-
raise NotImplementedError
|
46
|
-
end
|
47
|
-
private :idp_logout
|
48
|
-
|
49
|
-
def idp_authenticate(email, password)
|
50
|
-
raise NotImplementedError
|
51
|
-
end
|
52
|
-
protected :idp_authenticate
|
53
|
-
|
54
|
-
def idp_make_saml_response(person)
|
55
|
-
raise NotImplementedError
|
56
|
-
end
|
57
|
-
protected :idp_make_saml_response
|
58
|
-
end
|
59
|
-
end
|