mumukit-login 7.5.1 → 7.7.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: 3a95d56b4cc110db3523c300dff728870eb3162a2b8858485c671e2873414d0b
4
- data.tar.gz: 64b9bd27fc00bc777d96e5770562b4e681f6e3fc5bf9f43cf468c00e7c29d56a
3
+ metadata.gz: a5f395ab9f8be2d3b5ab22e1969cd37395fad3aa33e3c153c0da2a2bac776741
4
+ data.tar.gz: 07fd22f1023d3059dc5849615139b7623f13b7030b2dfc422257cc28f283c63c
5
5
  SHA512:
6
- metadata.gz: abfe621993259bcd46e2d58413e4a0054811d51cb9daf76cbf1c0f2d0aa4b02627ad294b8be2c206bcc6b583105690d43b907bdedc3004d75bb45bab20a35e73
7
- data.tar.gz: 5e9cadd3e38079d53ee2b264de9a27539afb46326fa34adb4ad6f5cec835ff7d26332721a0d5b3fae9b1284416b03f4f3ddc5d3f4edc8bc440103bee41bbb729
6
+ metadata.gz: 732e40f632086af5ad495ae2eccb9d2f4170b1914301053812af513a3483960878f26fe586439d46e8fc78f558afa75f714dad3d4c9b0e4dacb0082ad89c50db
7
+ data.tar.gz: 763e7ac95f0be2f0fceb942b1d3be5ef54e587d3c7a048c72b295c879b619bcc45d43bcda35bf78771051d324540dc3599a297c1d76b3f86026e4388edfe4152
@@ -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
@@ -1,4 +1,5 @@
1
1
  module Mumukit::Login::LoginControllerHelpers
2
+ delegate :redirect_after_logout!, to: :origin_redirector
2
3
 
3
4
  def login_current_user!
4
5
  mumukit_controller.mucookie.write!(:login_organization, organization_name)
@@ -19,8 +20,7 @@ module Mumukit::Login::LoginControllerHelpers
19
20
 
20
21
  def logout_current_user!
21
22
  destroy_current_user_session!
22
- login_provider.destroy_session! mumukit_controller
23
- origin_redirector.redirect_after_logout!
23
+ login_provider.logout_current_user! self
24
24
  end
25
25
 
26
26
  private
@@ -17,9 +17,7 @@ class Mumukit::Login::OriginRedirector
17
17
  @controller.session[:redirect_after_login] = origin
18
18
  end
19
19
 
20
- private
21
-
22
20
  def origin
23
21
  Addressable::URI.heuristic_parse(@controller.request.params['origin'] || '/').to_s
24
22
  end
25
- end
23
+ end
@@ -45,7 +45,8 @@ class Mumukit::Login::Provider::Base
45
45
  nil
46
46
  end
47
47
 
48
- def destroy_session!(_controller)
48
+ def logout_current_user!(controller)
49
+ controller.redirect_after_logout!
49
50
  end
50
51
 
51
52
  def setup_proc
@@ -29,6 +29,15 @@ module OmniAuth
29
29
  result
30
30
  end
31
31
  end
32
+
33
+ def service_validate_url(service_url, ticket)
34
+ service_url = Addressable::URI.parse(service_url)
35
+ service_url.query_values = service_url.query_values.tap { |qs| qs.delete('ticket') }
36
+ cas_url + append_params(options.service_validate_url, {
37
+ service: service_url.to_s.sub(/\?$/, ''),
38
+ ticket: ticket
39
+ })
40
+ end
32
41
  end
33
42
  end
34
43
  end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '7.5.1'
3
+ VERSION = '7.7.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.5.1
4
+ version: 7.7.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-12-13 00:00:00.000000000 Z
11
+ date: 2021-08-19 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: '6.0'
229
+ version: '7.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: '6.0'
236
+ version: '7.0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: actionpack
239
239
  requirement: !ruby/object:Gem::Requirement