rabid 0.0.6 → 0.1.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: a5699f2c4c79f71d44c6e7cd7dc3f89bb424bbcf7069293157ac0555d7270519
4
- data.tar.gz: 7ec606ba5cd1e482edd19d32d519680137c3817197ae64cd67286b586cb8e721
3
+ metadata.gz: d555b0fb7ccdcb1d5267d705b5f71466c6cc42de639a7f688dfbb2a0be3fea0f
4
+ data.tar.gz: 7b3b2d24ead8bd3b7c8eb00cc5e2cfbccb4242744a4d4ee8792c09514909c643
5
5
  SHA512:
6
- metadata.gz: 8b062568f80e4d673e4bf99b20c9366cbd77bb0f1196897fe7d81cf6238a30332a32a63acfd2192ffdcaa2250c08cb02520445daf6065ad6af49a7acd7695f0a
7
- data.tar.gz: 6ddee9719e5e74ca28a7188c5d68c60e44c7783879742fe1089dc7ea72a010b165e3055683f1baf135b9ecb32db4f63293147a1cd02a2f639a475ec5af131743
6
+ metadata.gz: 524c49aa51bd05b7ef980b5232bbb0241b2a3ce8e8f56ab4106c20ad5e180048789d1982e3db16b52a83108b8ecaec82493833f713966224d209fc648d6babee
7
+ data.tar.gz: a72649dfb1744031c757c8460cc126ee372fba351e124e93c56d6b3529c077369531060b6921ceae3a3b74ef619d8ce22ddc5fa0d3759ef0190aced862f9143b
data/bin/rabid CHANGED
@@ -47,10 +47,10 @@ begin
47
47
  if args['--short']
48
48
  puts Paint[bip.decoded_cookie, :green]
49
49
  else
50
- puts Paint['Pool name:', :white, :bold] + ' ' + bip.pool_name
51
- puts Paint['Cookie type:', :white, :bold] + ' ' + bip.cookie_type
52
- puts Paint['Raw cookie:', :white, :bold] + ' ' + bip.raw_cookie
53
- puts Paint['Decoded cookie:', :white, :bold] + ' ' + Paint[bip.decoded_cookie, :green]
50
+ puts "#{Paint['Pool name:', :white, :bold]} #{bip.pool_name}"
51
+ puts "#{Paint['Cookie type:', :white, :bold]} #{bip.cookie_type}"
52
+ puts "#{Paint['Raw cookie:', :white, :bold]} #{bip.raw_cookie}"
53
+ puts "#{Paint['Decoded cookie:', :white, :bold]} #{Paint[bip.decoded_cookie, :green]}"
54
54
  end
55
55
  end
56
56
  # use case 2, help: already handled by docopt
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Version
4
- VERSION = '0.0.6'
4
+ VERSION = '0.1.0'
5
5
  end
data/lib/bigipcookie.rb CHANGED
@@ -51,25 +51,25 @@ class BigIPCookie
51
51
  # @!visibility public
52
52
  # @param ip [String] the encoded IP address
53
53
  # @param opts [Hash] options for the decoding process (only
54
- # :ipv6compression should be used, others are for developers)
55
- # @option opts [Integer] :default default behavior, default value is 1, if
56
- # value is set to 0 it disables :ip2hex and :reverse
57
- # @option opts [Integer] :ipversion 4 for IPv4 and 6 for IPv6, default is 4,
58
- # 4 set :joinchar to '.' and :scanby to 2, 6 set :joinchar to ':' and
59
- # :scanby to 6
54
+ # `:ipv6compression` should be used, others are for developers)
55
+ # @option opts [Integer] :default default behavior, default value is `1`, if
56
+ # value is set to `0` it disables `:ip2hex` and `:reverse`
57
+ # @option opts [Integer] :ipversion `4` for IPv4 and `6` for IPv6, default is `4`,
58
+ # `4` sets `:joinchar` to `.` and `:scanby` to `2`, `6` sets `:joinchar` to `:` and
59
+ # `:scanby` to `6`
60
60
  # @option opts [Integer] :ip2hex encode IP address groups into hexadecimal,
61
- # default is 1, set to 0 disable
61
+ # default is `1`, set to `0` disable
62
62
  # @option opts [Integer] :joinchar the character used to join the IP
