accounts_client 0.3.2 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/api_key.rb +25 -0
- data/app/models/padma_account.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a517c199605463067295a72e921f52fedbacf9502b41c2ad60267a16519a9c5
|
4
|
+
data.tar.gz: a142bec102da14d24a5d630c889129df6db81e6d7b180bc69ac9da4039575253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 031f48a48df81cb4123a7e2ed613d896d258c1d321b55d4da4365ca146a297919cff9772d54f96bd287dbaf71a8d7e40e4b718447d81ea53d5c992512395cdd6
|
7
|
+
data.tar.gz: ad1319e00b006f532e7c7de33e25fda1f0c16790fda7fd7abf1650cf5318f1ff290b52c1312d485778d7ecc6623c3863357dc9a76212bf439073c30b56fae7f5
|
data/app/models/api_key.rb
CHANGED
@@ -13,6 +13,31 @@ class ApiKey < LogicalModel
|
|
13
13
|
TIMEOUT = 5500 # milisecons
|
14
14
|
PER_PAGE = 9999
|
15
15
|
|
16
|
+
def self.find(id, params={})
|
17
|
+
Rails.logger.warn "ApiKey.find is deprecated. Use ApiKey.check instead"
|
18
|
+
self.check(id, params)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.check(key, params={})
|
22
|
+
res = nil
|
23
|
+
params = self.merge_key(params).merge({api_key: key})
|
24
|
+
request = Typhoeus::Request.new("#{resource_uri}/check", params: params )
|
25
|
+
|
26
|
+
request.on_complete do |response|
|
27
|
+
if response.code >= 200 && response.code < 400
|
28
|
+
log_ok(response)
|
29
|
+
res = self.new.from_json(response.body)
|
30
|
+
else
|
31
|
+
log_failed(response)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
self.hydra.queue(request)
|
36
|
+
self.hydra.run
|
37
|
+
|
38
|
+
res
|
39
|
+
end
|
40
|
+
|
16
41
|
def json_root
|
17
42
|
'api_key'
|
18
43
|
end
|
data/app/models/padma_account.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accounts_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dwayne Macgowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|