rabid 0.0.1
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 +7 -0
- data/.gitignore +7 -0
- data/.rubocop.yml +22 -0
- data/.yardopts +4 -0
- data/.yardopts-dev +6 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +56 -0
- data/LICENSE.txt +21 -0
- data/README.md +15 -0
- data/Rakefile +10 -0
- data/bigipcookie.gemspec +49 -0
- data/bin/rabid +67 -0
- data/bin/rabid_console +7 -0
- data/bin/rabid_setup +6 -0
- data/docs/.nojekyll +0 -0
- data/docs/About.md +11 -0
- data/docs/CHANGELOG.md +1 -0
- data/docs/README.md +13 -0
- data/docs/_coverpage.md +14 -0
- data/docs/_media/logo.png +0 -0
- data/docs/_navbar.md +2 -0
- data/docs/_sidebar.md +15 -0
- data/docs/index.html +31 -0
- data/docs/pages/demo.md +3 -0
- data/docs/pages/documentation.md +34 -0
- data/docs/pages/install.md +60 -0
- data/docs/pages/publishing.md +38 -0
- data/docs/pages/quick-start.md +30 -0
- data/docs/pages/usage.md +53 -0
- data/docs/vendor/docsify.js +1 -0
- data/docs/vendor/plugins/emoji.min.js +1 -0
- data/docs/vendor/plugins/search.min.js +1 -0
- data/docs/vendor/prismjs/components/prism-ruby.min.js +1 -0
- data/docs/vendor/themes/vue.css +1 -0
- data/docs/why.md +46 -0
- data/docs/yard/BigIPCookie/Decode.html +782 -0
- data/docs/yard/BigIPCookie.html +159 -0
- data/docs/yard/Version.html +126 -0
- data/docs/yard/_index.html +138 -0
- data/docs/yard/class_list.html +51 -0
- data/docs/yard/css/common.css +1 -0
- data/docs/yard/css/full_list.css +58 -0
- data/docs/yard/css/style.css +496 -0
- data/docs/yard/file.LICENSE.html +70 -0
- data/docs/yard/file.README.html +109 -0
- data/docs/yard/file_list.html +61 -0
- data/docs/yard/frames.html +17 -0
- data/docs/yard/index.html +109 -0
- data/docs/yard/js/app.js +303 -0
- data/docs/yard/js/full_list.js +216 -0
- data/docs/yard/js/jquery.js +4 -0
- data/docs/yard/method_list.html +99 -0
- data/docs/yard/top-level-namespace.html +112 -0
- data/lib/bigipcookie/version.rb +5 -0
- data/lib/bigipcookie.rb +246 -0
- data/package-lock.json +154 -0
- data/test/test_bigipcookie.rb +54 -0
- metadata +248 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 98987fe496586fce7a2692ffa657b10bab969977ca1ff1cf4db5eac89d13ddc4
|
|
4
|
+
data.tar.gz: a3a8430704ea8b58e39a5fbe5f7b10371030261039e5f2874ce0f3104035d3d2
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5c74ef56c2317560de1f2ebc0432393ee04eacc4a40ed7d2ad02bf47496386950e75b62ecce05fb1e2f635f3c95b795deeebf45cd3d6d094566a13e6199a55be
|
|
7
|
+
data.tar.gz: 62f44f2cfc9b1789dcf2dd82c8c5a9c8db302fb5b5a171f39376ab851b3f115844262799d908254633463b8d0647417f86de7204d6e9dd8dc7d6aaf05e46903c
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Metrics
|
|
2
|
+
AllCops:
|
|
3
|
+
TargetRubyVersion: 2.4
|
|
4
|
+
|
|
5
|
+
Layout/AlignHash:
|
|
6
|
+
Include:
|
|
7
|
+
- 'lib/**/*.rb'
|
|
8
|
+
Metrics/AbcSize:
|
|
9
|
+
Enabled: false
|
|
10
|
+
Metrics/ClassLength:
|
|
11
|
+
Max: 200
|
|
12
|
+
Metrics/CyclomaticComplexity:
|
|
13
|
+
Enabled: false
|
|
14
|
+
Metrics/LineLength:
|
|
15
|
+
Include:
|
|
16
|
+
- 'lib/**/*.rb'
|
|
17
|
+
Metrics/MethodLength:
|
|
18
|
+
Max: 25
|
|
19
|
+
Metrics/PerceivedComplexity:
|
|
20
|
+
Max: 10
|
|
21
|
+
Style/RedundantReturn:
|
|
22
|
+
Enabled: false
|
data/.yardopts
ADDED
data/.yardopts-dev
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
rabid (0.0.1)
|
|
5
|
+
docopt (~> 0.6)
|
|
6
|
+
paint (~> 2.1)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
ast (2.4.0)
|
|
12
|
+
commonmarker (0.20.1)
|
|
13
|
+
ruby-enum (~> 0.5)
|
|
14
|
+
concurrent-ruby (1.1.5)
|
|
15
|
+
docopt (0.6.1)
|
|
16
|
+
github-markup (3.0.4)
|
|
17
|
+
i18n (1.6.0)
|
|
18
|
+
concurrent-ruby (~> 1.0)
|
|
19
|
+
jaro_winkler (1.5.3)
|
|
20
|
+
minitest (5.11.3)
|
|
21
|
+
paint (2.1.0)
|
|
22
|
+
parallel (1.17.0)
|
|
23
|
+
parser (2.6.3.0)
|
|
24
|
+
ast (~> 2.4.0)
|
|
25
|
+
rainbow (3.0.0)
|
|
26
|
+
rake (12.3.2)
|
|
27
|
+
redcarpet (3.4.0)
|
|
28
|
+
rubocop (0.73.0)
|
|
29
|
+
jaro_winkler (~> 1.5.1)
|
|
30
|
+
parallel (~> 1.10)
|
|
31
|
+
parser (>= 2.6)
|
|
32
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
33
|
+
ruby-progressbar (~> 1.7)
|
|
34
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
|
35
|
+
ruby-enum (0.7.2)
|
|
36
|
+
i18n
|
|
37
|
+
ruby-progressbar (1.10.1)
|
|
38
|
+
unicode-display_width (1.6.0)
|
|
39
|
+
yard (0.9.20)
|
|
40
|
+
|
|
41
|
+
PLATFORMS
|
|
42
|
+
ruby
|
|
43
|
+
|
|
44
|
+
DEPENDENCIES
|
|
45
|
+
bundler (~> 2.0)
|
|
46
|
+
commonmarker (~> 0.18)
|
|
47
|
+
github-markup (~> 3.0)
|
|
48
|
+
minitest (~> 5.11)
|
|
49
|
+
rabid!
|
|
50
|
+
rake (~> 12.3)
|
|
51
|
+
redcarpet (~> 3.4)
|
|
52
|
+
rubocop (~> 0.63)
|
|
53
|
+
yard (~> 0.9)
|
|
54
|
+
|
|
55
|
+
BUNDLED WITH
|
|
56
|
+
2.0.1
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Alexandre ZANNI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# RABID
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
> **RA**pid **B**ig **I**P **D**ecoder
|
|
6
|
+
|
|
7
|
+
## What it is
|
|
8
|
+
|
|
9
|
+
A CLI tool and library allowing to simply decode all kind of BigIP cookies.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Support all 4 cookie formats
|
|
14
|
+
- CLI tool & library
|
|
15
|
+
- Hackable
|
data/Rakefile
ADDED
data/bigipcookie.gemspec
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
require 'bigipcookie/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = 'rabid'
|
|
9
|
+
s.version = Version::VERSION
|
|
10
|
+
s.platform = Gem::Platform::RUBY
|
|
11
|
+
s.date = '2019-07-16'
|
|
12
|
+
s.summary = 'RApid Big IP Decoder'
|
|
13
|
+
s.description = 'A library and CLI tool allowing to decode all 4 types'\
|
|
14
|
+
' of BigIP cookies'
|
|
15
|
+
s.authors = ['Alexandre ZANNI']
|
|
16
|
+
s.email = 'alexandre.zanni@engineer.com'
|
|
17
|
+
s.homepage = 'https://orange-cyberdefense.github.io/rabid/'
|
|
18
|
+
s.license = 'MIT'
|
|
19
|
+
|
|
20
|
+
s.files = `git ls-files`.split("\n")
|
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f|
|
|
22
|
+
File.basename(f)
|
|
23
|
+
}
|
|
24
|
+
s.test_files = s.files.grep(%r{^(test)/})
|
|
25
|
+
s.require_paths = ['lib']
|
|
26
|
+
|
|
27
|
+
s.metadata = {
|
|
28
|
+
'yard.run' => 'yard',
|
|
29
|
+
'bug_tracker_uri' => 'https://github.com/Orange-Cyberdefense/rabid/issues',
|
|
30
|
+
'changelog_uri' => 'https://github.com/Orange-Cyberdefense/rabid/blob/master/docs/CHANGELOG.md',
|
|
31
|
+
'documentation_uri' => 'https://orange-cyberdefense.github.io/rabid/',
|
|
32
|
+
'homepage_uri' => 'https://orange-cyberdefense.github.io/rabid/',
|
|
33
|
+
'source_code_uri' => 'https://github.com/Orange-Cyberdefense/rabid/',
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
s.required_ruby_version = '~> 2.4'
|
|
37
|
+
|
|
38
|
+
s.add_runtime_dependency('docopt', '~> 0.6') # for argument parsing
|
|
39
|
+
s.add_runtime_dependency('paint', '~> 2.1') # for colorized ouput
|
|
40
|
+
|
|
41
|
+
s.add_development_dependency('bundler', '~> 2.0')
|
|
42
|
+
s.add_development_dependency('commonmarker', '~> 0.18') # for GMF support in YARD
|
|
43
|
+
s.add_development_dependency('github-markup', '~> 3.0') # for GMF support in YARD
|
|
44
|
+
s.add_development_dependency('minitest', '~> 5.11')
|
|
45
|
+
s.add_development_dependency('rake', '~> 12.3')
|
|
46
|
+
s.add_development_dependency('redcarpet', '~> 3.4') # for GMF support in YARD
|
|
47
|
+
s.add_development_dependency('rubocop', '~> 0.63')
|
|
48
|
+
s.add_development_dependency('yard', '~> 0.9')
|
|
49
|
+
end
|
data/bin/rabid
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# Ruby internal
|
|
5
|
+
require 'pp'
|
|
6
|
+
# Project internal
|
|
7
|
+
require 'bigipcookie'
|
|
8
|
+
# External
|
|
9
|
+
require 'docopt'
|
|
10
|
+
require 'paint'
|
|
11
|
+
|
|
12
|
+
doc = <<~DOCOPT
|
|
13
|
+
RABID (RApid Big IP Decoder)
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
rabid [options] <raw_cookie>
|
|
17
|
+
rabid -h | --help
|
|
18
|
+
rabid --version
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
--ipv6-long-format Display IPv6 address in long format
|
|
22
|
+
--no-color Disable colorized output
|
|
23
|
+
--short Display in a short format: display only decoded cookies
|
|
24
|
+
--debug Display arguments
|
|
25
|
+
-h, --help Show this screen
|
|
26
|
+
--version Show version
|
|
27
|
+
|
|
28
|
+
Examples:
|
|
29
|
+
rabid 'BIGipServer<pool_name>=1677787402.36895.0000' --no-color --short
|
|
30
|
+
rabid 'rd5o00000000000000000000ffffc0000201o80'
|
|
31
|
+
rabid 'CustomeCookieName=vi20010112000000000000000000000030.20480' --ipv6-long-format
|
|
32
|
+
rabid 'BIGipServer~SuperPool=rd3o20010112000000000000000000000030o80' --debug
|
|
33
|
+
DOCOPT
|
|
34
|
+
|
|
35
|
+
begin
|
|
36
|
+
args = Docopt.docopt(doc, version: BigIPCookie::VERSION)
|
|
37
|
+
pp args if args['--debug']
|
|
38
|
+
# use case 1, using the tool
|
|
39
|
+
if args['<raw_cookie>']
|
|
40
|
+
bip = BigIPCookie::Decode.new(args['<raw_cookie>'])
|
|
41
|
+
opts = {}
|
|
42
|
+
opts[:ipv6compression] = 0 if args['--ipv6-long-format']
|
|
43
|
+
bip.auto_decode(opts)
|
|
44
|
+
# Display
|
|
45
|
+
if args['--no-color']
|
|
46
|
+
if args['--short']
|
|
47
|
+
puts bip.decoded_cookie
|
|
48
|
+
else
|
|
49
|
+
puts "Pool name: #{bip.pool_name}"
|
|
50
|
+
puts "Cookie type: #{bip.cookie_type}"
|
|
51
|
+
puts "Raw cookie: #{bip.raw_cookie}"
|
|
52
|
+
puts "Decoded cookie: #{bip.decoded_cookie}"
|
|
53
|
+
end
|
|
54
|
+
elsif args['--short']
|
|
55
|
+
puts Paint[bip.decoded_cookie, :green]
|
|
56
|
+
else
|
|
57
|
+
puts Paint['Pool name:', :white, :bold] + ' ' + bip.pool_name
|
|
58
|
+
puts Paint['Cookie type:', :white, :bold] + ' ' + bip.cookie_type
|
|
59
|
+
puts Paint['Raw cookie:', :white, :bold] + ' ' + bip.raw_cookie
|
|
60
|
+
puts Paint['Decoded cookie:', :white, :bold] + ' ' + Paint[bip.decoded_cookie, :green]
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
# use case 2, help: already handled by docopt
|
|
64
|
+
# use case 3, version: already handled by docopt
|
|
65
|
+
rescue Docopt::Exit => e
|
|
66
|
+
puts e.message
|
|
67
|
+
end
|
data/bin/rabid_console
ADDED
data/bin/rabid_setup
ADDED
data/docs/.nojekyll
ADDED
|
File without changes
|
data/docs/About.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# About
|
|
2
|
+
|
|
3
|
+
# References
|
|
4
|
+
|
|
5
|
+
BigIP cookie decoding is done following the official methode provided by F5: https://support.f5.com/csp/article/K6917
|
|
6
|
+
|
|
7
|
+
IPv6 URL format try to respect RFC2732: https://tools.ietf.org/html/rfc2732
|
|
8
|
+
|
|
9
|
+
## Logo
|
|
10
|
+
|
|
11
|
+
Logo made with [DesignEvo](https://www.designevo.com).
|
data/docs/CHANGELOG.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Changelog
|
data/docs/README.md
ADDED
data/docs/_coverpage.md
ADDED
|
Binary file
|
data/docs/_navbar.md
ADDED
data/docs/_sidebar.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
- Getting started
|
|
2
|
+
|
|
3
|
+
- [Quick start](pages/quick-start.md)
|
|
4
|
+
- [Installation](pages/install.md)
|
|
5
|
+
- [Usage](pages/usage.md)
|
|
6
|
+
- [Demo](pages/demo.md)
|
|
7
|
+
|
|
8
|
+
- Guide
|
|
9
|
+
|
|
10
|
+
- [Documentation](pages/documentation.md)
|
|
11
|
+
- [Publishing](pages/publishing.md)
|
|
12
|
+
|
|
13
|
+
- [Why?](why.md)
|
|
14
|
+
- [About](About.md)
|
|
15
|
+
- [Changelog](CHANGELOG.md)
|
data/docs/index.html
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Document</title>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
7
|
+
<meta name="description" content="Description">
|
|
8
|
+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
9
|
+
<link rel="stylesheet" href="vendor/themes/vue.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
<script>
|
|
14
|
+
window.$docsify = {
|
|
15
|
+
name: 'RABID',
|
|
16
|
+
repo: 'https://github.com/Orange-Cyberdefense/rabid/',
|
|
17
|
+
loadSidebar: true,
|
|
18
|
+
subMaxLevel: 2,
|
|
19
|
+
loadNavbar: true,
|
|
20
|
+
coverpage: true,
|
|
21
|
+
logo: '_media/logo.png',
|
|
22
|
+
themeColor: '#FF6600',
|
|
23
|
+
search: 'auto',
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
<script src="vendor/docsify.js"></script>
|
|
27
|
+
<script src="vendor/plugins/search.min.js"></script>
|
|
28
|
+
<script src="vendor/plugins/emoji.min.js"></script>
|
|
29
|
+
<script src="vendor/prismjs/components/prism-ruby.min.js"></script>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
data/docs/pages/demo.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Documentation
|
|
2
|
+
|
|
3
|
+
## CLI doc
|
|
4
|
+
|
|
5
|
+
See [Usage](pages/usage.md?id=cli).
|
|
6
|
+
|
|
7
|
+
## Server locally
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npm i docsify-cli -g
|
|
11
|
+
$ docsify serve docs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Library doc
|
|
15
|
+
|
|
16
|
+
The output directory of the library documentation will be `docs/yard`.
|
|
17
|
+
|
|
18
|
+
You can consult it online [here](rabid/yard/).
|
|
19
|
+
|
|
20
|
+
### Building locally: for library users
|
|
21
|
+
|
|
22
|
+
For developers who only want to use the RABID library.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
$ bundle exec yard doc
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Building locally: for RABID developer
|
|
29
|
+
|
|
30
|
+
For developers who want to participate to RABID development.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
$ bundle exec yard doc --yardopts .yardopts-dev
|
|
34
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Production
|
|
4
|
+
|
|
5
|
+
### Install from rubygems.org
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
$ gem install rabid
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Install from BlackArch
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
# pacman -S rabid
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Development
|
|
18
|
+
|
|
19
|
+
It's better to use [rbenv](https://github.com/rbenv/rbenv) to have latests version of ruby and to avoid trashing your system ruby.
|
|
20
|
+
|
|
21
|
+
### Install from rubygems.org
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
$ gem install --development rabid
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Build from git
|
|
28
|
+
|
|
29
|
+
Just replace `x.x.x` with the gem version you see after `gem build`.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
$ git clone https://XXX/XXX/rabid.git rabid
|
|
33
|
+
$ cd rabid
|
|
34
|
+
$ gem install bundler
|
|
35
|
+
$ bundler install
|
|
36
|
+
$ gem build rabid.gemspec
|
|
37
|
+
$ gem install rabid-x.x.x.gem
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Note: if an automatic install is needed you can get the version with `$ gem build bigipcookie.gemspec | grep Version | cut -d' ' -f4`.
|
|
41
|
+
|
|
42
|
+
### Run the library in irb without installing the gem
|
|
43
|
+
|
|
44
|
+
From local file:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
$ irb -Ilib -rbigipcookie
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
From the installed gem:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
$ rabid_console
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Same for the CLI tool:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
$ ruby -Ilib -rbigipcookie bin/rabid
|
|
60
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Publishing
|
|
2
|
+
|
|
3
|
+
## On Rubygems.org
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
$ git tag vx.x.x
|
|
7
|
+
$ gem push rabid-x.x.x.gem
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
See https://guides.rubygems.org/publishing/.
|
|
11
|
+
|
|
12
|
+
On new release don't forget to rebuild the library documentation:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ bundle exec yard doc
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
An to be sure all tests pass!
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
$ rake
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## On BlackArch
|
|
25
|
+
|
|
26
|
+
BA process
|
|
27
|
+
|
|
28
|
+
On new release don't forget to rebuild the library documentation:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
$ bundle exec yard doc
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
An to be sure all tests pass!
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
$ rake
|
|
38
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Quick start
|
|
2
|
+
|
|
3
|
+
## Quick install
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
$ gem install rabid
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Default usage: CLI
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
$ rabid 'BIGipServer<pool_name>=1677787402.36895.0000'
|
|
13
|
+
Pool name: <pool_name>
|
|
14
|
+
Cookie type: IPv4 pool members
|
|
15
|
+
Raw cookie: BIGipServer<pool_name>=1677787402.36895.0000
|
|
16
|
+
Decoded cookie: 10.1.1.100:8080
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Default usage: library
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
require 'bigipcookie'
|
|
23
|
+
|
|
24
|
+
# IPv4 pool members, with pool name
|
|
25
|
+
bip = BigIPCookie::Decode.new('BIGipServer<pool_name>=1677787402.36895.0000')
|
|
26
|
+
# Automatically decode
|
|
27
|
+
bip.auto_decode
|
|
28
|
+
# Print result
|
|
29
|
+
puts "Cookie: #{bip.decoded_cookie}"
|
|
30
|
+
```
|
data/docs/pages/usage.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
## CLI
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
$ rabid --help
|
|
7
|
+
RABID (RApid Big IP Decoder)
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
rabid [options] <raw_cookie>
|
|
11
|
+
rabid -h | --help
|
|
12
|
+
rabid --version
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--ipv6-long-format Display IPv6 address in long format
|
|
16
|
+
--no-color Disable colorized output
|
|
17
|
+
--short Display in a short format: display only decoded cookies
|
|
18
|
+
--debug Display arguments
|
|
19
|
+
-h, --help Show this screen
|
|
20
|
+
--version Show version
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
rabid 'BIGipServer<pool_name>=1677787402.36895.0000' --no-color --short
|
|
24
|
+
rabid 'rd5o00000000000000000000ffffc0000201o80'
|
|
25
|
+
rabid 'CustomeCookieName=vi20010112000000000000000000000030.20480' --ipv6-long-format
|
|
26
|
+
rabid 'BIGipServer~SuperPool=rd3o20010112000000000000000000000030o80' --debug
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Library
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
require 'bigipcookie'
|
|
33
|
+
|
|
34
|
+
# IPv4 pool members, with pool name
|
|
35
|
+
bip = BigIPCookie::Decode.new('BIGipServer<pool_name>=1677787402.36895.0000')
|
|
36
|
+
# Automatically decode
|
|
37
|
+
bip.auto_decode
|
|
38
|
+
# Access the decoded value
|
|
39
|
+
bip.decoded_cookie
|
|
40
|
+
# Access the pool name
|
|
41
|
+
bip.pool_name
|
|
42
|
+
# Access the cookie type
|
|
43
|
+
bip.cookie_type
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Console
|
|
47
|
+
|
|
48
|
+
Launch `irb` with the library loaded.
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
$ rabid_console
|
|
52
|
+
irb(main):001:0>
|
|
53
|
+
```
|