63
- # address groups, default is '.' (IPv4), for example it can be set to
64
- # ':' for IPv6
63
+ # address groups, default is `.` (IPv4), for example it can be set to
64
+ # `:` for IPv6
65
65
  # @option opts [Integer] :hex2ip decode hexadecimal IP address groups to
66
- # decimal, default is 1, set 0 to disable
67
- # @option opts [Integer] :reverse reverse the IP address groups if set to 1,
68
- # default is 1
69
- # @option opts [Integer] :ipv6compression compress IPv6 address if set to 1,
70
- # default is 1
66
+ # decimal, default is `1`, set `0` to disable
67
+ # @option opts [Integer] :reverse reverse the IP address groups if set to `1`,
68
+ # default is `1`
69
+ # @option opts [Integer] :ipv6compression compress IPv6 address if set to `1`,
70
+ # default is `1`
71
71
  # @option opts [Integer] :scanby parse the raw cookie value by n to find IP
72
- # address groups, default is 2 for IPv4 and 4 for IPv6
72
+ # address groups, default is `2` for IPv4 and `4` for IPv6
73
73
  # @return [String] the decoded IP address
74
74
  def decode_ip(ip, opts = {})
75
75
  opts[:default] ||= 1
@@ -95,7 +95,7 @@ class BigIPCookie
95
95
  end
96
96
 
97
97
  ip = format('%02x', ip) if opts[:ip2hex] == 1 # ip to hex
98
- ip = '0' + ip if ip.size.odd? # prepend a 0 when we have an odd number
98
+ ip = "0#{ip}" if ip.size.odd? # prepend a 0 when we have an odd number
99
99
  ip = ip.scan(/.{#{opts[:scanby]}}/) # split by n
100
100
  ip.reverse! if opts[:reverse] == 1 # reverse array
101
101
  ip = ip.map { |i| i.to_i(16) } if opts[:hex2ip] == 1 # hex to ip
@@ -167,7 +167,7 @@ class BigIPCookie
167
167
  end
168
168
 
169
169
  # Return that the cookie is encrypted
170
- # @param cookie [String] raw cookie value
170
+ # @param _cookie [String] raw cookie value
171
171
  # @return [String] Encrypted cookie detection message
172
172
  def encrypted(_cookie)
173
173
  return 'Unknown:Encrypted'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre ZANNI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -38,118 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.2'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.1'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '2.1'
55
- - !ruby/object:Gem::Dependency
56
- name: commonmarker
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.21'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '0.21'
69
- - !ruby/object:Gem::Dependency
70
- name: github-markup
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
83
- - !ruby/object:Gem::Dependency
84
- name: minitest
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '5.11'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '5.11'
97
- - !ruby/object:Gem::Dependency
98
- name: rake
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '13.0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '13.0'
111
- - !ruby/object:Gem::Dependency
112
- name: redcarpet
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '3.4'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '3.4'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '0.80'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '0.80'
139
- - !ruby/object:Gem::Dependency
140
- name: yard
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '0.9'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '0.9'
153
41
  description: A library and CLI tool allowing to decode all 4 types of BigIP cookies
154
42
  email: alexandre.zanni@engineer.com
155
43
  executables:
@@ -173,22 +61,26 @@ metadata:
173
61
  documentation_uri: https://noraj.github.io/rabid/
174
62
  homepage_uri: https://noraj.github.io/rabid/
175
63
  source_code_uri: https://github.com/noraj/rabid/
64
+ rubygems_mfa_required: 'true'
176
65
  post_install_message:
177
66
  rdoc_options: []
178
67
  require_paths:
179
68
  - lib
180
69
  required_ruby_version: !ruby/object:Gem::Requirement
181
70
  requirements:
182
- - - "~>"
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 2.7.0
74
+ - - "<"
183
75
  - !ruby/object:Gem::Version
184
- version: '2.7'
76
+ version: '3.2'
185
77
  required_rubygems_version: !ruby/object:Gem::Requirement
186
78
  requirements:
187
79
  - - ">="
188
80
  - !ruby/object:Gem::Version
189
81
  version: '0'
190
82
  requirements: []
191
- rubygems_version: 3.1.2
83
+ rubygems_version: 3.3.3
192
84
  signing_key:
193
85
  specification_version: 4
194
86
  summary: RApid Big IP Decoder