authkeeper 0.1.26 → 0.1.27

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: a299b6ba8215f0f45740988570057aace8f727572f647868af2a7e33cd288021
4
- data.tar.gz: 69a089fda3bc8a4aa1d8a7d252f745f23fd6a3438804b06095975fec4c5c8a83
3
+ metadata.gz: 1c981b3075aeced7e41843c2852062ecf833c5a69127fba8da05b1549f5d6ee6
4
+ data.tar.gz: 334ae38ee8a79c73fed3720b806766a4a80ae357ecc25de93850e6a188347a3f
5
5
  SHA512:
6
- metadata.gz: 36903b7238ae02388a8754192bf3b33cc019ec7c7cc1661299a4bac743710a4fa18562fc4ba27231ce09486d149173c383f7f89b895fdc9e640cc43754abc014
7
- data.tar.gz: c627570972ad3a5110797aa585b64f9f65abb06c69208d751ecbe5481908e9b42aba08e92fb5975d0e4115f953bc0981afe340fb6a5d9eda21a78ddf37d32c9c
6
+ metadata.gz: c9d3e4bab82988534791b0b1282f5796165c8463e29a501e0c8814567959d982fad7e25dd51278eaadf02d70bb6624521a8d60cee5e172220b5c835824415027
7
+ data.tar.gz: 5da53e12d7de94973829113487c4dd0357e01449725f13e02a1f8a57ae2901e74b82f01323f77be6b2a511fbe2df260e7fde5937de4ff555104c4f5c9e1016dc
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Authkeeper
4
+ module AvitoAuthApi
5
+ class Client < Authkeeper::HttpService::Client
6
+ include Requests::AccessToken
7
+
8
+ BASE_URL = 'https://api.avito.ru/'
9
+
10
+ option :url, default: proc { BASE_URL }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Authkeeper
4
+ module AvitoAuthApi
5
+ module Requests
6
+ module AccessToken
7
+ def fetch_access_token(client_id:, client_secret:, code:, return_raw_response: false)
8
+ form_post(
9
+ path: 'token',
10
+ body: {
11
+ grant_type: 'authorization_code',
12
+ client_id: client_id,
13
+ client_secret: client_secret,
14
+ code: code
15
+ },
16
+ headers: {
17
+ 'Content-Type' => 'application/x-www-form-urlencoded'
18
+ },
19
+ return_raw_response: return_raw_response
20
+ )
21
+ end
22
+
23
+ def refresh_access_token(client_id:, client_secret:, refresh_token:, return_raw_response: false)
24
+ form_post(
25
+ path: 'token',
26
+ body: {
27
+ grant_type: 'refresh_token',
28
+ client_id: client_id,
29
+ client_secret: client_secret,
30
+ refresh_token: refresh_token
31
+ },
32
+ headers: {
33
+ 'Content-Type' => 'application/x-www-form-urlencoded'
34
+ },
35
+ return_raw_response: return_raw_response
36
+ )
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -29,6 +29,7 @@ module Authkeeper
29
29
  register('api.yandex.client') { Authkeeper::YandexApi::Client.new }
30
30
  register('api.vk.auth_client') { Authkeeper::VkAuthApi::Client.new }
31
31
  register('api.vk.ads_auth_client') { Authkeeper::VkAdsAuthApi::Client.new }
32
+ register('api.avito.auth_client') { Authkeeper::AvitoAuthApi::Client.new }
32
33
 
33
34
  register('services.providers.github') { Authkeeper::Providers::Github.new }
34
35
  register('services.providers.gitlab') { Authkeeper::Providers::Gitlab.new }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Authkeeper
4
- VERSION = '0.1.26'
4
+ VERSION = '0.1.27'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdanov Anton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-12 00:00:00.000000000 Z
11
+ date: 2026-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,6 +38,8 @@ files:
38
38
  - app/controllers/authkeeper/omniauth_callbacks_controller.rb
39
39
  - app/helpers/authkeeper/application_helper.rb
40
40
  - app/jobs/authkeeper/application_job.rb
41
+ - app/lib/authkeeper/avito_auth_api/client.rb
42
+ - app/lib/authkeeper/avito_auth_api/requests/access_token.rb
41
43
  - app/lib/authkeeper/discord_api/client.rb
42
44
  - app/lib/authkeeper/discord_api/requests/user.rb
43
45
  - app/lib/authkeeper/discord_auth_api/client.rb