mumukit-login 6.1.1 → 6.1.2

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: b4c0227c6312c203934f5b698f382707358a369eda06d8bd9e1a0a8acafbce8d
4
- data.tar.gz: ed2e7d7c57184044d2ffe16f771a493766e66185beaafb85dce18e7461ea1ebf
3
+ metadata.gz: 3e253118b608f53f7d20743dc81cf0fa9322ee4689d46aa7a49077d33c84041c
4
+ data.tar.gz: 521feb734a561c1cd29700802d2dd448f1b0dcb46967e518bd6ecb626ab3ed03
5
5
  SHA512:
6
- metadata.gz: 302ffd66ec3ba05ef8d0586cc8be0fe58369c03d5886f4daf24bbeed01bc2fcc9af8519c38cd8c39c33b83fb40d5294eaa2fccfdbdd6ae5ad8ca387c13a40b93
7
- data.tar.gz: 92c97e2fef48b9a9af586241c5ac22a210fc0195d2640328a07d20684208c2e550275807a8e552505a8c6cac2fdc86c66f785c7232f6b58e4624c41d9bbc6b47
6
+ metadata.gz: 7a5e754fe88910cae7739255c8579219e590a737d33ce263e74bb5d95bcd274e16f1d6fc91d25206e2c8e7c251007a814be1b6f0ac8b708844a490ab5175bd8b
7
+ data.tar.gz: 20486d83d41dc0ea962b9ba4abd4c534f13fd8cf3727530169de1cb65e8307595f9dfce42ade940f2a9d5342d78f20e72e09b4b5d58b208c9d4a3ba89d4ca2df
data/lib/mumukit/login.rb CHANGED
@@ -40,6 +40,7 @@ module Mumukit::Login
40
40
  translation_image: ENV['MUMUKI_SAML_TRANSLATION_IMAGE'] || 'image'
41
41
  config.cas = struct url: ENV['MUMUKI_CAS_URL'],
42
42
  host: ENV['MUMUKI_CAS_HOST'],
43
+ ssl_certificate: ENV['MUMUKI_CAS_SSL_CERTIFICATE'],
43
44
  disable_ssl_verification: ENV['MUMUKI_CAS_DISABLE_SSL_VERIFICATION'] == 'true'
44
45
  config.auth0 = struct client_id: ENV['MUMUKI_AUTH0_CLIENT_ID'],
45
46
  client_secret: ENV['MUMUKI_AUTH0_CLIENT_SECRET'],
@@ -1,9 +1,9 @@
1
1
  module Mumukit::Login::Provider
2
2
  PROVIDERS = %w(
3
3
  developer
4
+ auth0
4
5
  saml
5
6
  cas
6
- auth0
7
7
  google
8
8
  )
9
9
 
@@ -11,8 +11,10 @@ module Mumukit::Login::Provider
11
11
  parse_login_provider(login_provider_string)
12
12
  end
13
13
 
14
- def self.default_enabled_providers # This is a list of the default enabled login providers
15
- case ENV['RACK_ENV'] || ENV['RAILS_ENV'] # It depends only on the current environment
14
+ # This is a list of the default enabled login providers
15
+ # It depends only on the current environment
16
+ def self.default_enabled_providers
17
+ case ENV['RACK_ENV'] || ENV['RAILS_ENV']
16
18
  when 'production'
17
19
  PROVIDERS - %w(developer)
18
20
  when 'test'
@@ -22,17 +24,22 @@ module Mumukit::Login::Provider
22
24
  end
23
25
  end
24
26
 
25
- def self.enabled_providers # This is a list of the login providers enabled on the current instance of the platform
26
- if ENV['MUMUKI_ENABLED_LOGIN_PROVIDERS'].blank? # It is obtained from the environment, and if unset, it defaults to default_enabled_providers
27
+ # This is a list of the login providers enabled on the current instance of the platform
28
+ # It is obtained from the environment, and if unset, it defaults to default_enabled_providers
29
+ def self.enabled_providers
30
+ if ENV['MUMUKI_ENABLED_LOGIN_PROVIDERS'].blank?
27
31
  default_enabled_providers
28
32
  else
29
33
  ENV['MUMUKI_ENABLED_LOGIN_PROVIDERS'].split ','
30
34
  end
31
35
  end
32
36
 
33
- def self.login_provider_string # This is the default login provider used when it is not overriden in the organization's config
34
- if ENV['MUMUKI_LOGIN_PROVIDER'].blank? # It is obtained from env, and defaults to the first of the current enabled providers
35
- enabled_providers.first # It should always be a provider within the enabled_providers list
37
+ # This is the default login provider used when it is not overriden in the organization's config
38
+ # It is obtained from env, and defaults to the first of the current enabled providers
39
+ # It should always be a provider within the enabled_providers list
40
+ def self.login_provider_string
41
+ if ENV['MUMUKI_LOGIN_PROVIDER'].blank?
42
+ enabled_providers.first
36
43
  else
37
44
  ENV['MUMUKI_LOGIN_PROVIDER']
38
45
  end
@@ -8,10 +8,6 @@ class Mumukit::Login::Provider::Cas < Mumukit::Login::Provider::Base
8
8
  def default_settings
9
9
  Mumukit::Login.config.cas
10
10
  end
11
-
12
- def computed_settings(_cas)
13
- { ca_path: '.' }
14
- end
15
11
  end
16
12
 
17
13
  # Monkey-patching to support phpCAS implementation
@@ -31,3 +27,26 @@ module OmniAuth
31
27
  end
32
28
  end
33
29
  end
30
+
31
+ module OmniAuth
32
+ module Strategies
33
+ class CAS
34
+ class ServiceTicketValidator
35
+ def get_service_response_body
36
+ result = ''
37
+ http = Net::HTTP.new(@uri.host, @uri.port)
38
+ http.use_ssl = @uri.port == 443 || @uri.instance_of?(URI::HTTPS)
39
+ if http.use_ssl?
40
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @options.disable_ssl_verification?
41
+ http.cert = @options.ssl_certificate.try { |it| OpenSSL::X509::Certificate.new it }
42
+ end
43
+ http.start do |c|
44
+ response = c.get "#{@uri.path}?#{@uri.query}", VALIDATION_REQUEST_HEADERS.dup
45
+ result = response.body
46
+ end
47
+ result
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '6.1.1'
3
+ VERSION = '6.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-login
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler