krn-auth-ruby 0.1.1 → 0.1.2

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: 4e84a8b2ec1de745c4d35d625f6878511e383575799300858e7cac66cc693232
4
- data.tar.gz: 5e83a94404c6aceb478e449a03d0c1949057add70103a2aef8b1b4dd44c547fc
3
+ metadata.gz: 11a2bb64b4a8b8d75cb6c1ba6e93fb55386bd34aad629f46b92a34f13af8f8b6
4
+ data.tar.gz: f9bbabd9dff4ad72dd11bff5910368d0a2ff2163c8428ca65fb80c731c83ae8c
5
5
  SHA512:
6
- metadata.gz: 82ed6548586c3c2882c2b171738bd6f4be931bd012091060f182b4a1675e32890d2a0948e84460b57e599c044f949eddbb92d508fab5ffadc314daeb751c46dc
7
- data.tar.gz: c2f91eb7fbd1e29df9baf5a5ee91dcf1f6e59089cb134bfa150a38da2f5a21dbe098cc64b777230755d1d685a132f7f9cb698cdbf67cc2987bc7a6cf4c76ba62
6
+ metadata.gz: 7732d84731a9941e95f7f5ca9e7835b5f3299860bea3fad44a2b4c30934f86e1db92886e9008ba33acdd8c53074634d818b6e3a1390d0263f414c42408894345
7
+ data.tar.gz: 8594f47bb54299299629cc550aa80ae7e95f04563a8fa55d0e5e0c86e316b2ce9f1edbe9b53d6409f92076d97d9b76daf220db707d48ccc0e9a38b7cab7ce720
data/lib/krn/auth.rb CHANGED
@@ -32,36 +32,13 @@ module Krn
32
32
  end
33
33
 
34
34
  def deep_validate(passport: '')
35
- gqlquery = "mutation doRenew($passport: String!) {
36
- renew(passport: $passport) {
37
- Message
38
- Renewed
39
- PassPort
40
- Expires
41
- Error
42
- DecodedToken {
43
- Email,
44
- ID,
45
- IntID,
46
- NickName
47
- }
48
- }
49
- }"
50
- query = {
51
- operationName: 'doRenew',
52
- query: gqlquery,
53
- variables: {
54
- passport: passport
55
- }
56
- }
57
- uri = URI("#{trinity_url}/graphql")
35
+ uri = URI("#{trinity_url}/deep-validate?token=#{passport}")
58
36
  http = Net::HTTP.new(uri.host, uri.port)
59
37
  http.use_ssl = true
60
38
  req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')
61
- req.body = query.to_json
62
39
  res = http.request(req)
63
- JSON.parse(res.body)['data']['renew']['DecodedToken']
64
- rescue StandardError => e
40
+ JSON.parse(res.body)
41
+ rescue StandardError
65
42
  false
66
43
  end
67
44
 
@@ -1,3 +1,3 @@
1
1
  module Krn
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: krn-auth-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Helmut Januschka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt