mumukit-login 7.4.1 → 7.6.0

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: 79f9af1052d482e6ac705c690008baa6b1b48ce5bac7d4657721391b8f384366
4
- data.tar.gz: 4ea633723b6d51a32b814af0da2e76a303af02c8cc8030a04b6eaed5822d3af6
3
+ metadata.gz: 3140a4de2c192389a9440015088a9433258e7d90302d2928c934cf3c9a61f396
4
+ data.tar.gz: ec61382b8d23822469f4a99e4014fd7eca6408058ded84980ef75c3020369777
5
5
  SHA512:
6
- metadata.gz: 70cbe76c86b4b1b34c8501f66a5521eb28646ac6f04a5df3c99cf8993ed0d61f4a4fa9f80115e618818c4f28358d9444777b9bd94622d3961a4f5753e02bcd67
7
- data.tar.gz: f7e9c785adb74998f9511d72075f8e12183fc65388e7f6793cb5f6ad2d6438bf2b4f967bc16c5b82debfdbdec212d81a3c431654a4e9b69dfe52ce25cc224cfc
6
+ metadata.gz: 6769fb8f244e34fe7fd79948aeb9cb12a05d8153a8d38a62886bd774c8a9bf5dbdbc3be552833964ca5522dd8d9b20260758c4000c652a36a1a8c25795570b89
7
+ data.tar.gz: '008a499ae28050234e595bdf2e9c0576c7533228af1d2cf0724fa6e8430aa0cb437a3f2d8b409d88d908cf74ffb1a3c26420c61031885d6986e1cc0382be04d5'
@@ -15,5 +15,11 @@ module Mumukit::Login::AuthorizationHelpers
15
15
  current_user.has_permission? role, authorization_slug
16
16
  end
17
17
 
18
+ Mumukit::Auth::Roles::ROLES.each do |role|
19
+ define_method "authorize_#{role}!" do
20
+ authorize! role
21
+ end
22
+ end
23
+
18
24
  required :authorization_slug
19
25
  end
@@ -11,10 +11,14 @@ module Mumukit::Login::Profile
11
11
  social_id: omniauth.uid,
12
12
  email: omniauth.info.email,
13
13
  uid: generate_uid(omniauth),
14
- image_url: omniauth.info.image
14
+ image_url: image_url(omniauth.info.image)
15
15
  }.compact
16
16
  end
17
17
 
18
+ def self.image_url(url)
19
+ url if url.try { size <= 255 }
20
+ end
21
+
18
22
  def self.generate_uid(omniauth)
19
23
  Mumukit::Login::Provider.parse_login_provider(omniauth.provider).uid_for_profile(omniauth)
20
24
  end
@@ -46,7 +46,7 @@ module Mumukit::Login::Provider
46
46
  end
47
47
 
48
48
  def self.parse_login_provider(login_provider)
49
- if enabled_providers.include? login_provider
49
+ if enabled_providers.include?(login_provider.to_s)
50
50
  "Mumukit::Login::Provider::#{login_provider.capitalize}".constantize.new
51
51
  else
52
52
  raise "Unknown login_provider `#{login_provider}`"
@@ -28,9 +28,11 @@ HTML
28
28
  end
29
29
 
30
30
  def footer_html(*)
31
- '<a href="https://auth0.com/" target="_blank">
31
+ '<div class="mu-footer-login-provider">
32
+ <a href="https://auth0.com/" target="_blank">
32
33
  <img height="40" alt="JWT Auth for open source projects" src="//cdn.auth0.com/oss/badges/a0-badge-light.png"/>
33
- </a>'
34
+ </a>
35
+ </div>'
34
36
  end
35
37
 
36
38
  private
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '7.4.1'
3
+ VERSION = '7.6.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: 7.4.1
4
+ version: 7.6.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: 2020-08-31 00:00:00.000000000 Z
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '5.0'
229
+ version: '6.0'
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '5.0'
236
+ version: '6.0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: actionpack
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0'
307
307
  requirements: []
308
- rubygems_version: 3.0.8
308
+ rubygems_version: 3.0.3
309
309
  signing_key:
310
310
  specification_version: 4
311
311
  summary: Library for login mumuki requests