virtuatable-core 1.6.0.dev4 → 1.6.0.dev5
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 +4 -4
- data/lib/core/services/authorizations.rb +10 -0
- data/lib/core/version.rb +1 -1
- metadata +1 -1
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
|
@@ -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
|
#
|
data/lib/core/version.rb
CHANGED