jwtear 1.0.4 → 1.0.5

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: 9f4306c408c344ff505486b1de0bcf06eab68487544aca06e23db8690526753e
4
- data.tar.gz: ca5d778092da238f609b1c75548f3b6900e8c34af2f30e9e6ccb2c02edc7aee5
3
+ metadata.gz: 4e325882534b86402268e985372b35209081c98c9c4bf7f23534c7fa098388f5
4
+ data.tar.gz: cb11ceb477305198e61b56d6806df69760845cc6f12b05c1dac4f29b2a8dbb26
5
5
  SHA512:
6
- metadata.gz: 5204340947b54c8cdf508d65b6d4b05721fc2cefeccc391f5426df5c42a3fdeb434783ece146f170083395bafffbdc59c9c2297642aa16e8d3ae66a00297259f
7
- data.tar.gz: d82526cef2d9b787c49d4985b97f1cfcc6ec70646b1c913aeb1bc231e7ab4f7b1a6e5217294385f12c5a7f98d7784008ce42a3c90f7f4cae32361a10886d82d3
6
+ metadata.gz: a582c094d9cc6e632ef1097a9f6ea12cc441ebffd09ecbeb9be751e9e3382059a1e3546cb028defad7606336ec508f1a2441e16433a1e977e64dcfd1c1abf89d
7
+ data.tar.gz: edee73199d6fb13e1e0be565d6a1bac562c284258615de55f6c570379d2a42b17f41053f44725e4e38169b71f23a277eb25f66318553577008b1de091438f197
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jwtear (1.0.3)
4
+ jwtear (1.0.4)
5
5
  colorize (~> 0.8.1)
6
6
  gli (~> 2.19, >= 2.19.0)
7
7
  json-jwt (~> 1.10, >= 1.10.2)
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency 'gli', '~> 2.19', '>= 2.19.0'
22
- spec.add_dependency 'json-jwt', '~> 1.10', '>= 1.10.2'
22
+ spec.add_dependency 'json-jwt', '~> 1.11', '>= 1.11.0'
23
23
  spec.add_dependency 'jwe', "~> 0.4.0"
24
24
  spec.add_dependency 'tty-markdown', "~> 0.6.0"
25
25
  spec.add_dependency 'tty-pager', "~> 0.12.1"
@@ -27,18 +27,18 @@ module JWTear
27
27
  # check_dependencies
28
28
  # check dependencies for plugins and throw a gentle error if not installed
29
29
  # @param deps [Hash]
30
- # The key is the library to be require, the key is the gem to be required
30
+ # The key is the key is the gem name to be installed, the value is library to be require
31
31
  # @example
32
32
  # deps = {'async-io' => 'async/ip'}
33
33
  # check_dependencies(deps)
34
34
  #
35
35
  def check_dependencies(deps={})
36
- return if deps.empty?
36
+ return if deps.empty? or deps.nil?
37
37
  missing = []
38
38
 
39
- deps.each do |gem, req|
39
+ deps.each do |gem, lib|
40
40
  begin
41
- require req
41
+ require lib
42
42
  rescue LoadError
43
43
  missing << gem
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module JWTear
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -33,7 +33,7 @@ module JWTear
33
33
  include JWTear::Helpers::Utils
34
34
 
35
35
  def initialize(token, list)
36
- deps = {'async-io' => 'async/io'}
36
+ deps = {}
37
37
  check_dependencies(deps)
38
38
  @token = Token.new
39
39
  @jws = @token.parse(token)
@@ -48,7 +48,7 @@ module JWTear
48
48
  key.valid_encoding? ? key.strip! : next
49
49
  print_status "Trying password: #{key}" if verbose
50
50
 
51
- gen_token = @token.generate(:jws, header: @jws.header.to_json, payload:@jws.payload.to_json , key: key)
51
+ gen_token = @token.generate(:jws, header: @jws.header.to_json, payload: @jws.payload.to_json , key: key)
52
52
  sig = gen_token.split('.').last
53
53
  if sig == Base64.urlsafe_encode64(@jws.signature, padding: false)
54
54
  print_good "Password found: #{key}"
@@ -59,7 +59,7 @@ module JWTear
59
59
  end
60
60
  end
61
61
  when keys.kind_of?(String)
62
- gen_token = @token.generate(:jws, header: @jws.header.to_json, payload:@jws.payload.to_json , key: keys)
62
+ gen_token = @token.generate(:jws, header: @jws.header.to_json, payload: @jws.payload.to_json , key: keys)
63
63
  sig = gen_token.split('.').last
64
64
  if sig == Base64.urlsafe_encode64(@jws.signature, padding: false)
65
65
  print_good "Password found: #{keys}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jwtear
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - KING SABRI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-08 00:00:00.000000000 Z
11
+ date: 2020-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -36,20 +36,20 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.10'
39
+ version: '1.11'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.10.2
42
+ version: 1.11.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '1.10'
49
+ version: '1.11'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.10.2
52
+ version: 1.11.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: jwe
55
55
  requirement: !ruby/object:Gem::Requirement