auth_master 0.0.8 → 0.0.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9894b9c1c29ccefc563ef87b5ed898b3131ca386aea808b0e897cb48b7bb594a
|
4
|
+
data.tar.gz: 845ddd2fb57afd4a68e653e618dc0b7721fcbd5ccc25b331ca438706ee6df29a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87aebed6fcf195cf7e1637377baecc7dc256c6e1520612d0782fbf30a8a49c803c81010ae06378cd0e0d5ea2dfe1b09d8c5f0c5a5f0394496960ff40ea166935
|
7
|
+
data.tar.gz: b2629378e04e399cf718af1e91419a370f936b335ff2ed1c082b203a1030575ec263bf737dafd7f306607bedd064f8a619a63d2c71c68ffaa9350d642b05f85a
|
@@ -38,6 +38,13 @@ module AuthMaster::CurrentConcern
|
|
38
38
|
true
|
39
39
|
end
|
40
40
|
|
41
|
+
def auth_master_login_as!(target)
|
42
|
+
auth_master_session = AuthMaster::LoginOperation.call!(target, uuid: auth_master_session_id_generator)
|
43
|
+
session[auth_master_target_session_key(target.class)] = auth_master_session.id
|
44
|
+
|
45
|
+
true
|
46
|
+
end
|
47
|
+
|
41
48
|
def auth_master_logout(target_class)
|
42
49
|
auth_master_session_id = session.delete(auth_master_target_session_key(target_class))
|
43
50
|
AuthMaster::LogoutOperation.call!(auth_master_session_id)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module AuthMaster
|
2
|
+
class LoginOperation < AuthMaster::AbstractOperation
|
3
|
+
def self.call!(target, uuid:)
|
4
|
+
auth_master_session = AuthMaster::SessionService.create!(target, uuid:, force: true)
|
5
|
+
AuthMaster::SessionService.activate!(auth_master_session)
|
6
|
+
|
7
|
+
auth_master_session
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -5,10 +5,9 @@ module AuthMaster
|
|
5
5
|
extend AuthMaster::Config
|
6
6
|
|
7
7
|
class << self
|
8
|
-
def create!(target, uuid:)
|
9
|
-
return
|
10
|
-
|
11
|
-
AuthMaster::Session.create!(target:, id: uuid)
|
8
|
+
def create!(target, uuid:, force: false)
|
9
|
+
# return unless force || allow_creation?(target)
|
10
|
+
AuthMaster::Session.create!(target:, id: uuid) if force || allow_creation?(target)
|
12
11
|
end
|
13
12
|
|
14
13
|
def inactive_find(id)
|
data/lib/auth_master/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auth_master
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vickodin
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- app/operations/auth_master/abstract_operation.rb
|
66
66
|
- app/operations/auth_master/check_link_operation.rb
|
67
67
|
- app/operations/auth_master/login_by_token_operation.rb
|
68
|
+
- app/operations/auth_master/login_operation.rb
|
68
69
|
- app/operations/auth_master/logout_operation.rb
|
69
70
|
- app/operations/auth_master/prepare_token_operation.rb
|
70
71
|
- app/operations/auth_master/send_link_operation.rb
|