virtuatable-core 1.6.0.dev1 → 1.6.0.dev5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/core/decorators/authorization.rb +9 -0
- data/lib/core/decorators.rb +1 -0
- data/lib/core/services/authorizations.rb +11 -1
- data/lib/core/services/sessions.rb +1 -0
- data/lib/core/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c37ed6a8ec0a2a23b4ad7eecd2e875c102e30dd245607b949161d757335917b2
|
4
|
+
data.tar.gz: 3ac1143c4174f372cc91c34399340742923a11132cfdff914f301993905682fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 981c8f5f7d41113ed22fe44a5187813d781a9ce5c75be0bcfaa5f2078f16958212b8064c982104ca55adff9e9c2c70e7cb407ebb45094ced051f1ea0a08154a6
|
7
|
+
data.tar.gz: 212dd8eac364a4e113c0da59b13125962c2da476f8e84b5112dfa53493ab4e9349a6d6ad3c77dc0d51c3a870aaf1c39eeef558fe91292cef3d00c68ab45b7c04
|
data/lib/core/decorators.rb
CHANGED
@@ -2,6 +2,7 @@ module Core
|
|
2
2
|
module Decorators
|
3
3
|
autoload :Account, 'core/decorators/account'
|
4
4
|
autoload :Application, 'core/decorators/application'
|
5
|
+
autoload :Authorization, 'core/decorators/authorization'
|
5
6
|
autoload :Base, 'core/decorators/base'
|
6
7
|
autoload :Campaign, 'core/decorators/campaign'
|
7
8
|
autoload :Session, 'core/decorators/session'
|
@@ -8,6 +8,16 @@ module Core
|
|
8
8
|
class Authorizations < Core::Services::Base
|
9
9
|
include Singleton
|
10
10
|
|
11
|
+
def create_from_session(session_id: nil, client_id: nil, **ignored)
|
12
|
+
session = Core.svc.sessions.get_by_id(session_id: session_id)
|
13
|
+
application = Core.svc.applications.get_by_id(client_id: client_id)
|
14
|
+
authorization = Core::Models::OAuth::Authorization.create(
|
15
|
+
account: session.account,
|
16
|
+
application: application
|
17
|
+
)
|
18
|
+
Core::Decorators::Authorization.new(authorization)
|
19
|
+
end
|
20
|
+
|
11
21
|
# Gets the authorization code corresponding to the provided value if it is linked to the
|
12
22
|
# application matching the provided credentials. Otherwise it raises errors.
|
13
23
|
#
|
@@ -42,7 +52,7 @@ module Core
|
|
42
52
|
authorization = Core::Models::OAuth::Authorization.find_by(code: authorization_code)
|
43
53
|
raise unknown_err(field: 'authorization_code') if authorization.nil?
|
44
54
|
|
45
|
-
authorization
|
55
|
+
Core::Decorators::Authorization.new(authorization)
|
46
56
|
end
|
47
57
|
|
48
58
|
private
|
data/lib/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtuatable-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.0.
|
4
|
+
version: 1.6.0.dev5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
@@ -280,16 +280,16 @@ dependencies:
|
|
280
280
|
name: draper
|
281
281
|
requirement: !ruby/object:Gem::Requirement
|
282
282
|
requirements:
|
283
|
-
- -
|
283
|
+
- - '='
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version:
|
285
|
+
version: 4.0.2
|
286
286
|
type: :runtime
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
|
-
- -
|
290
|
+
- - '='
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version:
|
292
|
+
version: 4.0.2
|
293
293
|
description: This gem holds the model layer for my table-top RPG games application.
|
294
294
|
email: courtois.vincent@outlook.com
|
295
295
|
executables: []
|
@@ -302,6 +302,7 @@ files:
|
|
302
302
|
- lib/core/decorators.rb
|
303
303
|
- lib/core/decorators/account.rb
|
304
304
|
- lib/core/decorators/application.rb
|
305
|
+
- lib/core/decorators/authorization.rb
|
305
306
|
- lib/core/decorators/base.rb
|
306
307
|
- lib/core/decorators/campaign.rb
|
307
308
|
- lib/core/decorators/session.rb
|