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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed2fb554bca98c5a51745c7872a81eafd22c8c741ea1025f8757313182f5ba07
4
- data.tar.gz: a13f5931693e5a41f21c6aafe664c8ad37e0709ce716f3bb16b01fa45f0f5705
3
+ metadata.gz: c37ed6a8ec0a2a23b4ad7eecd2e875c102e30dd245607b949161d757335917b2
4
+ data.tar.gz: 3ac1143c4174f372cc91c34399340742923a11132cfdff914f301993905682fe
5
5
  SHA512:
6
- metadata.gz: d404bb036b5f7f96ba6b15ac350d3f67c1e409d1be876ab54c8fff997ba1f18994a014cdfdd96e6ced3fe302fd9d77a8ba4964d809944f42812752b13721da8e
7
- data.tar.gz: d8a5ef0902184dbbe8c63b908acddad0bbdcf6e9480d44a8c48ce977db627b7083136a3c803e4aba9b83ecda7e54c8bb4c589e4bb922712ea7d7fae85112926e
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Core
4
- VERSION = '1.6.0.dev4'
4
+ VERSION = '1.6.0.dev5'
5
5
  end
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.dev4
4
+ version: 1.6.0.dev5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois