emasser 3.4.1 → 3.10.0

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +8 -8
  3. data/.env-example +12 -12
  4. data/.github/release-drafter.yml +15 -15
  5. data/.github/workflows/codeql-analysis.yml +70 -70
  6. data/.github/workflows/draft-release.yml +15 -15
  7. data/.github/workflows/gh-pages.yml +32 -32
  8. data/.github/workflows/push-to-docker-mail.yml +28 -28
  9. data/.github/workflows/push-to-docker.yml +35 -35
  10. data/.github/workflows/release.yml +42 -42
  11. data/.github/workflows/rubocop.yml +23 -23
  12. data/.github/workflows/test-cli.yml +39 -72
  13. data/.gitignore +19 -19
  14. data/.mergify.yml +25 -25
  15. data/.rubocop.yml +83 -80
  16. data/.rubocop_todo.yml +27 -27
  17. data/CHANGELOG.md +16 -16
  18. data/Dockerfile +44 -44
  19. data/Gemfile +8 -8
  20. data/Gemfile.lock +108 -104
  21. data/LICENSE.md +15 -15
  22. data/README.md +178 -178
  23. data/Rakefile +18 -18
  24. data/_config.yml +1 -1
  25. data/docs/features.md +1501 -1436
  26. data/docs/redoc/index.html +1230 -1230
  27. data/emasser.gemspec +44 -44
  28. data/exe/emasser +5 -5
  29. data/lib/emasser/cli.rb +37 -37
  30. data/lib/emasser/configuration.rb +49 -49
  31. data/lib/emasser/constants.rb +26 -26
  32. data/lib/emasser/delete.rb +148 -148
  33. data/lib/emasser/errors.rb +14 -14
  34. data/lib/emasser/get.rb +1194 -949
  35. data/lib/emasser/help/approvalCac_post_mapper.md +20 -20
  36. data/lib/emasser/help/approvalPac_post_mapper.md +20 -20
  37. data/lib/emasser/help/artifacts_del_mapper.md +9 -9
  38. data/lib/emasser/help/artifacts_post_mapper.md +59 -59
  39. data/lib/emasser/help/artifacts_put_mapper.md +34 -34
  40. data/lib/emasser/help/cloudresource_post_mapper.md +62 -62
  41. data/lib/emasser/help/cmmc_get_mapper.md +4 -4
  42. data/lib/emasser/help/container_post_mapper.md +44 -44
  43. data/lib/emasser/help/controls_put_mapper.md +74 -74
  44. data/lib/emasser/help/milestone_del_mapper.md +11 -11
  45. data/lib/emasser/help/milestone_post_mapper.md +14 -14
  46. data/lib/emasser/help/milestone_put_mapper.md +23 -23
  47. data/lib/emasser/help/poam_del_mapper.md +5 -5
  48. data/lib/emasser/help/poam_post_mapper.md +93 -93
  49. data/lib/emasser/help/poam_put_mapper.md +107 -107
  50. data/lib/emasser/help/staticcode_clear_mapper.md +16 -16
  51. data/lib/emasser/help/staticcode_post_mapper.md +21 -21
  52. data/lib/emasser/help/testresults_post_mapper.md +21 -21
  53. data/lib/emasser/help.rb +11 -11
  54. data/lib/emasser/input_converters.rb +21 -21
  55. data/lib/emasser/options_parser.rb +20 -20
  56. data/lib/emasser/output_converters.rb +115 -111
  57. data/lib/emasser/post.rb +830 -830
  58. data/lib/emasser/put.rb +588 -588
  59. data/lib/emasser/version.rb +5 -5
  60. data/lib/emasser.rb +19 -19
  61. metadata +16 -10
@@ -1,72 +1,39 @@
1
- # name: Test emasser CLI
2
-
3
- # on:
4
- # push:
5
- # branches: [ main ]
6
- # pull_request:
7
- # branches: [ main ]
8
-
9
- # jobs:
10
- # test:
11
- # strategy:
12
- # fail-fast: false
13
- # matrix:
14
- # platform: [ ubuntu-latest, macos-latest, windows-latest ]
15
- # ruby-version: ['2.6', '2.7']
16
- # runs-on: ${{ matrix.platform }}
17
- # steps:
18
- # - name: Setup Ruby ${{matrix.ruby}}
19
- # uses: ruby/setup-ruby@v1
20
- # with:
21
- # ruby-version: ${{ matrix.ruby-version }}
22
- # - uses: actions/checkout@v2
23
- # - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
24
- # if: matrix.platform == 'windows-latest'
25
- # run: |
26
- # echo "need to install libcurl.dll"
27
- # - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
28
- # if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
29
- # run: |
30
- # bundle install
31
- # bundle info swagger_client
32
- # rspec spec --format documentation
33
-
34
- name: Test emasser CLI
35
-
36
- on:
37
- push:
38
- branches: [ main ]
39
- pull_request:
40
- branches: [ main ]
41
-
42
- jobs:
43
- test:
44
- strategy:
45
- fail-fast: false
46
- matrix:
47
- platform: [ ubuntu-latest, macos-latest, windows-latest ]
48
- ruby-version: ['2.6', '2.7']
49
- runs-on: ${{ matrix.platform }}
50
- steps:
51
- - name: Setup Ruby ${{matrix.ruby}}
52
- uses: ruby/setup-ruby@v1
53
- with:
54
- ruby-version: ${{ matrix.ruby-version }}
55
- - uses: actions/checkout@v2
56
- - uses: crazy-max/ghaction-chocolatey@v1
57
- with:
58
- args: install curl -y
59
- if: matrix.platform == 'windows-latest'
60
- - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
61
- if: matrix.platform == 'windows-latest'
62
- run: |
63
- # bundle install
64
- # bundle info emass_client
65
- # rspec spec --format documentation
66
- echo "need to fix path to libcurl.dll"
67
- - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
68
- if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
69
- run: |
70
- bundle install
71
- bundle info emass_client
72
- rspec spec --format documentation
1
+ name: Test emasser CLI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ platform: [ ubuntu-latest, macos-latest, windows-latest ]
15
+ ruby-version: ['2.6', '2.7']
16
+ runs-on: ${{ matrix.platform }}
17
+ steps:
18
+ - name: Setup Ruby ${{matrix.ruby}}
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby-version }}
22
+ - uses: actions/checkout@v3
23
+ - uses: crazy-max/ghaction-chocolatey@v1
24
+ with:
25
+ args: install curl -y
26
+ if: matrix.platform == 'windows-latest'
27
+ - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
28
+ if: matrix.platform == 'windows-latest'
29
+ run: |
30
+ # bundle install
31
+ # bundle info emass_client
32
+ # rspec spec --format documentation
33
+ echo "need to fix path to libcurl.dll"
34
+ - name: Testing on ${{ matrix.platform }} for Ruby ${{ matrix.ruby }}
35
+ if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
36
+ run: |
37
+ bundle install
38
+ bundle info emass_client
39
+ rspec spec --format documentation
data/.gitignore CHANGED
@@ -1,19 +1,19 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- /emasser_secrets
10
- /.vscode
11
-
12
- **/*.un~
13
-
14
- .DS_Store
15
- .byebug_history
16
- .env
17
- key.pem
18
- client.pem
19
- *.gem
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /emasser_secrets
10
+ /.vscode
11
+
12
+ **/*.un~
13
+
14
+ .DS_Store
15
+ .byebug_history
16
+ .env
17
+ key.pem
18
+ client.pem
19
+ *.gem
data/.mergify.yml CHANGED
@@ -1,25 +1,25 @@
1
- queue_rules:
2
- - name: default
3
- conditions:
4
- - "#approved-reviews-by>=1"
5
- - base=main
6
-
7
- pull_request_rules:
8
- - name: automatic merge for master when reviewed and CI passes
9
- conditions:
10
- - label=ready-to-merge
11
- actions:
12
- queue:
13
- name: default
14
- method: squash
15
- - name: delete head branch after merge
16
- conditions:
17
- - merged
18
- actions:
19
- delete_head_branch: {}
20
- - name: ask developers to resolve conflict
21
- conditions:
22
- - conflict
23
- actions:
24
- comment:
25
- message: This pull request has a conflict. Could you fix it @{{author}}?
1
+ queue_rules:
2
+ - name: default
3
+ conditions:
4
+ - "#approved-reviews-by>=1"
5
+ - base=main
6
+
7
+ pull_request_rules:
8
+ - name: automatic merge for master when reviewed and CI passes
9
+ conditions:
10
+ - label=ready-to-merge
11
+ actions:
12
+ queue:
13
+ name: default
14
+ method: squash
15
+ - name: delete head branch after merge
16
+ conditions:
17
+ - merged
18
+ actions:
19
+ delete_head_branch: {}
20
+ - name: ask developers to resolve conflict
21
+ conditions:
22
+ - conflict
23
+ actions:
24
+ comment:
25
+ message: This pull request has a conflict. Could you fix it @{{author}}?
data/.rubocop.yml CHANGED
@@ -1,80 +1,83 @@
1
- ---
2
- inherit_from: .rubocop_todo.yml
3
-
4
- require:
5
- - rubocop-minitest
6
- - rubocop-performance
7
- - rubocop-rake
8
-
9
- AllCops:
10
- TargetRubyVersion: 2.5
11
- NewCops: enable
12
- Exclude:
13
- - 'emass_client/ruby_client/**/*'
14
- - Gemfile
15
- - Rakefile
16
- - 'test/**/*'
17
- - '*.gemspec'
18
-
19
- #Cops in Metrics might need to be adjusted to past their defaults depending on how restrictive the requirements feel
20
- Style/Documentation:
21
- Enabled: false
22
- Layout/ParameterAlignment:
23
- Enabled: true
24
- Style/Encoding:
25
- Enabled: false
26
- Style/HashSyntax:
27
- Enabled: true
28
- Layout/LineLength:
29
- Enabled: false
30
- Layout/EmptyLinesAroundBlockBody:
31
- Enabled: false
32
- Style/NumericLiterals:
33
- MinDigits: 10
34
- Metrics/ModuleLength:
35
- Enabled: false
36
- Metrics/ClassLength:
37
- Enabled: false
38
- Style/PercentLiteralDelimiters:
39
- PreferredDelimiters:
40
- '%': '{}'
41
- '%i': ()
42
- '%q': '{}'
43
- '%Q': ()
44
- '%r': '{}'
45
- '%s': ()
46
- '%w': '{}'
47
- '%W': ()
48
- '%x': ()
49
- Layout/HashAlignment:
50
- Enabled: false
51
- Naming/PredicateName:
52
- Enabled: false
53
- Style/ClassAndModuleChildren:
54
- Enabled: false
55
- Style/ConditionalAssignment:
56
- Enabled: false
57
- Style/AndOr:
58
- Enabled: false
59
- Style/Not:
60
- Enabled: false
61
- Naming/FileName:
62
- Enabled: false
63
- Style/TrailingCommaInArrayLiteral:
64
- EnforcedStyleForMultiline: comma
65
- Style/TrailingCommaInArguments:
66
- EnforcedStyleForMultiline: comma
67
- Style/NegatedIf:
68
- Enabled: false
69
- Style/UnlessElse:
70
- Enabled: false
71
- Style/BlockDelimiters:
72
- Enabled: false
73
- Layout/SpaceAroundOperators:
74
- Enabled: false
75
- Style/IfUnlessModifier:
76
- Enabled: false
77
- Style/FrozenStringLiteralComment:
78
- Enabled: false
79
- Style/SignalException:
80
- Enabled: false
1
+ ---
2
+ inherit_from: .rubocop_todo.yml
3
+
4
+ require:
5
+ - rubocop-minitest
6
+ - rubocop-performance
7
+ - rubocop-rake
8
+
9
+ AllCops:
10
+ TargetRubyVersion: 2.5
11
+ NewCops: enable
12
+ Exclude:
13
+ - 'emass_client/ruby_client/**/*'
14
+ - Gemfile
15
+ - Rakefile
16
+ - 'test/**/*'
17
+ - '*.gemspec'
18
+ - '.env'
19
+
20
+ #Cops in Metrics might need to be adjusted to past their defaults depending on how restrictive the requirements feel
21
+ Style/Documentation:
22
+ Enabled: false
23
+ Layout/ParameterAlignment:
24
+ Enabled: true
25
+ Style/Encoding:
26
+ Enabled: false
27
+ Style/HashSyntax:
28
+ Enabled: true
29
+ Layout/LineLength:
30
+ Enabled: false
31
+ Layout/EmptyLinesAroundBlockBody:
32
+ Enabled: false
33
+ Style/NumericLiterals:
34
+ MinDigits: 10
35
+ Metrics/ModuleLength:
36
+ Enabled: false
37
+ Metrics/ClassLength:
38
+ Enabled: false
39
+ Style/PercentLiteralDelimiters:
40
+ PreferredDelimiters:
41
+ '%': '{}'
42
+ '%i': ()
43
+ '%q': '{}'
44
+ '%Q': ()
45
+ '%r': '{}'
46
+ '%s': ()
47
+ '%w': '{}'
48
+ '%W': ()
49
+ '%x': ()
50
+ Layout/HashAlignment:
51
+ Enabled: false
52
+ Naming/PredicateName:
53
+ Enabled: false
54
+ Style/ClassAndModuleChildren:
55
+ Enabled: false
56
+ Style/ConditionalAssignment:
57
+ Enabled: false
58
+ Style/AndOr:
59
+ Enabled: false
60
+ Style/Not:
61
+ Enabled: false
62
+ Naming/FileName:
63
+ Enabled: false
64
+ Style/TrailingCommaInArrayLiteral:
65
+ EnforcedStyleForMultiline: comma
66
+ Style/TrailingCommaInArguments:
67
+ EnforcedStyleForMultiline: comma
68
+ Style/NegatedIf:
69
+ Enabled: false
70
+ Style/UnlessElse:
71
+ Enabled: false
72
+ Style/BlockDelimiters:
73
+ Enabled: false
74
+ Layout/SpaceAroundOperators:
75
+ Enabled: false
76
+ Style/IfUnlessModifier:
77
+ Enabled: false
78
+ Style/FrozenStringLiteralComment:
79
+ Enabled: false
80
+ Style/SignalException:
81
+ Enabled: false
82
+ Layout/EndOfLine:
83
+ EnforcedStyle: lf
data/.rubocop_todo.yml CHANGED
@@ -1,27 +1,27 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-12-22 16:48:47 UTC using RuboCop version 1.23.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 21
10
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
11
- Metrics/AbcSize:
12
- Max: 190
13
-
14
- # Offense count: 17
15
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
- Metrics/MethodLength:
17
- Max: 78
18
-
19
- # Offense count: 11
20
- # Cop supports --auto-correct.
21
- # Configuration parameters: PreferredDelimiters.
22
- Style/PercentLiteralDelimiters:
23
- Exclude:
24
- - 'lib/emasser/get.rb'
25
- - 'lib/emasser/options_parser.rb'
26
- - 'lib/emasser/post.rb'
27
- - 'lib/emasser/put.rb'
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-12-22 16:48:47 UTC using RuboCop version 1.23.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 21
10
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
11
+ Metrics/AbcSize:
12
+ Max: 190
13
+
14
+ # Offense count: 17
15
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
+ Metrics/MethodLength:
17
+ Max: 78
18
+
19
+ # Offense count: 11
20
+ # Cop supports --auto-correct.
21
+ # Configuration parameters: PreferredDelimiters.
22
+ Style/PercentLiteralDelimiters:
23
+ Exclude:
24
+ - 'lib/emasser/get.rb'
25
+ - 'lib/emasser/options_parser.rb'
26
+ - 'lib/emasser/post.rb'
27
+ - 'lib/emasser/put.rb'
data/CHANGELOG.md CHANGED
@@ -1,16 +1,16 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- ## [Unreleased]
8
- - Harden the docker container (ex. non root user, etc).
9
-
10
- ## [0.2.0] - 2020-12-14
11
- ### Added
12
- - Scaffolding for the emasser project including such things as a Dockerfile, a .gitlab-ci.yml, some repository dependencies such as `standard` and `minitest`, and some gem dependencies such as `thor`.
13
-
14
- ## [0.1.0] - 2020-12-10
15
- ### Added
16
- - Put in MITRE's particular license modifications and notices.
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+ - Harden the docker container (ex. non root user, etc).
9
+
10
+ ## [0.2.0] - 2020-12-14
11
+ ### Added
12
+ - Scaffolding for the emasser project including such things as a Dockerfile, a .gitlab-ci.yml, some repository dependencies such as `standard` and `minitest`, and some gem dependencies such as `thor`.
13
+
14
+ ## [0.1.0] - 2020-12-10
15
+ ### Added
16
+ - Put in MITRE's particular license modifications and notices.
data/Dockerfile CHANGED
@@ -1,44 +1,44 @@
1
- # Buld from ruby 2.7.5 image
2
- FROM ruby:2.7.5 as build
3
-
4
- LABEL name="emasser" \
5
- vendor="MITRE" \
6
- version="${EMASSER_VERSION}" \
7
- release="1" \
8
- url="https://github.com/mitre/emasser" \
9
- description="Emasser is a command-line interface (CLI) that aims to automate routine business use-cases and provide utility surrounding the Enterprise Mission Assurance Support Service (eMASS) by leveraging its representational state transfer (REST) application programming interface (API)." \
10
- docs="https://mitre.github.io/emasser/" \
11
- run="docker run -d --name ${NAME} ${IMAGE} <args>"
12
-
13
- # Set the base directory that will be used from now on
14
- WORKDIR /emasser
15
-
16
- # Install dependency
17
- RUN gem install bundler -v '2.3.5'
18
- RUN apt update && apt install -y build-essential
19
- COPY . .
20
- RUN bundle install
21
- # WORKDIR /emasser/emass_client/ruby_client
22
- # RUN gem build emass_client.gemspec
23
- WORKDIR /emasser
24
- RUN gem build emasser.gemspec
25
- RUN mkdir gems
26
- # RUN mv emass_client/ruby_client/emass_client*.gem gems/emass_client.gem
27
- RUN mv emasser*.gem gems/emasser.gem
28
-
29
-
30
- FROM ruby:2-alpine
31
-
32
- # Use the line below when testing creating the container locally
33
- # RUN sed -i 's/https/http/g' /etc/apk/repositories
34
- COPY --from=build /emasser/gems /emass-gems
35
-
36
- # RUN apk add build-base libcurl && gem install /emass-gems/emass_client.gem && gem install /emass-gems/emasser.gem
37
- RUN apk add build-base libcurl && gem install /emass-gems/emasser.gem
38
-
39
- VOLUME [ "/data" ]
40
- WORKDIR /data
41
-
42
- ENTRYPOINT ["emasser"]
43
-
44
- CMD ["-h"]
1
+ # Buld from ruby 2.7.5 image
2
+ FROM ruby:2.7.5 as build
3
+
4
+ LABEL name="emasser" \
5
+ vendor="MITRE" \
6
+ version="${EMASSER_VERSION}" \
7
+ release="1" \
8
+ url="https://github.com/mitre/emasser" \
9
+ description="Emasser is a command-line interface (CLI) that aims to automate routine business use-cases and provide utility surrounding the Enterprise Mission Assurance Support Service (eMASS) by leveraging its representational state transfer (REST) application programming interface (API)." \
10
+ docs="https://mitre.github.io/emasser/" \
11
+ run="docker run -d --name ${NAME} ${IMAGE} <args>"
12
+
13
+ # Set the base directory that will be used from now on
14
+ WORKDIR /emasser
15
+
16
+ # Install dependency
17
+ RUN gem install bundler -v '2.3.5'
18
+ RUN apt update && apt install -y build-essential
19
+ COPY . .
20
+ RUN bundle install
21
+ # WORKDIR /emasser/emass_client/ruby_client
22
+ # RUN gem build emass_client.gemspec
23
+ WORKDIR /emasser
24
+ RUN gem build emasser.gemspec
25
+ RUN mkdir gems
26
+ # RUN mv emass_client/ruby_client/emass_client*.gem gems/emass_client.gem
27
+ RUN mv emasser*.gem gems/emasser.gem
28
+
29
+
30
+ FROM ruby:2-alpine
31
+
32
+ # Use the line below when testing creating the container locally
33
+ # RUN sed -i 's/https/http/g' /etc/apk/repositories
34
+ COPY --from=build /emasser/gems /emass-gems
35
+
36
+ # RUN apk add build-base libcurl && gem install /emass-gems/emass_client.gem && gem install /emass-gems/emasser.gem
37
+ RUN apk add build-base libcurl && gem install /emass-gems/emasser.gem
38
+
39
+ VOLUME [ "/data" ]
40
+ WORKDIR /data
41
+
42
+ ENTRYPOINT ["emasser"]
43
+
44
+ CMD ["-h"]
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in emasser.gemspec
6
- gemspec
7
-
8
- #gem 'emass_client', path: './emass_client/ruby_client/'
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in emasser.gemspec
6
+ gemspec
7
+
8
+ #gem 'emass_client', path: './emass_client/ruby_client/'