me_api 0.1.0 → 0.2.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: b9afe2c82fd72bb3e60063f02340b76043be91a6a34555898c395a3bf2a1f1e7
4
- data.tar.gz: c9d570dc074b6532b46a31b9dba8933ee2b756a4b324f29702ee25fff5ee4dde
3
+ metadata.gz: 67c2a24b15eba71d0dfe8d4de7eb2d25c7aa146086a414144b93c6ec5d07116f
4
+ data.tar.gz: 03bf93a966a34eea59c5875f58b53035be188293a759cacbaa3c54fb36709398
5
5
  SHA512:
6
- metadata.gz: c04837ce04ec53380f1ce33f356b130d20154c31a736c4f7ea2f2ff459190e19dc739a3da8d1d7de4de87e000b66eced6f68483bdcf70c17628d7cf69f2cfc70
7
- data.tar.gz: a446288738dc28914ba01fbf74b37f5f716fcddf724e97491d77d303faaabb307da30d589b49e0a7a5189ddeb5905cba6944b3f2db5118eb3347ce245cb78c47
6
+ metadata.gz: 4e9565f11abd57cbf516a4cf9c95faeb7eb7c9384cd1cdf62b6a6ca66626b42c469b19f4e36cb7d085da11284221482a1b9ed6ee36c8fb03d00bace41d0c1e95
7
+ data.tar.gz: 571e6becbe3e7b65dcfdd1f5b6d707d7e899c7242ccd230c278d5de7b78820f9711912281de5961deada347ec9998880bb7e4fe975bcda4d5d01ea00ca6b91ef
data/lib/me_api/client.rb CHANGED
@@ -46,7 +46,7 @@ module MeApi
46
46
  end
47
47
  end
48
48
 
49
- def refresh_token(client_id:, client_secret:, refresh_token:)
49
+ def self.refresh_token(client_id:, client_secret:, refresh_token:)
50
50
  body = {
51
51
  grant_type: "refresh_token",
52
52
  client_id: client_id,
@@ -56,5 +56,16 @@ module MeApi
56
56
  response = post "/oauth/token", body: JSON.dump(body), headers: { "Content-Type": "application/json" }
57
57
  end
58
58
 
59
+ def self.authorize client_id:, client_secret:, code:, redirect_url:
60
+ body = {
61
+ grant_type: "authorization_code",
62
+ client_id: client_id,
63
+ client_secret: client_secret,
64
+ code: code,
65
+ redirect_uri: redirect_url
66
+ }
67
+ response = post "/oauth/token", body: JSON.dump(body), headers: { "Content-Type": "application/json" }
68
+ end
69
+
59
70
  end
60
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeApi
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: me_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses-bull
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-03 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ac