saml_idp 0.15.0 → 0.16.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4da444f25fd4d8cb2b53d847ee3ffa44adab3b2c4b64be57a6935c0922acf1a8
4
- data.tar.gz: ff0beb64e76c37a0bbcb098f0bd5a50b4d15ff124d63d9c01d421f4693f6fa2d
3
+ metadata.gz: 7cd98d292836070eddac0b7f710dbd15b0d3611cc849de827b999c3a2fa12d86
4
+ data.tar.gz: f49f1035b63375d5b8aebfd38484c1859d8ac35520f82df92fc698cea00dde1a
5
5
  SHA512:
6
- metadata.gz: 1fe91e27e817106e66738c73c670ce064c18b18e9528f7aef3c2a4dc87658c9262877b7a62f491c29ff371d39e0306721bc1f97af7ec3fb6fd1d23b8550b32ce
7
- data.tar.gz: d6ee196976da4fe1af818bca3183632372ef2e1e3059891e75a13dc39caa9fb86c3d312c384d926877f9e14cfbd751d566d517742e72e0bb77e276e446a88aed
6
+ metadata.gz: 7ab18f32c643b5c8be43a093349ff5c1c0f3142b8156fb650f749ffde2ce1306e104d4006178f77f27055bc6683a35ffbf8aa1d79331140b9c94ae7a2a1da7ee
7
+ data.tar.gz: e68e9a8f0dd08f5dd9aa31c8ff8461ca229b97cbc5e9813eed9c3575ee65bafd2c766bcfd19d9081d0956bab62b8819574b8765be692156d10967589a791cda3
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Forked from <https://github.com/lawrencepit/ruby-saml-idp>
4
4
 
5
- [![Build Status](https://travis-ci.org/saml-idp/saml_idp.svg)](https://travis-ci.org/saml-idp/saml_idp)
6
5
  [![Gem Version](https://badge.fury.io/rb/saml_idp.svg)](http://badge.fury.io/rb/saml_idp)
7
6
 
8
7
  The ruby SAML Identity Provider library is for implementing the server side of SAML authentication. It allows
@@ -81,8 +81,8 @@ module SamlIdp
81
81
  session_expiry,
82
82
  name_id_formats_opts,
83
83
  asserted_attributes_opts,
84
- signed_assertion_opts,
85
84
  signed_message_opts,
85
+ signed_assertion_opts,
86
86
  compress_opts
87
87
  ).build
88
88
  end
@@ -78,10 +78,10 @@ module SamlIdp
78
78
  end
79
79
 
80
80
  def log(msg)
81
- if config.logger.class <= ::Logger
82
- config.logger.info msg
83
- else
81
+ if config.logger.respond_to?(:call)
84
82
  config.logger.call msg
83
+ else
84
+ config.logger.info msg
85
85
  end
86
86
  end
87
87
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SamlIdp
3
- VERSION = '0.15.0'
3
+ VERSION = '0.16.0'
4
4
  end
@@ -91,6 +91,12 @@ describe SamlIdp::Controller do
91
91
  expect(response.issuer).to eq("http://example.com")
92
92
  end
93
93
 
94
+ it "should by default create a SAML Response with a signed assertion" do
95
+ saml_response = encode_response(principal)
96
+ response = OneLogin::RubySaml::Response.new(saml_response)
97
+ response.settings = saml_settings("https://foo.example.com/saml/consume", true)
98
+ expect(response.is_valid?).to be_truthy
99
+ end
94
100
 
95
101
  [:sha1, :sha256, :sha384, :sha512].each do |algorithm_name|
96
102
  it "should create a SAML Response using the #{algorithm_name} algorithm" do
@@ -91,6 +91,23 @@ module SamlIdp
91
91
  end
92
92
  end
93
93
 
94
+ context 'a Logger-like logger is configured' do
95
+ let(:logger) do
96
+ Class.new {
97
+ def info(msg); end
98
+ }.new
99
+ end
100
+
101
+ before do
102
+ allow(logger).to receive(:info)
103
+ end
104
+
105
+ it 'logs an error message' do
106
+ expect(subject.valid?).to be false
107
+ expect(logger).to have_received(:info).with('Unable to find service provider for issuer ')
108
+ end
109
+ end
110
+
94
111
  context 'a logger lambda is configured' do
95
112
  let(:logger) { double }
96
113
 
@@ -40,7 +40,8 @@ module SamlRequestMacros
40
40
  logout_requests_signed: true,
41
41
  logout_responses_signed: true,
42
42
  digest_method: XMLSecurity::Document::SHA256,
43
- signature_method: XMLSecurity::Document::RSA_SHA256)
43
+ signature_method: XMLSecurity::Document::RSA_SHA256,
44
+ assertions_signed: true)
44
45
  # Security section
45
46
  settings.idp_cert = SamlIdp::Default::X509_CERTIFICATE
46
47
  # Signed embedded singature
@@ -51,6 +52,7 @@ module SamlRequestMacros
51
52
  settings.security[:metadata_signed] = digest_method
52
53
  settings.security[:digest_method] = digest_method
53
54
  settings.security[:signature_method] = signature_method
55
+ settings.security[:want_assertions_signed] = assertions_signed
54
56
  settings.private_key = sp_pv_key
55
57
  settings.certificate = sp_x509_cert
56
58
  end
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.15.0
4
+ version: 0.16.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: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2024-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -365,7 +365,7 @@ metadata:
365
365
  homepage_uri: https://github.com/saml-idp/saml_idp
366
366
  source_code_uri: https://github.com/saml-idp/saml_idp
367
367
  bug_tracker_uri: https://github.com/saml-idp/saml_idp/issues
368
- documentation_uri: http://rdoc.info/gems/saml_idp/0.15.0
368
+ documentation_uri: http://rdoc.info/gems/saml_idp/0.16.0
369
369
  post_install_message: |2
370
370
  If you're just recently updating saml_idp - please be aware we've changed the default
371
371
  certificate. See the PR and a description of why we've done this here: