saml_idp 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1ba3b2f2b20a724319f30539cea15c3a224b21e9d7ffacdde0ac471ad885dc0
4
- data.tar.gz: 95405db1de10b6f1686bd8c3d4696288f095e8921dc482a57e1fc2f0a4ddb686
3
+ metadata.gz: 4692b2d2c5266c2db128e4942daddd534c7e22efe32f1f45b02776db2eb8b607
4
+ data.tar.gz: cc0b169ea2d024b91590e270c6a6cbe742a661280651917147eb0401f821c6a8
5
5
  SHA512:
6
- metadata.gz: 5f21bade5ab5845df2c21567ad6a5db6111aedc3af3642b6127e62708a2ea76cd02cbc47fadb88d7f2fc2036dda1daefc9c3c333b68713bd0cf0538dd9f44fc7
7
- data.tar.gz: 817c824e708fa990c6509e3ba4b40867c561ff346bdd895515e6998d66866d56a5256664fcb3498f2746f1b760d4901001605b3dbc46df7eff078b48019f1c77
6
+ metadata.gz: 0d1eaa0e214b1c2cb17970987fc0956c991e33831a05f7bf40936180f6a4fc2a22d5539051b456f7a920a49b7cbd98e83296ae55858025351e9fb693a6f6d595
7
+ data.tar.gz: 587c1ca1bc298dc8381bd50e49bd3b361fd011b4ae7509107f2336ec2b9cbc30bd625915a76d5833ebbe7c36eb9181acbee2f1f8b60dae0cb71f27a0436a9fec
@@ -36,10 +36,12 @@ module SamlIdp
36
36
  def validate_saml_request(raw_saml_request = params[:SAMLRequest])
37
37
  decode_request(raw_saml_request)
38
38
  return true if valid_saml_request?
39
- if Rails::VERSION::MAJOR >= 4
40
- head :forbidden
41
- else
42
- render nothing: true, status: :forbidden
39
+ if defined?(::Rails)
40
+ if Rails::VERSION::MAJOR >= 4
41
+ head :forbidden
42
+ else
43
+ render nothing: true, status: :forbidden
44
+ end
43
45
  end
44
46
  false
45
47
  end
@@ -16,6 +16,11 @@ module SamlIdp
16
16
  @document ||= Saml::XML::Document.parse raw
17
17
  end
18
18
 
19
+ def entity_id
20
+ xpath('//md:EntityDescriptor/@entityID', md: metadata_namespace).first.try(:content).to_s
21
+ end
22
+ hashable :entity_id
23
+
19
24
  def sign_assertions
20
25
  doc = xpath(
21
26
  "//md:SPSSODescriptor",
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SamlIdp
3
- VERSION = '0.8.1'
3
+ VERSION = '0.9.0'
4
4
  end
@@ -51,7 +51,7 @@ section of the README.
51
51
  s.add_development_dependency('rake')
52
52
  s.add_development_dependency('simplecov')
53
53
  s.add_development_dependency('rspec', '>= 3.7.0')
54
- s.add_development_dependency('ruby-saml', '>= 1.5')
54
+ s.add_development_dependency('ruby-saml', '>= 1.7.2')
55
55
  s.add_development_dependency('rails', '>= 3.2')
56
56
  s.add_development_dependency('activeresource', '>= 3.2')
57
57
  s.add_development_dependency('capybara', '>= 2.16')
@@ -28,6 +28,11 @@ module SamlIdp
28
28
  expect(metadata.sign_assertions).to eq(false)
29
29
  end
30
30
 
31
+ it 'should properly set entity_id as https://test-saml.com/saml' do
32
+ metadata = SamlIdp::IncomingMetadata.new(metadata_1)
33
+ expect(metadata.entity_id).to eq('https://test-saml.com/saml')
34
+ end
35
+
31
36
  it 'should properly set sign_assertions to true' do
32
37
  metadata = SamlIdp::IncomingMetadata.new(metadata_2)
33
38
  expect(metadata.sign_assertions).to eq(true)
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.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Phenow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '1.5'
117
+ version: 1.7.2
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '1.5'
124
+ version: 1.7.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rails
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -347,7 +347,7 @@ metadata:
347
347
  homepage_uri: https://github.com/saml-idp/saml_idp
348
348
  source_code_uri: https://github.com/saml-idp/saml_idp
349
349
  bug_tracker_uri: https://github.com/saml-idp/saml_idp/issues
350
- documentation_uri: http://rdoc.info/gems/saml_idp/0.8.1
350
+ documentation_uri: http://rdoc.info/gems/saml_idp/0.9.0
351
351
  post_install_message: |
352
352
  If you're just recently updating saml_idp - please be aware we've changed the default
353
353
  certificate. See the PR and a description of why we've done this here: