mumukit-login 4.1.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locales/en.yml +3 -0
- data/lib/locales/es.yml +3 -0
- data/lib/mumukit/login.rb +6 -1
- data/lib/mumukit/login/mucookie.rb +9 -4
- data/lib/mumukit/login/settings.rb +3 -1
- data/lib/mumukit/login/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b5be25c21177e55c4a3b2ba04046182c900a93ecb1158a12622cc02a1d162c9
|
4
|
+
data.tar.gz: 2650fddd7ccf2ce77587af1f339e405cf3a548775cc68a51a186fceace371e94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c563acf6dd8b69929feaca22bde4794647b6a73ae8e8894f75daad5495bcb1b1aaf136d7176eff8c45c77669391780e5554caf78ee3ed0e4e00815a1be7e6c38
|
7
|
+
data.tar.gz: 75065bb9957f7e5d645e6a91c84f14ad401d84f51122a9071fd87b6914a1f9dc280b1d0112e8b150cb066a89455e4dbac0bb0953f7b8c19203d853bb3e14bfe4
|
data/lib/locales/en.yml
ADDED
data/lib/locales/es.yml
ADDED
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
|
-
|
11
|
-
|
12
|
-
|
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',
|
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.
|
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-
|
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.
|
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.
|
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
|