mumukit-login 4.1.0 → 4.2.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: 530d05ac3f8ee75a1f62636d207e3e1e0d0cf2656baabeb00fc164d2b33ce16c
4
- data.tar.gz: 775dc86c376521e20031fa417a02c58c74af408a085de8352f4b87b372a55470
3
+ metadata.gz: 5b5be25c21177e55c4a3b2ba04046182c900a93ecb1158a12622cc02a1d162c9
4
+ data.tar.gz: 2650fddd7ccf2ce77587af1f339e405cf3a548775cc68a51a186fceace371e94
5
5
  SHA512:
6
- metadata.gz: 3e8da78641b2b30ad0f73af0ef4818e2af7047d4594278a9cf9a0e4549056ee4e218ce1c87ece0337fdc5adfeaeab0f041e2003267532fbef8c3df0db5a8f27f
7
- data.tar.gz: 7da2ff5c12e5bb9b1cedce0b84b2c323cb84026638ffd462810b7630dc249950f8fc8b4a5d4ff6acbacb67496c8444b2b528940ef002c21e847f9c4d6b1e5761
6
+ metadata.gz: c563acf6dd8b69929feaca22bde4794647b6a73ae8e8894f75daad5495bcb1b1aaf136d7176eff8c45c77669391780e5554caf78ee3ed0e4e00815a1be7e6c38
7
+ data.tar.gz: 75065bb9957f7e5d645e6a91c84f14ad401d84f51122a9071fd87b6914a1f9dc280b1d0112e8b150cb066a89455e4dbac0bb0953f7b8c19203d853bb3e14bfe4
@@ -0,0 +1,3 @@
1
+ ---
2
+ en:
3
+ accept_terms_and_conditions: I accept the <a href=\"%{terms_url}/en.html\" target=\"_new\">terms and conditions</a>
@@ -0,0 +1,3 @@
1
+ ---
2
+ es:
3
+ accept_terms_and_conditions: Acepto los <a href=\"%{terms_url}/es.html\" target=\"_new\">términos y condiciones</a>
data/lib/mumukit/login.rb CHANGED
@@ -9,6 +9,8 @@ require 'mumukit/core'
9
9
  require 'mumukit/auth'
10
10
  require 'mumukit/platform'
11
11
 
12
+ I18n.load_translations_path File.join(__dir__, '..', 'locales', '*.yml')
13
+
12
14
  module Mumukit::Login
13
15
  def self.configure
14
16
  @config ||= defaults
@@ -18,11 +20,14 @@ module Mumukit::Login
18
20
  def self.defaults
19
21
  struct.tap do |config|
20
22
  config.logo_url = ENV['MUMUKI_LOGO_URL'] || "https://mumuki.io/static/logo.png"
23
+ config.terms_url = ENV['MUMUKI_TERMS_URL'] || "https://mumuki.io/static/terms"
21
24
  config.mucookie_domain = ENV['MUMUKI_COOKIES_DOMAIN'] || ENV['MUMUKI_MUCOOKIE_DOMAIN']
22
25
  config.mucookie_secret_key = ENV['SECRET_KEY_BASE'] || ENV['MUMUKI_MUCOOKIE_SECRET_KEY']
23
26
  config.mucookie_secret_salt = ENV['MUMUKI_MUCOOKIE_SECRET_SALT'] || 'mucookie secret salt'
24
27
  config.mucookie_sign_salt = ENV['MUMUKI_MUCOOKIE_SIGN_KEY'] || 'mucookie sign salt'
25
28
 
29
+ config.mucookie_duration = ENV['MUMUKI_MUCOOKIE_DURATION'].defaulting(14, &:to_i)
30
+
26
31
  config.provider = Mumukit::Login::Provider.from_env
27
32
  config.saml = struct base_url: ENV['MUMUKI_SAML_BASE_URL'],
28
33
  idp_sso_target_url: ENV['MUMUKI_SAML_IDP_SSO_TARGET_URL'],
@@ -95,4 +100,4 @@ end
95
100
  Mumukit::Auth.configure do |config|
96
101
  config.clients.mucookie = {id: ENV['MUMUKI_MUCOOKIE_CLIENT_ID'],
97
102
  secret: ENV['MUMUKI_MUCOOKIE_SECRET']}
98
- end
103
+ end
@@ -7,10 +7,9 @@ class Mumukit::Login::Mucookie
7
7
 
8
8
  def write!(key, value, options={})
9
9
  @controller.write_cookie! cookie_name(key),
10
- value: value.to_s,
11
- path: '/',
12
- domain: Mumukit::Login.config.mucookie_domain,
13
- httponly: !!options[:httponly]
10
+ spec.merge(
11
+ value: value.to_s,
12
+ httponly: !!options[:httponly])
14
13
  end
15
14
 
16
15
  def encrypt_and_write!(key, value, options={})
@@ -37,6 +36,12 @@ class Mumukit::Login::Mucookie
37
36
  @controller.delete_cookie! cookie_name(key), Mumukit::Login.config.mucookie_domain
38
37
  end
39
38
 
39
+ def spec
40
+ { path: '/',
41
+ expires: Mumukit::Login.config.mucookie_duration.days.since,
42
+ domain: Mumukit::Login.config.mucookie_domain }
43
+ end
44
+
40
45
  private
41
46
 
42
47
  def cookie_name(key)
@@ -36,8 +36,10 @@ class Mumukit::Login::Settings
36
36
  def lock_json
37
37
  {
38
38
  languageDictionary: {
39
- title: 'Mumuki'
39
+ title: 'Mumuki',
40
+ signUpTerms: I18n.t(:accept_terms_and_conditions, terms_url: Mumukit::Login.config.terms_url)
40
41
  },
42
+ mustAcceptTerms: true,
41
43
  language: I18n.locale,
42
44
  allowedConnections: lock_login_methods,
43
45
  socialButtonStyle: many_methods? ? 'small' : 'big',
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '4.1.0'
3
+ VERSION = '4.2.0'
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: 4.1.0
4
+ version: 4.2.0
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-01-15 00:00:00.000000000 Z
11
+ date: 2018-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.0'
159
+ version: '1.1'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.0'
166
+ version: '1.1'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: mumukit-auth
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -199,6 +199,8 @@ executables: []
199
199
  extensions: []
200
200
  extra_rdoc_files: []
201
201
  files:
202
+ - lib/locales/en.yml
203
+ - lib/locales/es.yml
202
204
  - lib/mumukit/login.rb
203
205
  - lib/mumukit/login/controller.rb
204
206
  - lib/mumukit/login/form.rb