omniauth-suomifi 0.4.1 → 0.5.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: 6f13147094a51b1011e54a3b72e31352b17ce876fad5598156b5b1f6ada977b2
4
- data.tar.gz: 3ab984607001ce46573290197e49390f7e9b27bc098a7c1f48a4f24717609065
3
+ metadata.gz: 541ef437515bdfaca98ec7fe448e82a2c9008910d0937796cde8b92e92642344
4
+ data.tar.gz: 5a0987732cc390c688f58c9f0f48f579d29ade702a462f5295b0399df9675268
5
5
  SHA512:
6
- metadata.gz: 58af0b760126edc00ee2f114f90fd8c632271f1a60bc80938c70e61dbfb536c7e7032da6cd3cb91515bb239d68872c44ec3784c1498930f121e2bd139e63ff5d
7
- data.tar.gz: a6367ec02b859f4e18e84bc9e739d3b44314a299b00730092c52c65a657b44b57b7ac80149cd2fd067023a200f1e25dc537647bd33e155b2bc4d5573fac7e39d
6
+ metadata.gz: 0b87dcd1dc757088bce48a1cc98594f46c594223fc9d80f7c810ca71a87a762eed52c8906690376c034b2ffc59df73b10783198c3162841a53e171986fb467a5
7
+ data.tar.gz: 8d1fe6697ebe488eb7ced33a1e4caf8fdd91803eb256a039fd4d61ad5e6ebe8900952eba478c96d04b608dc31dae11c6161f05168a772738d3dacba88969fd20
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Suomifi
5
- VERSION = '0.4.1'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
@@ -28,16 +28,16 @@ module OmniAuth
28
28
  # - en_US
29
29
  #
30
30
  # In case a valid language cannot be parsed from the parameter, the locale
31
- # parameter will default to `:idp_sso_target_url_default_locale`.
31
+ # parameter will default to `:idp_sso_service_url_default_locale`.
32
32
  #
33
33
  # Note that the locale parameter is always added as the last parameter in
34
34
  # in the redirect URL as expected by Suomi.fi.
35
- option :idp_sso_target_url_locale_params, %w[locale language lang]
35
+ option :idp_sso_service_url_locale_params, %w[locale language lang]
36
36
 
37
37
  # This is the default locale to be passed to IdP sign in redirect URL as
38
38
  # defined above. In case a valid locale is not found from the request
39
39
  # parameters, this will be used instead.
40
- option :idp_sso_target_url_default_locale, 'fi'
40
+ option :idp_sso_service_url_default_locale, 'fi'
41
41
 
42
42
  # The request attributes for Suomi.fi
43
43
  option :possible_request_attributes, [
@@ -557,7 +557,7 @@ module OmniAuth
557
557
  # Suomi.fi requires that the service provider needs to end the local user
558
558
  # session BEFORE sending the logout request to the identity provider.
559
559
  def other_phase_for_spslo
560
- return super unless options.idp_slo_target_url
560
+ return super unless options.idp_slo_service_url
561
561
 
562
562
  with_settings do |settings|
563
563
  # Some session variables are needed when generating the logout request
@@ -629,6 +629,16 @@ module OmniAuth
629
629
  slo_binding: ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
630
630
  )
631
631
 
632
+ if settings[:idp_slo_response_service_url].nil? && settings[:idp_slo_target_url].nil?
633
+ # Mitigation after ruby-saml update to 1.12.x. This gem has been
634
+ # originally developed relying on the `:idp_slo_target_url` settings
635
+ # which was removed from the newer versions. The SLO requests won't
636
+ # work unless `:idp_slo_response_service_url` is defined in the
637
+ # metadata through the `ResponseLocation` attribute in the
638
+ # `<SingleLogoutService />` node.
639
+ settings[:idp_slo_target_url] ||= settings[:idp_slo_service_url]
640
+ end
641
+
632
642
  # Local certificate and private key to decrypt the responses
633
643
  settings[:certificate] = certificate
634
644
  settings[:private_key] = private_key
@@ -662,8 +672,8 @@ module OmniAuth
662
672
  end
663
673
 
664
674
  def locale_for_authn_request
665
- if options.idp_sso_target_url_locale_params.is_a?(Array)
666
- options.idp_sso_target_url_locale_params.each do |param|
675
+ if options.idp_sso_service_url_locale_params.is_a?(Array)
676
+ options.idp_sso_service_url_locale_params.each do |param|
667
677
  next unless request.params.key?(param.to_s)
668
678
 
669
679
  locale = parse_language_value(request.params[param.to_s])
@@ -671,7 +681,7 @@ module OmniAuth
671
681
  end
672
682
  end
673
683
 
674
- options.idp_sso_target_url_default_locale
684
+ options.idp_sso_service_url_default_locale
675
685
  end
676
686
 
677
687
  def parse_language_value(string)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-suomifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Hukkanen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-03 00:00:00.000000000 Z
11
+ date: 2021-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-saml
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.10.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby-saml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.12.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.12.1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement