Skip to content

Commit 9595532

Browse files
committed
Added the stoplight prism mock server as a server selection
1 parent e3ccb9d commit 9595532

13 files changed

+37
-41
lines changed

.github/workflows/generate_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: generate-docs
22

3-
# Run on each push to master
3+
# Run on each push to main
44
on:
55
push:
66
branches: [ main ]

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ AllCops:
1414
- Gemfile
1515
- Rakefile
1616
- 'test/**/*'
17+
- '*.gemspec'
1718

1819
#Cops in Metrics might need to be adjusted to past their defaults depending on how restrictive the requirements feel
1920
Style/Documentation:

.rubocop_todo.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2021-12-14 05:55:09 UTC using RuboCop version 1.20.0.
3+
# on 2021-12-22 16:48:47 UTC using RuboCop version 1.23.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 4
10-
# Cop supports --auto-correct.
11-
Lint/RedundantCopDisableDirective:
12-
Exclude:
13-
- 'lib/emasser/help.rb'
14-
- 'lib/emasser/post.rb'
15-
- 'lib/emasser/put.rb'
16-
179
# Offense count: 21
1810
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
1911
Metrics/AbcSize:

emass_client/eMASSRestOpenApi.yaml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ info:
99
description: |
1010
The Enterprise Mission Assurance Support Service (eMASS) Representational State
1111
Transfer (REST) Application Programming Interface (API) enables users to perform
12-
assessments and complete actions associated with system records. This command-line
13-
interface (CLI) tool implements all of the eMASS endpoints defined in the eMASS
14-
REST API v3.2, dated October 21, 2021.</br><br>
12+
assessments and complete actions associated with system records.
13+
14+
The `emasser` is a command-line interface (CLI) tool that implements all of the
15+
eMASS endpoints defined in the eMASS REST API v3.2, dated October 21, 2021.</br><br>
1516
1617
<strong>Register CLI</strong></br>
1718
New users will need to register an API key with the eMASS development team prior to
@@ -75,8 +76,8 @@ externalDocs:
7576
servers:
7677
- url: "http://localhost:4010"
7778
description: Use localhost mock server
78-
- url: "https://localhost:4433"
79-
description: Use localhost secure mock server
79+
- url: "https://stoplight.io/mocks/mitre/emasser/32836028"
80+
description: Use the hosted Prism mock server
8081

8182
#-------------------------------------------------------------------------------
8283
# T A G S - A list of tags used by the specification with additional metadata.
@@ -2547,12 +2548,12 @@ components:
25472548
role:
25482549
name: role
25492550
in: query
2550-
description: "**Role**: Required parameter. Accepts single value from available options."
2551+
description: "**Role**: Accepts single value from options available at base system-roles endpoint e.g., SCA."
25512552
required: true
25522553
schema:
25532554
type: string
2554-
enum: ["AO","Auditor","Artifact Manager","C&A Team","IAO","ISSO","PM/IAM","SCA","User Rep (View Only)", "Validator (IV&V)"]
2555-
default: "Validator (IV&V)"
2555+
enum: ["AO","Auditor","Artifact Manager","C&A Team","IAO","ISSO","PM/IAM","SCA","User Rep", "Validator"]
2556+
default: "IAO"
25562557
exportfilename:
25572558
name: filename
25582559
in: query
@@ -5400,7 +5401,6 @@ components:
54005401
packageName:
54015402
type: string
54025403
description: "[Read-Only] The package name."
5403-
x-faker:
54045404
example: "Test RMF Step 1 package"
54055405
enum: ["Test POA&M Approval","Test RMF Step 1 package","Test RMF Step 2 package","Test RMF Step 3 package"]
54065406
systemName:
@@ -5670,25 +5670,34 @@ components:
56705670
securitySchemes:
56715671
apikey:
56725672
type: apiKey
5673-
#type: https
5674-
#scheme: basic
56755673
in: header
56765674
name: api-key
56775675
description: >
5678-
The API key must be provided in the request header for all endpoint calls.<br>
5679-
See the
5676+
The API key must be provided in the request header for all eMASS endpoint calls.</br></br>
5677+
**For connecting to a mock server, any value is acceptable, e.g., 123**
56805678
userid:
56815679
type: apiKey
56825680
in: header
56835681
name: user-uid
56845682
description: >
56855683
This User unique identifier key must be provided in the request header for all PUT,
5686-
POST, and DELETE endpoint calls.
5687-
5684+
POST, and DELETE endpoint calls.</br>
5685+
Note: For DoD users this is the DoD ID Number (EIDIPI) on their DoD CAC.</br></br>
5686+
**For connecting to a mock server, any value is acceptable, e.g., 123**
5687+
mockType:
5688+
type: apiKey
5689+
in: header
5690+
name: Prefer
5691+
description: >
5692+
This header parameter is ony utilized when interacting with the mock server.</br>
5693+
Options are (enter in the **Value** textbox):
5694+
- For random response values `code=200, dynamic=true`
5695+
- For static response values `code=200`
56885696
#-------------------------------------------------------------------------------
56895697
# S E C U R I T Y
56905698
#-------------------------------------------------------------------------------
56915699
security:
56925700
- apikey: []
56935701
- userid: []
5702+
- mockType: []
56945703
...

emass_client/ruby_client/lib/swagger_client/api/system_roles_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def get_system_roles_by_category_id_with_http_info(role_category, role, opts = {
104104
fail ArgumentError, "Missing the required parameter 'role' when calling SystemRolesApi.get_system_roles_by_category_id"
105105
end
106106
# verify enum value
107-
if @api_client.config.client_side_validation && !['AO', 'Auditor', 'Artifact Manager', 'C&A Team', 'IAO', 'ISSO', 'PM/IAM', 'SCA', 'User Rep (View Only)', 'Validator (IV&V)'].include?(role)
108-
fail ArgumentError, "invalid value for 'role', must be one of AO, Auditor, Artifact Manager, C&A Team, IAO, ISSO, PM/IAM, SCA, User Rep (View Only), Validator (IV&V)"
107+
if @api_client.config.client_side_validation && !['AO', 'Auditor', 'Artifact Manager', 'C&A Team', 'IAO', 'ISSO', 'PM/IAM', 'SCA', 'User Rep', 'Validator'].include?(role)
108+
fail ArgumentError, "invalid value for 'role', must be one of AO, Auditor, Artifact Manager, C&A Team, IAO, ISSO, PM/IAM, SCA, User Rep, Validator"
109109
end
110110
if @api_client.config.client_side_validation && opts[:'policy'] && !['diacap', 'rmf', 'reporting'].include?(opts[:'policy'])
111111
fail ArgumentError, 'invalid value for "policy", must be one of diacap, rmf, reporting'

lib/emasser/get.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def all
182182
option :roleCategory, type: :string, required: true, enum: %w[PAC CAC Other]
183183
option :role, type: :string, required: true,
184184
enum: ['AO', 'Auditor', 'Artifact Manager', 'C&A Team', 'IAO',
185-
'ISSO', 'PM/IAM', 'SCA', 'User Rep (View Only)', 'Validator (IV&V)']
185+
'ISSO', 'PM/IAM', 'SCA', 'User Rep', 'Validator']
186186
# Optional parameters/fields
187187
option :policy, type: :string, required: false, enum: %w[diacap rmf reporting]
188188
option :includeDecommissioned, type: :boolean, required: false, desc: 'BOOLEAN - true or false.'

lib/emasser/help.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# frozen_string_literal: true
22

3-
# rubocop:disable Style/ClassAndModuleChildren
43
module Emasser::Help
54
class << self
65
def text(namespaced_command)
76
path = namespaced_command.to_s.tr(':', '/')
87
path = File.expand_path("../help/#{path}.md", __FILE__)
9-
IO.read(path) if File.exist?(path)
8+
File.read(path) if File.exist?(path)
109
end
1110
end
1211
end
13-
# rubocop:enable Style/ClassAndModuleChildren

lib/emasser/help/approvalCac_post_mapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ role of the CAC. Comments cannot exceed 10,000 characters.
1717

1818
Example:
1919

20-
bundle exec exe/emasser post cac add --systemId [value] --controlAcronym [value] --comments [value]
20+
bundle exec exe/emasser post cac add --systemId [value] --controlAcronym [value] --comments [value]

lib/emasser/help/approvalPac_post_mapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ totalSteps Integer [Read-Only] Total number of steps in Package Approval C
1717

1818
Example:
1919

20-
bundle exec exe/emasser post pac add --systemId [value] --workflow [value] --name [value] --comments [value]
20+
bundle exec exe/emasser post pac add --systemId [value] --workflow [value] --name [value] --comments [value]

lib/emasser/help/artifacts_post_mapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ Example:
5656

5757
bundle exec exe/emasser post artifacts upload --systemId [value] [--isTemplate or --no-isTemplate] --type [value] --category [value] --files[value...value]
5858

59-
Note: The example does not list any optional fields
59+
Note: The example does not list any optional fields

lib/emasser/help/cmmc_get_mapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
The Cybersecurity Maturity Model Certification (CMMC) Assessments endpoint provides
22
the ability to view CMMC assessment information.
33

4-
**It is available to CMMC eMASS only.**
4+
**It is available to CMMC eMASS only.**

lib/emasser/post.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def add
8787
#
8888
# Endpoint:
8989
# /api/systems/{systemId}/poams - Add one or many poa&m items in a system
90-
# rubocop:disable Metrics/ClassLength
9190
class Poams < SubCommandBase
9291
def self.exit_on_failure?
9392
true
@@ -299,7 +298,6 @@ def print_milestone_help
299298
end
300299
# rubocop:enable Metrics/BlockLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
301300
end
302-
# rubocop:enable Metrics/ClassLength
303301

304302
# The Milestones endpoints provide the ability add milestones that are associated with
305303
# Plan of Action and Milestones (POA&M) items for a system.

lib/emasser/put.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module Emasser
4141
#
4242
# Endpoint:
4343
# /api/systems/{systemId}/controls - Update control information in a system for one or many controls
44-
# rubocop:disable Metrics/ClassLength, Style/WordArray
44+
# rubocop:disable Style/WordArray
4545
class Controls < SubCommandBase
4646
def self.exit_on_failure?
4747
true
@@ -233,13 +233,12 @@ def process_business_logic(body)
233233
end
234234
# rubocop:enable Style/CaseLikeIf, Style/StringLiterals, Metrics/BlockLength, Metrics/CyclomaticComplexity
235235
end
236-
# rubocop:enable Metrics/ClassLength, Style/WordArray
236+
# rubocop:enable Style/WordArray
237237

238238
# Update Plan of Action (POA&M) items to a system.
239239
#
240240
# Endpoint:
241241
# /api/systems/{systemId}/poams - Update one or many poa&m items in a system
242-
# rubocop:disable Metrics/ClassLength
243242
class Poams < SubCommandBase
244243
def self.exit_on_failure?
245244
true
@@ -460,7 +459,6 @@ def print_milestone_help
460459
end
461460
# rubocop:enable Metrics/BlockLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
462461
end
463-
# rubocop:enable Metrics/ClassLength
464462

465463
# Update Milestones items to a system.
466464
#

0 commit comments

Comments
 (0)