metasploit-credential 0.14.6 → 0.14.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +9 -41
- data/lib/metasploit/credential/version.rb +21 -10
- data/spec/lib/metasploit/credential/version_spec.rb +2 -138
- data/spec/lib/metasploit/credential_spec.rb +3 -12
- data/spec/spec_helper.rb +12 -7
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa144979c299b0a5f2106efdcf0a27ce27a6238c
|
4
|
+
data.tar.gz: 798207915ad34014125264ed3852ae34d38bbcc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fc16422c984eb40a14b9eec56297590b8c4a5309acdca87ddb240f6151f68c45606988a3ddfe8488fc074f28a69ed06627493712f6f8241d79fc57e044ba529
|
7
|
+
data.tar.gz: b84875b6fb285621d6171e3cc7b9cdb502e10d79d497305651e1e3f43d0e2bccc349892fe8db23847310452b3ed027c10565c100fb0762042350d04fece97a4d
|
data/CONTRIBUTING.md
CHANGED
@@ -25,9 +25,9 @@ issue tracking software.
|
|
25
25
|
|
26
26
|
### `PRERELEASE`
|
27
27
|
|
28
|
-
1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/credential/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
|
28
|
+
1. Update `PRERELEASE` to match the `SUMMARY` in the branch name. If you branched from `master`, and [version.rb](lib/metasploit/credential/version.rb) does not have `PRERELEASE` defined, then adding the following lines after `PATCH`:
|
29
29
|
```
|
30
|
-
# The prerelease version, scoped to the {PATCH} version number.
|
30
|
+
# The prerelease version, scoped to the {MAJOR}, {MINOR}, and {PATCH} version number.
|
31
31
|
PRERELEASE = '<SUMMARY>'
|
32
32
|
```
|
33
33
|
2. `rake spec`
|
@@ -36,7 +36,7 @@ PRERELEASE = '<SUMMARY>'
|
|
36
36
|
|
37
37
|
### Your changes
|
38
38
|
|
39
|
-
Make your changes or however many commits you like,
|
39
|
+
Make your changes or however many commits you like, committing each with `git commit`.
|
40
40
|
|
41
41
|
### Pre-Pull Request Testing
|
42
42
|
|
@@ -45,12 +45,12 @@ Make your changes or however many commits you like, commiting each with `git com
|
|
45
45
|
|
46
46
|
### Push
|
47
47
|
|
48
|
-
Push your branch to your fork on
|
48
|
+
Push your branch to your fork on github: `git push TYPE/ISSUE/SUMMARY`
|
49
49
|
|
50
50
|
### Pull Request
|
51
51
|
|
52
52
|
* [Create new Pull Request](https://github.com/rapid7/metasploit-credential/compare/)
|
53
|
-
* Add a Verification Steps comment
|
53
|
+
* Add a Verification Steps to the description comment
|
54
54
|
|
55
55
|
```
|
56
56
|
# Verification Steps
|
@@ -61,6 +61,7 @@ Push your branch to your fork on gitub: `git push push TYPE/ISSUE/SUMMARY`
|
|
61
61
|
- [ ] `rake spec`
|
62
62
|
- [ ] VERIFY no failures
|
63
63
|
```
|
64
|
+
|
64
65
|
You should also include at least one scenario to manually check the changes outside of specs.
|
65
66
|
|
66
67
|
* Add a Post-merge Steps comment
|
@@ -105,7 +106,7 @@ Perform these steps prior to pushing to DESTINATION or the build will be broke o
|
|
105
106
|
- [ ] Change `PRERELEASE` from `SOURCE_SUMMARY` to `DESTINATION_SUMMARY` to match the branch (DESTINATION) summary (DESTINATION_SUMMARY)
|
106
107
|
|
107
108
|
## Gem build
|
108
|
-
- [ ] gem build
|
109
|
+
- [ ] gem build metasploit-credential.gemspec
|
109
110
|
- [ ] VERIFY the prerelease suffix has change on the gem.
|
110
111
|
|
111
112
|
## RSpec
|
@@ -117,38 +118,5 @@ Perform these steps prior to pushing to DESTINATION or the build will be broke o
|
|
117
118
|
- [ ] `git push origin DESTINATION`
|
118
119
|
```
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
The 'Release Steps' are a reminder to the reviewer of the Pull Request of how to release the gem.
|
123
|
-
|
124
|
-
```
|
125
|
-
# Release
|
126
|
-
|
127
|
-
Complete these steps on DESTINATION
|
128
|
-
|
129
|
-
## `VERSION`
|
130
|
-
|
131
|
-
### Compatible changes
|
132
|
-
|
133
|
-
If your change are compatible with the previous branch's API, then increment [`PATCH`](lib/metasploit/credential/version.rb).
|
134
|
-
|
135
|
-
### Incompatible changes
|
136
|
-
|
137
|
-
If your changes are incompatible with the previous branch's API, then increment [`MINOR`](lib/metasploit/credential/version.rb) and reset [`PATCH`](lib/metasploit/credential/version.rb) to `0`.
|
138
|
-
|
139
|
-
- [ ] Following the rules for [semantic versioning 2.0](http://semver.org/spec/v2.0.0.html), update [`MINOR`](lib/metasploit/credential/version.rb) and [`PATCH`](lib/metasploit/credential/version.rb) and commit the changes.
|
140
|
-
|
141
|
-
## MRI Ruby
|
142
|
-
- [ ] `rvm use ruby-2.1@metasploit_data_models`
|
143
|
-
- [ ] `rm Gemfile.lock`
|
144
|
-
- [ ] `bundle install`
|
145
|
-
- [ ] `rake release`
|
146
|
-
```
|
147
|
-
|
148
|
-
### Downstream dependencies
|
149
|
-
|
150
|
-
When releasing new versions, the following projects may need to be updated:
|
151
|
-
|
152
|
-
* [metasploit-framework](https://github.com/rapid7/metasploit-framework)
|
153
|
-
* [metasploit-pro-ui](https://github.com/rapid7/pro/tree/master/ui)
|
154
|
-
* [metasploit-pro-engine](https://github.com/rapid7/pro/tree/master/engine)
|
121
|
+
To update the [CHANGELOG.md](CHANGELOG.md) with the merged changes or release the merged code see
|
122
|
+
[RELEASING.md](RELEASING.md)
|
@@ -4,18 +4,26 @@ module Metasploit
|
|
4
4
|
module Credential
|
5
5
|
# Holds components of {VERSION} as defined by {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0}.
|
6
6
|
module Version
|
7
|
+
#
|
8
|
+
# CONSTANTS
|
9
|
+
#
|
10
|
+
|
7
11
|
# The major version number.
|
8
12
|
MAJOR = 0
|
9
13
|
# The minor version number, scoped to the {MAJOR} version number.
|
10
14
|
MINOR = 14
|
11
|
-
# The patch number, scoped to the {MAJOR} and {MINOR} version
|
12
|
-
PATCH =
|
15
|
+
# The patch version number, scoped to the {MAJOR} and {MINOR} version numbers.
|
16
|
+
PATCH = 7
|
13
17
|
|
14
|
-
# The full version string, including the {MAJOR},
|
18
|
+
# The full version string, including the {Metasploit::Credential::Version::MAJOR},
|
19
|
+
# {Metasploit::Credential::Version::MINOR}, {Metasploit::Credential::Version::PATCH}, and optionally, the
|
20
|
+
# `Metasploit::Credential::Version::PRERELEASE` in the
|
15
21
|
# {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
|
16
22
|
#
|
17
|
-
# @return [String] '{MAJOR}.{MINOR}.{PATCH}'
|
18
|
-
#
|
23
|
+
# @return [String] '{Metasploit::Credential::Version::MAJOR}.{Metasploit::Credential::Version::MINOR}.{Metasploit::Credential::Version::PATCH}'
|
24
|
+
# on master.
|
25
|
+
# '{Metasploit::Credential::Version::MAJOR}.{Metasploit::Credential::Version::MINOR}.{Metasploit::Credential::Version::PATCH}-PRERELEASE'
|
26
|
+
# on any branch other than master.
|
19
27
|
def self.full
|
20
28
|
version = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
21
29
|
|
@@ -26,20 +34,23 @@ module Metasploit
|
|
26
34
|
version
|
27
35
|
end
|
28
36
|
|
29
|
-
# The full gem version string, including the {MAJOR},
|
37
|
+
# The full gem version string, including the {Metasploit::Credential::Version::MAJOR},
|
38
|
+
# {Metasploit::Credential::Version::MINOR}, {Metasploit::Credential::Version::PATCH}, and optionally, the
|
39
|
+
# `Metasploit::Credential::Version::PRERELEASE` in the
|
30
40
|
# {http://guides.rubygems.org/specification-reference/#version RubyGems versioning} format.
|
31
41
|
#
|
32
|
-
# @return [String] '{MAJOR}.{MINOR}.{PATCH}'
|
33
|
-
#
|
42
|
+
# @return [String] '{Metasploit::Credential::Version::MAJOR}.{Metasploit::Credential::Version::MINOR}.{Metasploit::Credential::Version::PATCH}'
|
43
|
+
# on master. '{Metasploit::Credential::Version::MAJOR}.{Metasploit::Credential::Version::MINOR}.{Metasploit::Credential::Version::PATCH}.PRERELEASE'
|
44
|
+
# on any branch other than master.
|
34
45
|
def self.gem
|
35
46
|
full.gsub('-', '.pre.')
|
36
47
|
end
|
37
48
|
end
|
38
49
|
|
39
|
-
#
|
50
|
+
# (see Version.gem)
|
40
51
|
GEM_VERSION = Version.gem
|
41
52
|
|
42
|
-
#
|
53
|
+
# (see Version.full)
|
43
54
|
VERSION = Version.full
|
44
55
|
end
|
45
56
|
end
|
@@ -1,139 +1,3 @@
|
|
1
1
|
RSpec.describe Metasploit::Credential::Version do
|
2
|
-
|
3
|
-
|
4
|
-
subject(:major) do
|
5
|
-
described_class::MAJOR
|
6
|
-
end
|
7
|
-
|
8
|
-
it 'is 0 because the API is not locked yet' do
|
9
|
-
expect(major).to eq(0)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'MINOR' do
|
14
|
-
subject(:minor) do
|
15
|
-
described_class::MINOR
|
16
|
-
end
|
17
|
-
|
18
|
-
it { is_expected.to be_a Integer }
|
19
|
-
end
|
20
|
-
|
21
|
-
context 'PATCH' do
|
22
|
-
subject(:patch) do
|
23
|
-
described_class::PATCH
|
24
|
-
end
|
25
|
-
|
26
|
-
it { is_expected.to be_a Integer }
|
27
|
-
end
|
28
|
-
|
29
|
-
pull_request = ENV['TRAVIS_PULL_REQUEST']
|
30
|
-
|
31
|
-
# a pull request cannot check PRERELEASE because it will be tested in the target branch, but the source itself
|
32
|
-
# is from the source branch and so has the source branch PRERELEASE.
|
33
|
-
#
|
34
|
-
# PRERELEASE can only be set appropriately for a merge by merging to the target branch and then updating PRERELEASE
|
35
|
-
# on the target branch before committing and/or pushing to github and travis-ci.
|
36
|
-
if pull_request.nil? || pull_request == 'false'
|
37
|
-
context 'PREPRELEASE' do
|
38
|
-
subject(:prerelease) do
|
39
|
-
described_class::PRERELEASE
|
40
|
-
end
|
41
|
-
|
42
|
-
branch = ENV['TRAVIS_BRANCH']
|
43
|
-
|
44
|
-
if branch.blank?
|
45
|
-
branch = `git rev-parse --abbrev-ref HEAD`.strip
|
46
|
-
end
|
47
|
-
|
48
|
-
if branch == 'master'
|
49
|
-
it 'does not have a PRERELEASE' do
|
50
|
-
expect(defined? described_class::PRERELEASE).to be_nil
|
51
|
-
end
|
52
|
-
else
|
53
|
-
branch_regex = %r{\A(?:refs/remotes/)?(?<type>bug|chore|feature|staging)(/(?<story>[^/]+))?/(?<prerelease>[^\/]+)\z}
|
54
|
-
match = branch.match(branch_regex)
|
55
|
-
|
56
|
-
if match
|
57
|
-
it 'matches the branch relative name' do
|
58
|
-
expect(prerelease).to eq(match[:prerelease])
|
59
|
-
end
|
60
|
-
else
|
61
|
-
tag_regex = /\Av(?<major>\d+).(?<minor>\d+).(?<patch>\d+)(\.pre\.(?<prerelease>.*))?\z/
|
62
|
-
# travis-ci sets TRAVIS_BRANCH to the tag name for tag builds
|
63
|
-
match = branch.match(tag_regex)
|
64
|
-
|
65
|
-
if match
|
66
|
-
tag_prerelease = match[:prerelease]
|
67
|
-
|
68
|
-
if tag_prerelease
|
69
|
-
it 'matches the tag prerelease converted from a gem version to a VERSION' do
|
70
|
-
expect(prerelease).to eq(tag_prerelease.gsub('.pre.', '-'))
|
71
|
-
end
|
72
|
-
else
|
73
|
-
it 'does not have a PRERELEASE' do
|
74
|
-
expect(defined? described_class::PRERELEASE).to be_nil
|
75
|
-
end
|
76
|
-
end
|
77
|
-
else
|
78
|
-
it 'has a abbreviated reference that can be parsed for prerelease' do
|
79
|
-
fail "Do not know how to parse #{branch.inspect} for PRERELEASE"
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
context 'full' do
|
89
|
-
subject(:full) do
|
90
|
-
described_class.full
|
91
|
-
end
|
92
|
-
|
93
|
-
#
|
94
|
-
# lets
|
95
|
-
#
|
96
|
-
|
97
|
-
let(:major) do
|
98
|
-
1
|
99
|
-
end
|
100
|
-
|
101
|
-
let(:minor) do
|
102
|
-
2
|
103
|
-
end
|
104
|
-
|
105
|
-
let(:patch) do
|
106
|
-
3
|
107
|
-
end
|
108
|
-
|
109
|
-
before(:each) do
|
110
|
-
stub_const("#{described_class}::MAJOR", major)
|
111
|
-
stub_const("#{described_class}::MINOR", minor)
|
112
|
-
stub_const("#{described_class}::PATCH", patch)
|
113
|
-
end
|
114
|
-
|
115
|
-
context 'with PRERELEASE' do
|
116
|
-
let(:prerelease) do
|
117
|
-
'prerelease'
|
118
|
-
end
|
119
|
-
|
120
|
-
before(:each) do
|
121
|
-
stub_const("#{described_class}::PRERELEASE", prerelease)
|
122
|
-
end
|
123
|
-
|
124
|
-
it 'is <major>.<minor>.<patch>-<prerelease>' do
|
125
|
-
expect(full).to eq("#{major}.#{minor}.#{patch}-#{prerelease}")
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
context 'without PRERELEASE' do
|
130
|
-
before(:each) do
|
131
|
-
hide_const("#{described_class}::PRERELEASE")
|
132
|
-
end
|
133
|
-
|
134
|
-
it 'is <major>.<minor>.<patch>' do
|
135
|
-
expect(full).to eq("#{major}.#{minor}.#{patch}")
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
2
|
+
it_should_behave_like 'Metasploit::Version Version Module'
|
3
|
+
end
|
@@ -1,13 +1,4 @@
|
|
1
1
|
RSpec.describe Metasploit::Credential do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
described_class::VERSION
|
6
|
-
end
|
7
|
-
|
8
|
-
it 'is Metasploit::Credential::Version.full' do
|
9
|
-
expect(version).to eq(Metasploit::Credential::Version.full)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
2
|
+
it_should_behave_like 'Metasploit::Version GEM_VERSION constant'
|
3
|
+
it_should_behave_like 'Metasploit::Version VERSION constant'
|
4
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -26,15 +26,20 @@ require 'rspec/rails'
|
|
26
26
|
# in spec/support/ and its subdirectories from this gem and metasploit-concern
|
27
27
|
#
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
|
30
|
+
# Use find_all_by_name instead of find_by_name as find_all_by_name will return pre-release versions
|
31
|
+
gem_specification = Gem::Specification.find_all_by_name('metasploit-version').first
|
32
|
+
|
33
|
+
roots = [
|
34
|
+
gem_specification.gem_dir,
|
35
|
+
Metasploit::Concern.root,
|
36
|
+
Metasploit::Credential::Engine.root,
|
37
|
+
Metasploit::Model::Engine.root,
|
38
|
+
MetasploitDataModels::Engine.root
|
34
39
|
]
|
35
40
|
|
36
|
-
|
37
|
-
Dir[
|
41
|
+
roots.each do |root|
|
42
|
+
Dir[File.join(root, 'spec', 'support', '**', '*.rb')].each do |f|
|
38
43
|
require f
|
39
44
|
end
|
40
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metasploit-credential
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Imhoff
|
@@ -11,6 +11,20 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2015-05-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: metasploit-version
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.1.3
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.1.3
|
14
28
|
- !ruby/object:Gem::Dependency
|
15
29
|
name: metasploit-concern
|
16
30
|
requirement: !ruby/object:Gem::Requirement
|