emasser 1.0.0 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (445) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +5 -8
  3. data/.env-example +3 -1
  4. data/.github/release-drafter.yml +2 -2
  5. data/.github/workflows/gh-pages.yml +4 -5
  6. data/.github/workflows/push-to-docker-mail.yml +28 -0
  7. data/.github/workflows/push-to-docker.yml +35 -0
  8. data/.github/workflows/release.yml +7 -3
  9. data/.github/workflows/test-cli.yml +4 -5
  10. data/.gitignore +3 -1
  11. data/Dockerfile +37 -3
  12. data/Gemfile +1 -1
  13. data/Gemfile.lock +37 -43
  14. data/README.md +131 -61
  15. data/docs/features.md +345 -207
  16. data/docs/images/emasser_architecture.jpg +0 -0
  17. data/emasser.gemspec +16 -12
  18. data/exe/emasser +0 -0
  19. data/images/emasser_architecture.jpg +0 -0
  20. data/images/emasser_diagram-Page-3.jpg +0 -0
  21. data/lib/emasser/cli.rb +12 -0
  22. data/lib/emasser/configuration.rb +22 -7
  23. data/lib/emasser/constants.rb +11 -3
  24. data/lib/emasser/delete.rb +14 -12
  25. data/lib/emasser/get.rb +83 -88
  26. data/lib/emasser/help/cloudresource_post_mapper.md +62 -0
  27. data/lib/emasser/help/container_post_mapper.md +44 -0
  28. data/lib/emasser/output_converters.rb +101 -4
  29. data/lib/emasser/post.rb +248 -55
  30. data/lib/emasser/put.rb +29 -22
  31. data/lib/emasser/version.rb +1 -1
  32. data/lib/emasser.rb +1 -1
  33. metadata +64 -447
  34. data/.github/workflows/generate_docs.yml +0 -33
  35. data/TAGS +0 -2393
  36. data/docs/developers.md +0 -115
  37. data/docs/swagger/dist/favicon-16x16.png +0 -0
  38. data/docs/swagger/dist/favicon-32x32.png +0 -0
  39. data/docs/swagger/dist/oauth2-redirect.html +0 -75
  40. data/docs/swagger/dist/swagger-ui-bundle.js +0 -3
  41. data/docs/swagger/dist/swagger-ui-bundle.js.map +0 -1
  42. data/docs/swagger/dist/swagger-ui-es-bundle-core.js +0 -3
  43. data/docs/swagger/dist/swagger-ui-es-bundle-core.js.map +0 -1
  44. data/docs/swagger/dist/swagger-ui-es-bundle.js +0 -3
  45. data/docs/swagger/dist/swagger-ui-es-bundle.js.map +0 -1
  46. data/docs/swagger/dist/swagger-ui-standalone-preset.js +0 -3
  47. data/docs/swagger/dist/swagger-ui-standalone-preset.js.map +0 -1
  48. data/docs/swagger/dist/swagger-ui.css +0 -4
  49. data/docs/swagger/dist/swagger-ui.css.map +0 -1
  50. data/docs/swagger/dist/swagger-ui.js +0 -3
  51. data/docs/swagger/dist/swagger-ui.js.map +0 -1
  52. data/docs/swagger/index.html +0 -60
  53. data/emass_client/eMASSRestOpenApi.yaml +0 -5698
  54. data/emass_client/ruby_client/.gitignore +0 -39
  55. data/emass_client/ruby_client/.rspec +0 -2
  56. data/emass_client/ruby_client/.rubocop.yml +0 -154
  57. data/emass_client/ruby_client/.swagger-codegen/VERSION +0 -1
  58. data/emass_client/ruby_client/.swagger-codegen-ignore +0 -23
  59. data/emass_client/ruby_client/Gemfile +0 -9
  60. data/emass_client/ruby_client/README.md +0 -1284
  61. data/emass_client/ruby_client/Rakefile +0 -8
  62. data/emass_client/ruby_client/docs/ArtifactsApi.md +0 -284
  63. data/emass_client/ruby_client/docs/ArtifactsDelete.md +0 -6
  64. data/emass_client/ruby_client/docs/ArtifactsDeleteInner.md +0 -7
  65. data/emass_client/ruby_client/docs/ArtifactsExportApi.md +0 -76
  66. data/emass_client/ruby_client/docs/ArtifactsGet.md +0 -20
  67. data/emass_client/ruby_client/docs/ArtifactsRequestPutBody.md +0 -16
  68. data/emass_client/ruby_client/docs/ArtifactsResponseDel.md +0 -8
  69. data/emass_client/ruby_client/docs/ArtifactsResponseDelData.md +0 -9
  70. data/emass_client/ruby_client/docs/ArtifactsResponseGet.md +0 -8
  71. data/emass_client/ruby_client/docs/ArtifactsResponsePutPost.md +0 -8
  72. data/emass_client/ruby_client/docs/CACApi.md +0 -140
  73. data/emass_client/ruby_client/docs/CMMCAssessmentsApi.md +0 -71
  74. data/emass_client/ruby_client/docs/CacGet.md +0 -13
  75. data/emass_client/ruby_client/docs/CacRequestPostBody.md +0 -8
  76. data/emass_client/ruby_client/docs/CacResponseGet.md +0 -8
  77. data/emass_client/ruby_client/docs/CacResponsePost.md +0 -8
  78. data/emass_client/ruby_client/docs/CacResponsePostData.md +0 -9
  79. data/emass_client/ruby_client/docs/CmmcGet.md +0 -19
  80. data/emass_client/ruby_client/docs/CmmcResponseGet.md +0 -8
  81. data/emass_client/ruby_client/docs/ConnectivityCcsd.md +0 -8
  82. data/emass_client/ruby_client/docs/ControlsApi.md +0 -140
  83. data/emass_client/ruby_client/docs/ControlsGet.md +0 -36
  84. data/emass_client/ruby_client/docs/ControlsPut.md +0 -9
  85. data/emass_client/ruby_client/docs/ControlsRequestPutBody.md +0 -29
  86. data/emass_client/ruby_client/docs/ControlsResponseGet.md +0 -8
  87. data/emass_client/ruby_client/docs/ControlsResponsePut.md +0 -8
  88. data/emass_client/ruby_client/docs/DefinitionTransitions.md +0 -9
  89. data/emass_client/ruby_client/docs/DeleteMilestone.md +0 -7
  90. data/emass_client/ruby_client/docs/DeletePoam.md +0 -7
  91. data/emass_client/ruby_client/docs/Empty200Response.md +0 -6
  92. data/emass_client/ruby_client/docs/Error.md +0 -8
  93. data/emass_client/ruby_client/docs/InstancesTransitions.md +0 -12
  94. data/emass_client/ruby_client/docs/MilestoneResponseGet.md +0 -8
  95. data/emass_client/ruby_client/docs/MilestoneResponsePost.md +0 -8
  96. data/emass_client/ruby_client/docs/MilestoneResponsePut.md +0 -8
  97. data/emass_client/ruby_client/docs/MilestonesApi.md +0 -350
  98. data/emass_client/ruby_client/docs/MilestonesDelete.md +0 -6
  99. data/emass_client/ruby_client/docs/MilestonesGet.md +0 -12
  100. data/emass_client/ruby_client/docs/MilestonesPost.md +0 -6
  101. data/emass_client/ruby_client/docs/MilestonesPut.md +0 -6
  102. data/emass_client/ruby_client/docs/MilestonesPutPostDelete.md +0 -11
  103. data/emass_client/ruby_client/docs/MilestonesRequestPostBody.md +0 -9
  104. data/emass_client/ruby_client/docs/MilestonesRequestPutBody.md +0 -9
  105. data/emass_client/ruby_client/docs/MilestonesRequiredPost.md +0 -8
  106. data/emass_client/ruby_client/docs/MilestonesRequiredPut.md +0 -9
  107. data/emass_client/ruby_client/docs/Model200.md +0 -7
  108. data/emass_client/ruby_client/docs/Model201.md +0 -7
  109. data/emass_client/ruby_client/docs/Model201Meta.md +0 -8
  110. data/emass_client/ruby_client/docs/Model400.md +0 -7
  111. data/emass_client/ruby_client/docs/Model400Meta.md +0 -8
  112. data/emass_client/ruby_client/docs/Model400Response.md +0 -7
  113. data/emass_client/ruby_client/docs/Model401.md +0 -7
  114. data/emass_client/ruby_client/docs/Model401Meta.md +0 -8
  115. data/emass_client/ruby_client/docs/Model403.md +0 -7
  116. data/emass_client/ruby_client/docs/Model403Meta.md +0 -8
  117. data/emass_client/ruby_client/docs/Model404.md +0 -8
  118. data/emass_client/ruby_client/docs/Model404Response.md +0 -7
  119. data/emass_client/ruby_client/docs/Model405.md +0 -7
  120. data/emass_client/ruby_client/docs/Model405Meta.md +0 -8
  121. data/emass_client/ruby_client/docs/Model411.md +0 -7
  122. data/emass_client/ruby_client/docs/Model411Meta.md +0 -8
  123. data/emass_client/ruby_client/docs/Model490.md +0 -7
  124. data/emass_client/ruby_client/docs/Model490Meta.md +0 -8
  125. data/emass_client/ruby_client/docs/Model500.md +0 -7
  126. data/emass_client/ruby_client/docs/Model500Meta.md +0 -8
  127. data/emass_client/ruby_client/docs/PACApi.md +0 -137
  128. data/emass_client/ruby_client/docs/POAMApi.md +0 -346
  129. data/emass_client/ruby_client/docs/PacGet.md +0 -14
  130. data/emass_client/ruby_client/docs/PacPost.md +0 -9
  131. data/emass_client/ruby_client/docs/PacRequestPostBody.md +0 -9
  132. data/emass_client/ruby_client/docs/PacResponseGet.md +0 -8
  133. data/emass_client/ruby_client/docs/PacResponsePost.md +0 -8
  134. data/emass_client/ruby_client/docs/PoamDelete.md +0 -6
  135. data/emass_client/ruby_client/docs/PoamGet.md +0 -39
  136. data/emass_client/ruby_client/docs/PoamPost.md +0 -6
  137. data/emass_client/ruby_client/docs/PoamPostPutDel.md +0 -10
  138. data/emass_client/ruby_client/docs/PoamPut.md +0 -6
  139. data/emass_client/ruby_client/docs/PoamRequestPostBody.md +0 -6
  140. data/emass_client/ruby_client/docs/PoamRequestPutBody.md +0 -6
  141. data/emass_client/ruby_client/docs/PoamRequiredPost.md +0 -32
  142. data/emass_client/ruby_client/docs/PoamRequiredPut.md +0 -35
  143. data/emass_client/ruby_client/docs/PoamResponseDelete.md +0 -8
  144. data/emass_client/ruby_client/docs/PoamResponseGet.md +0 -8
  145. data/emass_client/ruby_client/docs/PoamResponsePost.md +0 -8
  146. data/emass_client/ruby_client/docs/PoamResponsePut.md +0 -8
  147. data/emass_client/ruby_client/docs/Register.md +0 -8
  148. data/emass_client/ruby_client/docs/RegisterData.md +0 -7
  149. data/emass_client/ruby_client/docs/RegisterUserRequestPostBody.md +0 -7
  150. data/emass_client/ruby_client/docs/RegistrationApi.md +0 -71
  151. data/emass_client/ruby_client/docs/RoleCategory.md +0 -10
  152. data/emass_client/ruby_client/docs/Roles.md +0 -9
  153. data/emass_client/ruby_client/docs/Ssps.md +0 -9
  154. data/emass_client/ruby_client/docs/Stage.md +0 -8
  155. data/emass_client/ruby_client/docs/StaticCodeApplication.md +0 -12
  156. data/emass_client/ruby_client/docs/StaticCodeRequestPostBody.md +0 -6
  157. data/emass_client/ruby_client/docs/StaticCodeRequiredPost.md +0 -8
  158. data/emass_client/ruby_client/docs/StaticCodeRequiredPostApplication.md +0 -8
  159. data/emass_client/ruby_client/docs/StaticCodeScansApi.md +0 -73
  160. data/emass_client/ruby_client/docs/Success200Response.md +0 -8
  161. data/emass_client/ruby_client/docs/SystemIdArtifactsBody.md +0 -10
  162. data/emass_client/ruby_client/docs/SystemResponse.md +0 -8
  163. data/emass_client/ruby_client/docs/SystemRolesApi.md +0 -137
  164. data/emass_client/ruby_client/docs/SystemRolesCategoryResponse.md +0 -8
  165. data/emass_client/ruby_client/docs/SystemRolesResponse.md +0 -8
  166. data/emass_client/ruby_client/docs/SystemRolesResponseData.md +0 -8
  167. data/emass_client/ruby_client/docs/Systems.md +0 -70
  168. data/emass_client/ruby_client/docs/SystemsApi.md +0 -155
  169. data/emass_client/ruby_client/docs/Test.md +0 -8
  170. data/emass_client/ruby_client/docs/TestApi.md +0 -66
  171. data/emass_client/ruby_client/docs/TestData.md +0 -7
  172. data/emass_client/ruby_client/docs/TestResultsApi.md +0 -144
  173. data/emass_client/ruby_client/docs/TestResultsGet.md +0 -15
  174. data/emass_client/ruby_client/docs/TestResultsPost.md +0 -9
  175. data/emass_client/ruby_client/docs/TestResultsRequestPostBody.md +0 -11
  176. data/emass_client/ruby_client/docs/TestResultsResponseGet.md +0 -8
  177. data/emass_client/ruby_client/docs/TestResultsResponsePost.md +0 -8
  178. data/emass_client/ruby_client/docs/Users.md +0 -9
  179. data/emass_client/ruby_client/docs/WorkflowDefinitionGet.md +0 -11
  180. data/emass_client/ruby_client/docs/WorkflowDefinitionResponseGet.md +0 -8
  181. data/emass_client/ruby_client/docs/WorkflowDefinitionsApi.md +0 -74
  182. data/emass_client/ruby_client/docs/WorkflowInstancesApi.md +0 -146
  183. data/emass_client/ruby_client/docs/WorkflowInstancesGet.md +0 -16
  184. data/emass_client/ruby_client/docs/WorkflowInstancesResponseGet.md +0 -8
  185. data/emass_client/ruby_client/git_push.sh +0 -55
  186. data/emass_client/ruby_client/lib/swagger_client/api/artifacts_api.rb +0 -310
  187. data/emass_client/ruby_client/lib/swagger_client/api/artifacts_export_api.rb +0 -86
  188. data/emass_client/ruby_client/lib/swagger_client/api/cac_api.rb +0 -143
  189. data/emass_client/ruby_client/lib/swagger_client/api/cmmc_assessments_api.rb +0 -77
  190. data/emass_client/ruby_client/lib/swagger_client/api/controls_api.rb +0 -143
  191. data/emass_client/ruby_client/lib/swagger_client/api/milestones_api.rb +0 -366
  192. data/emass_client/ruby_client/lib/swagger_client/api/pac_api.rb +0 -140
  193. data/emass_client/ruby_client/lib/swagger_client/api/poam_api.rb +0 -345
  194. data/emass_client/ruby_client/lib/swagger_client/api/registration_api.rb +0 -78
  195. data/emass_client/ruby_client/lib/swagger_client/api/static_code_scans_api.rb +0 -84
  196. data/emass_client/ruby_client/lib/swagger_client/api/system_roles_api.rb +0 -150
  197. data/emass_client/ruby_client/lib/swagger_client/api/systems_api.rb +0 -162
  198. data/emass_client/ruby_client/lib/swagger_client/api/test_api.rb +0 -70
  199. data/emass_client/ruby_client/lib/swagger_client/api/test_results_api.rb +0 -149
  200. data/emass_client/ruby_client/lib/swagger_client/api/workflow_definitions_api.rb +0 -76
  201. data/emass_client/ruby_client/lib/swagger_client/api/workflow_instances_api.rb +0 -153
  202. data/emass_client/ruby_client/lib/swagger_client/api_client.rb +0 -389
  203. data/emass_client/ruby_client/lib/swagger_client/api_error.rb +0 -57
  204. data/emass_client/ruby_client/lib/swagger_client/configuration.rb +0 -224
  205. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_delete.rb +0 -201
  206. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_delete_inner.rb +0 -207
  207. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_get.rb +0 -383
  208. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_request_put_body.rb +0 -363
  209. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_del.rb +0 -217
  210. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_del_data.rb +0 -225
  211. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_get.rb +0 -217
  212. data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_put_post.rb +0 -217
  213. data/emass_client/ruby_client/lib/swagger_client/models/cac_get.rb +0 -301
  214. data/emass_client/ruby_client/lib/swagger_client/models/cac_request_post_body.rb +0 -217
  215. data/emass_client/ruby_client/lib/swagger_client/models/cac_response_get.rb +0 -217
  216. data/emass_client/ruby_client/lib/swagger_client/models/cac_response_post.rb +0 -217
  217. data/emass_client/ruby_client/lib/swagger_client/models/cac_response_post_data.rb +0 -225
  218. data/emass_client/ruby_client/lib/swagger_client/models/cmmc_get.rb +0 -398
  219. data/emass_client/ruby_client/lib/swagger_client/models/cmmc_response_get.rb +0 -217
  220. data/emass_client/ruby_client/lib/swagger_client/models/connectivity_ccsd.rb +0 -217
  221. data/emass_client/ruby_client/lib/swagger_client/models/controls_get.rb +0 -663
  222. data/emass_client/ruby_client/lib/swagger_client/models/controls_put.rb +0 -227
  223. data/emass_client/ruby_client/lib/swagger_client/models/controls_request_put_body.rb +0 -606
  224. data/emass_client/ruby_client/lib/swagger_client/models/controls_response_get.rb +0 -217
  225. data/emass_client/ruby_client/lib/swagger_client/models/controls_response_put.rb +0 -217
  226. data/emass_client/ruby_client/lib/swagger_client/models/definition_transitions.rb +0 -274
  227. data/emass_client/ruby_client/lib/swagger_client/models/delete_milestone.rb +0 -212
  228. data/emass_client/ruby_client/lib/swagger_client/models/delete_poam.rb +0 -212
  229. data/emass_client/ruby_client/lib/swagger_client/models/empty200_response.rb +0 -197
  230. data/emass_client/ruby_client/lib/swagger_client/models/error.rb +0 -225
  231. data/emass_client/ruby_client/lib/swagger_client/models/instances_transitions.rb +0 -327
  232. data/emass_client/ruby_client/lib/swagger_client/models/milestone_response_get.rb +0 -217
  233. data/emass_client/ruby_client/lib/swagger_client/models/milestone_response_post.rb +0 -217
  234. data/emass_client/ruby_client/lib/swagger_client/models/milestone_response_put.rb +0 -217
  235. data/emass_client/ruby_client/lib/swagger_client/models/milestones_delete.rb +0 -197
  236. data/emass_client/ruby_client/lib/swagger_client/models/milestones_get.rb +0 -291
  237. data/emass_client/ruby_client/lib/swagger_client/models/milestones_post.rb +0 -197
  238. data/emass_client/ruby_client/lib/swagger_client/models/milestones_put.rb +0 -197
  239. data/emass_client/ruby_client/lib/swagger_client/models/milestones_put_post_delete.rb +0 -247
  240. data/emass_client/ruby_client/lib/swagger_client/models/milestones_request_post_body.rb +0 -242
  241. data/emass_client/ruby_client/lib/swagger_client/models/milestones_request_put_body.rb +0 -242
  242. data/emass_client/ruby_client/lib/swagger_client/models/milestones_required_post.rb +0 -227
  243. data/emass_client/ruby_client/lib/swagger_client/models/milestones_required_put.rb +0 -242
  244. data/emass_client/ruby_client/lib/swagger_client/models/model_200.rb +0 -208
  245. data/emass_client/ruby_client/lib/swagger_client/models/model_201.rb +0 -206
  246. data/emass_client/ruby_client/lib/swagger_client/models/model_201_meta.rb +0 -219
  247. data/emass_client/ruby_client/lib/swagger_client/models/model_400.rb +0 -206
  248. data/emass_client/ruby_client/lib/swagger_client/models/model_400_meta.rb +0 -219
  249. data/emass_client/ruby_client/lib/swagger_client/models/model_400_response.rb +0 -206
  250. data/emass_client/ruby_client/lib/swagger_client/models/model_401.rb +0 -206
  251. data/emass_client/ruby_client/lib/swagger_client/models/model_401_meta.rb +0 -219
  252. data/emass_client/ruby_client/lib/swagger_client/models/model_403.rb +0 -206
  253. data/emass_client/ruby_client/lib/swagger_client/models/model_403_meta.rb +0 -219
  254. data/emass_client/ruby_client/lib/swagger_client/models/model_404.rb +0 -219
  255. data/emass_client/ruby_client/lib/swagger_client/models/model_404_response.rb +0 -206
  256. data/emass_client/ruby_client/lib/swagger_client/models/model_405.rb +0 -206
  257. data/emass_client/ruby_client/lib/swagger_client/models/model_405_meta.rb +0 -219
  258. data/emass_client/ruby_client/lib/swagger_client/models/model_411.rb +0 -206
  259. data/emass_client/ruby_client/lib/swagger_client/models/model_411_meta.rb +0 -219
  260. data/emass_client/ruby_client/lib/swagger_client/models/model_490.rb +0 -206
  261. data/emass_client/ruby_client/lib/swagger_client/models/model_490_meta.rb +0 -219
  262. data/emass_client/ruby_client/lib/swagger_client/models/model_500.rb +0 -206
  263. data/emass_client/ruby_client/lib/swagger_client/models/model_500_meta.rb +0 -219
  264. data/emass_client/ruby_client/lib/swagger_client/models/pac_get.rb +0 -311
  265. data/emass_client/ruby_client/lib/swagger_client/models/pac_post.rb +0 -259
  266. data/emass_client/ruby_client/lib/swagger_client/models/pac_request_post_body.rb +0 -261
  267. data/emass_client/ruby_client/lib/swagger_client/models/pac_response_get.rb +0 -217
  268. data/emass_client/ruby_client/lib/swagger_client/models/pac_response_post.rb +0 -217
  269. data/emass_client/ruby_client/lib/swagger_client/models/poam_delete.rb +0 -197
  270. data/emass_client/ruby_client/lib/swagger_client/models/poam_get.rb +0 -646
  271. data/emass_client/ruby_client/lib/swagger_client/models/poam_post.rb +0 -197
  272. data/emass_client/ruby_client/lib/swagger_client/models/poam_post_put_del.rb +0 -237
  273. data/emass_client/ruby_client/lib/swagger_client/models/poam_put.rb +0 -197
  274. data/emass_client/ruby_client/lib/swagger_client/models/poam_request_post_body.rb +0 -197
  275. data/emass_client/ruby_client/lib/swagger_client/models/poam_request_put_body.rb +0 -197
  276. data/emass_client/ruby_client/lib/swagger_client/models/poam_required_post.rb +0 -564
  277. data/emass_client/ruby_client/lib/swagger_client/models/poam_required_put.rb +0 -594
  278. data/emass_client/ruby_client/lib/swagger_client/models/poam_response_delete.rb +0 -217
  279. data/emass_client/ruby_client/lib/swagger_client/models/poam_response_get.rb +0 -217
  280. data/emass_client/ruby_client/lib/swagger_client/models/poam_response_post.rb +0 -217
  281. data/emass_client/ruby_client/lib/swagger_client/models/poam_response_put.rb +0 -217
  282. data/emass_client/ruby_client/lib/swagger_client/models/register.rb +0 -215
  283. data/emass_client/ruby_client/lib/swagger_client/models/register_data.rb +0 -206
  284. data/emass_client/ruby_client/lib/swagger_client/models/register_user_request_post_body.rb +0 -211
  285. data/emass_client/ruby_client/lib/swagger_client/models/role_category.rb +0 -272
  286. data/emass_client/ruby_client/lib/swagger_client/models/roles.rb +0 -274
  287. data/emass_client/ruby_client/lib/swagger_client/models/ssps.rb +0 -227
  288. data/emass_client/ruby_client/lib/swagger_client/models/stage.rb +0 -252
  289. data/emass_client/ruby_client/lib/swagger_client/models/static_code_application.rb +0 -303
  290. data/emass_client/ruby_client/lib/swagger_client/models/static_code_request_post_body.rb +0 -197
  291. data/emass_client/ruby_client/lib/swagger_client/models/static_code_required_post.rb +0 -217
  292. data/emass_client/ruby_client/lib/swagger_client/models/static_code_required_post_application.rb +0 -217
  293. data/emass_client/ruby_client/lib/swagger_client/models/success200_response.rb +0 -217
  294. data/emass_client/ruby_client/lib/swagger_client/models/system_id_artifacts_body.rb +0 -284
  295. data/emass_client/ruby_client/lib/swagger_client/models/system_response.rb +0 -217
  296. data/emass_client/ruby_client/lib/swagger_client/models/system_roles_category_response.rb +0 -217
  297. data/emass_client/ruby_client/lib/swagger_client/models/system_roles_response.rb +0 -217
  298. data/emass_client/ruby_client/lib/swagger_client/models/system_roles_response_data.rb +0 -219
  299. data/emass_client/ruby_client/lib/swagger_client/models/systems.rb +0 -1137
  300. data/emass_client/ruby_client/lib/swagger_client/models/test.rb +0 -215
  301. data/emass_client/ruby_client/lib/swagger_client/models/test_data.rb +0 -206
  302. data/emass_client/ruby_client/lib/swagger_client/models/test_results_get.rb +0 -333
  303. data/emass_client/ruby_client/lib/swagger_client/models/test_results_post.rb +0 -227
  304. data/emass_client/ruby_client/lib/swagger_client/models/test_results_request_post_body.rb +0 -306
  305. data/emass_client/ruby_client/lib/swagger_client/models/test_results_response_get.rb +0 -217
  306. data/emass_client/ruby_client/lib/swagger_client/models/test_results_response_post.rb +0 -217
  307. data/emass_client/ruby_client/lib/swagger_client/models/users.rb +0 -224
  308. data/emass_client/ruby_client/lib/swagger_client/models/workflow_definition_get.rb +0 -282
  309. data/emass_client/ruby_client/lib/swagger_client/models/workflow_definition_response_get.rb +0 -217
  310. data/emass_client/ruby_client/lib/swagger_client/models/workflow_instances_get.rb +0 -368
  311. data/emass_client/ruby_client/lib/swagger_client/models/workflow_instances_response_get.rb +0 -217
  312. data/emass_client/ruby_client/lib/swagger_client/version.rb +0 -14
  313. data/emass_client/ruby_client/lib/swagger_client.rb +0 -161
  314. data/emass_client/ruby_client/spec/api/artifacts_api_spec.rb +0 -92
  315. data/emass_client/ruby_client/spec/api/artifacts_export_api_spec.rb +0 -48
  316. data/emass_client/ruby_client/spec/api/cac_api_spec.rb +0 -60
  317. data/emass_client/ruby_client/spec/api/cmmc_assessments_api_spec.rb +0 -46
  318. data/emass_client/ruby_client/spec/api/controls_api_spec.rb +0 -60
  319. data/emass_client/ruby_client/spec/api/milestones_api_spec.rb +0 -105
  320. data/emass_client/ruby_client/spec/api/pac_api_spec.rb +0 -59
  321. data/emass_client/ruby_client/spec/api/poam_api_spec.rb +0 -103
  322. data/emass_client/ruby_client/spec/api/registration_api_spec.rb +0 -46
  323. data/emass_client/ruby_client/spec/api/static_code_scans_api_spec.rb +0 -47
  324. data/emass_client/ruby_client/spec/api/system_roles_api_spec.rb +0 -60
  325. data/emass_client/ruby_client/spec/api/systems_api_spec.rb +0 -67
  326. data/emass_client/ruby_client/spec/api/test_api_spec.rb +0 -45
  327. data/emass_client/ruby_client/spec/api/test_results_api_spec.rb +0 -62
  328. data/emass_client/ruby_client/spec/api/workflow_definitions_api_spec.rb +0 -47
  329. data/emass_client/ruby_client/spec/api/workflow_instances_api_spec.rb +0 -63
  330. data/emass_client/ruby_client/spec/api_client_spec.rb +0 -225
  331. data/emass_client/ruby_client/spec/base_object_spec.rb +0 -109
  332. data/emass_client/ruby_client/spec/configuration_spec.rb +0 -41
  333. data/emass_client/ruby_client/spec/models/artifacts_delete_inner_spec.rb +0 -40
  334. data/emass_client/ruby_client/spec/models/artifacts_delete_spec.rb +0 -34
  335. data/emass_client/ruby_client/spec/models/artifacts_get_spec.rb +0 -126
  336. data/emass_client/ruby_client/spec/models/artifacts_request_put_body_spec.rb +0 -102
  337. data/emass_client/ruby_client/spec/models/artifacts_response_del_data_spec.rb +0 -52
  338. data/emass_client/ruby_client/spec/models/artifacts_response_del_spec.rb +0 -46
  339. data/emass_client/ruby_client/spec/models/artifacts_response_get_spec.rb +0 -46
  340. data/emass_client/ruby_client/spec/models/artifacts_response_put_post_spec.rb +0 -46
  341. data/emass_client/ruby_client/spec/models/cac_get_spec.rb +0 -80
  342. data/emass_client/ruby_client/spec/models/cac_request_post_body_spec.rb +0 -46
  343. data/emass_client/ruby_client/spec/models/cac_response_get_spec.rb +0 -46
  344. data/emass_client/ruby_client/spec/models/cac_response_post_data_spec.rb +0 -52
  345. data/emass_client/ruby_client/spec/models/cac_response_post_spec.rb +0 -46
  346. data/emass_client/ruby_client/spec/models/cmmc_get_spec.rb +0 -128
  347. data/emass_client/ruby_client/spec/models/cmmc_response_get_spec.rb +0 -46
  348. data/emass_client/ruby_client/spec/models/connectivity_ccsd_spec.rb +0 -46
  349. data/emass_client/ruby_client/spec/models/controls_get_spec.rb +0 -262
  350. data/emass_client/ruby_client/spec/models/controls_put_spec.rb +0 -52
  351. data/emass_client/ruby_client/spec/models/controls_request_put_body_spec.rb +0 -216
  352. data/emass_client/ruby_client/spec/models/controls_response_get_spec.rb +0 -46
  353. data/emass_client/ruby_client/spec/models/controls_response_put_spec.rb +0 -46
  354. data/emass_client/ruby_client/spec/models/definition_transitions_spec.rb +0 -64
  355. data/emass_client/ruby_client/spec/models/delete_milestone_spec.rb +0 -40
  356. data/emass_client/ruby_client/spec/models/delete_poam_spec.rb +0 -40
  357. data/emass_client/ruby_client/spec/models/empty200_response_spec.rb +0 -34
  358. data/emass_client/ruby_client/spec/models/error_spec.rb +0 -46
  359. data/emass_client/ruby_client/spec/models/instances_transitions_spec.rb +0 -86
  360. data/emass_client/ruby_client/spec/models/milestone_response_get_spec.rb +0 -46
  361. data/emass_client/ruby_client/spec/models/milestone_response_post_spec.rb +0 -46
  362. data/emass_client/ruby_client/spec/models/milestone_response_put_spec.rb +0 -46
  363. data/emass_client/ruby_client/spec/models/milestones_delete_spec.rb +0 -34
  364. data/emass_client/ruby_client/spec/models/milestones_get_spec.rb +0 -74
  365. data/emass_client/ruby_client/spec/models/milestones_post_spec.rb +0 -34
  366. data/emass_client/ruby_client/spec/models/milestones_put_post_delete_spec.rb +0 -64
  367. data/emass_client/ruby_client/spec/models/milestones_put_spec.rb +0 -34
  368. data/emass_client/ruby_client/spec/models/milestones_request_post_body_spec.rb +0 -52
  369. data/emass_client/ruby_client/spec/models/milestones_request_put_body_spec.rb +0 -52
  370. data/emass_client/ruby_client/spec/models/milestones_required_post_spec.rb +0 -46
  371. data/emass_client/ruby_client/spec/models/milestones_required_put_spec.rb +0 -52
  372. data/emass_client/ruby_client/spec/models/model_200_spec.rb +0 -40
  373. data/emass_client/ruby_client/spec/models/model_201_meta_spec.rb +0 -46
  374. data/emass_client/ruby_client/spec/models/model_201_spec.rb +0 -40
  375. data/emass_client/ruby_client/spec/models/model_400_meta_spec.rb +0 -46
  376. data/emass_client/ruby_client/spec/models/model_400_response_spec.rb +0 -40
  377. data/emass_client/ruby_client/spec/models/model_400_spec.rb +0 -40
  378. data/emass_client/ruby_client/spec/models/model_401_meta_spec.rb +0 -46
  379. data/emass_client/ruby_client/spec/models/model_401_spec.rb +0 -40
  380. data/emass_client/ruby_client/spec/models/model_403_meta_spec.rb +0 -46
  381. data/emass_client/ruby_client/spec/models/model_403_spec.rb +0 -40
  382. data/emass_client/ruby_client/spec/models/model_404_response_spec.rb +0 -40
  383. data/emass_client/ruby_client/spec/models/model_404_spec.rb +0 -46
  384. data/emass_client/ruby_client/spec/models/model_405_meta_spec.rb +0 -46
  385. data/emass_client/ruby_client/spec/models/model_405_spec.rb +0 -40
  386. data/emass_client/ruby_client/spec/models/model_411_meta_spec.rb +0 -46
  387. data/emass_client/ruby_client/spec/models/model_411_spec.rb +0 -40
  388. data/emass_client/ruby_client/spec/models/model_490_meta_spec.rb +0 -46
  389. data/emass_client/ruby_client/spec/models/model_490_spec.rb +0 -40
  390. data/emass_client/ruby_client/spec/models/model_500_meta_spec.rb +0 -46
  391. data/emass_client/ruby_client/spec/models/model_500_spec.rb +0 -40
  392. data/emass_client/ruby_client/spec/models/pac_get_spec.rb +0 -86
  393. data/emass_client/ruby_client/spec/models/pac_post_spec.rb +0 -56
  394. data/emass_client/ruby_client/spec/models/pac_request_post_body_spec.rb +0 -56
  395. data/emass_client/ruby_client/spec/models/pac_response_get_spec.rb +0 -46
  396. data/emass_client/ruby_client/spec/models/pac_response_post_spec.rb +0 -46
  397. data/emass_client/ruby_client/spec/models/poam_delete_spec.rb +0 -34
  398. data/emass_client/ruby_client/spec/models/poam_get_spec.rb +0 -264
  399. data/emass_client/ruby_client/spec/models/poam_post_put_del_spec.rb +0 -58
  400. data/emass_client/ruby_client/spec/models/poam_post_spec.rb +0 -34
  401. data/emass_client/ruby_client/spec/models/poam_put_spec.rb +0 -34
  402. data/emass_client/ruby_client/spec/models/poam_request_post_body_spec.rb +0 -34
  403. data/emass_client/ruby_client/spec/models/poam_request_put_body_spec.rb +0 -34
  404. data/emass_client/ruby_client/spec/models/poam_required_post_spec.rb +0 -218
  405. data/emass_client/ruby_client/spec/models/poam_required_put_spec.rb +0 -236
  406. data/emass_client/ruby_client/spec/models/poam_response_delete_spec.rb +0 -46
  407. data/emass_client/ruby_client/spec/models/poam_response_get_spec.rb +0 -46
  408. data/emass_client/ruby_client/spec/models/poam_response_post_spec.rb +0 -46
  409. data/emass_client/ruby_client/spec/models/poam_response_put_spec.rb +0 -46
  410. data/emass_client/ruby_client/spec/models/register_data_spec.rb +0 -40
  411. data/emass_client/ruby_client/spec/models/register_spec.rb +0 -46
  412. data/emass_client/ruby_client/spec/models/register_user_request_post_body_spec.rb +0 -40
  413. data/emass_client/ruby_client/spec/models/role_category_spec.rb +0 -62
  414. data/emass_client/ruby_client/spec/models/roles_spec.rb +0 -60
  415. data/emass_client/ruby_client/spec/models/ssps_spec.rb +0 -52
  416. data/emass_client/ruby_client/spec/models/stage_spec.rb +0 -50
  417. data/emass_client/ruby_client/spec/models/static_code_application_spec.rb +0 -78
  418. data/emass_client/ruby_client/spec/models/static_code_request_post_body_spec.rb +0 -34
  419. data/emass_client/ruby_client/spec/models/static_code_required_post_application_spec.rb +0 -46
  420. data/emass_client/ruby_client/spec/models/static_code_required_post_spec.rb +0 -46
  421. data/emass_client/ruby_client/spec/models/success200_response_spec.rb +0 -46
  422. data/emass_client/ruby_client/spec/models/system_id_artifacts_body_spec.rb +0 -66
  423. data/emass_client/ruby_client/spec/models/system_response_spec.rb +0 -46
  424. data/emass_client/ruby_client/spec/models/system_roles_category_response_spec.rb +0 -46
  425. data/emass_client/ruby_client/spec/models/system_roles_response_data_spec.rb +0 -46
  426. data/emass_client/ruby_client/spec/models/system_roles_response_spec.rb +0 -46
  427. data/emass_client/ruby_client/spec/models/systems_spec.rb +0 -510
  428. data/emass_client/ruby_client/spec/models/test_data_spec.rb +0 -40
  429. data/emass_client/ruby_client/spec/models/test_results_get_spec.rb +0 -96
  430. data/emass_client/ruby_client/spec/models/test_results_post_spec.rb +0 -52
  431. data/emass_client/ruby_client/spec/models/test_results_request_post_body_spec.rb +0 -68
  432. data/emass_client/ruby_client/spec/models/test_results_response_get_spec.rb +0 -46
  433. data/emass_client/ruby_client/spec/models/test_results_response_post_spec.rb +0 -46
  434. data/emass_client/ruby_client/spec/models/test_spec.rb +0 -46
  435. data/emass_client/ruby_client/spec/models/users_spec.rb +0 -52
  436. data/emass_client/ruby_client/spec/models/workflow_definition_get_spec.rb +0 -68
  437. data/emass_client/ruby_client/spec/models/workflow_definition_response_get_spec.rb +0 -46
  438. data/emass_client/ruby_client/spec/models/workflow_instances_get_spec.rb +0 -110
  439. data/emass_client/ruby_client/spec/models/workflow_instances_response_get_spec.rb +0 -46
  440. data/emass_client/ruby_client/spec/spec_helper.rb +0 -110
  441. data/emass_client/ruby_client/swagger_client.gemspec +0 -38
  442. data/emass_client/swagger-codegen/ruby_template/api_client.mustache +0 -384
  443. data/emass_client/swagger-codegen/ruby_template/api_info.mustache +0 -12
  444. data/emass_client/swagger-codegen/ruby_template/configuration.mustache +0 -234
  445. data/emass_client/swagger-codegen/ruby_template/gemspec.mustache +0 -37
data/emasser.gemspec CHANGED
@@ -6,32 +6,36 @@ Gem::Specification.new do |spec|
6
6
  spec.name = 'emasser'
7
7
  spec.version = Emasser::VERSION
8
8
  spec.authors = ['Amndeep Singh Mann', 'George Dias', 'Kyle Fagan', 'Robert Clark', 'Aaron Lippold']
9
- spec.email = ['saf@mitre.org']
9
+ spec.email = ['saf@groups.mitre.org']
10
+ spec.licenses = ['Apache-2.0']
10
11
 
11
12
  spec.summary = 'Provide an automated capability for invoving eMASS API endpoints'
12
- spec.description = 'emasser can be used as a gem or used from the command line to access eMASS via thei API.'
13
+ spec.description = 'emasser can be used as a gem or used from the command line (CL) to access eMASS endpoints via their API.'
13
14
  spec.homepage = 'https://saf.mitre.org'
14
15
  spec.required_ruby_version = Gem::Requirement.new('~> 2.5')
15
16
 
16
17
  # Specify which files should be added to the gem when it is released.
17
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
19
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(emass_client|test|spec|features)/}) }
20
21
  end
21
22
  spec.bindir = 'exe'
22
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ # References: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry
25
+ spec.metadata = { "github_repo" => "ssh://github.com/mitre/emasser" }
23
26
 
24
- spec.add_runtime_dependency 'activesupport'
25
- spec.add_runtime_dependency 'colorize'
26
- spec.add_runtime_dependency 'dotenv'
27
- spec.add_runtime_dependency 'rubyzip'
28
- spec.add_runtime_dependency 'swagger_client'
27
+ spec.add_runtime_dependency 'activesupport', '~> 6.1.4'
28
+ spec.add_runtime_dependency 'colorize', '~> 0.8.1'
29
+ spec.add_runtime_dependency 'dotenv', '~> 2.7.6'
30
+ spec.add_runtime_dependency 'rubyzip', '~> 2.3.2'
31
+ spec.add_runtime_dependency 'thor', '~> 1.1.0'
32
+ spec.add_runtime_dependency 'emass_client', '~> 1.0', '!= 1.0.3'
29
33
 
30
- spec.add_development_dependency 'bundler', '~> 2.1'
34
+ spec.add_development_dependency 'bundler', '~> 2.3'
31
35
  spec.add_development_dependency 'bundler-audit', '~> 0.7'
32
- spec.add_development_dependency 'byebug'
33
- spec.add_development_dependency 'rspec', '~>3.10.0'
34
- spec.add_development_dependency 'yaml', '~>0.2.0'
36
+ spec.add_development_dependency 'byebug', '~> 11.1.3'
37
+ spec.add_development_dependency 'rspec', '~> 3.10.0'
38
+ spec.add_development_dependency 'yaml', '~> 0.2.0'
35
39
  spec.add_development_dependency 'rake', '~> 13.0'
36
40
  spec.add_development_dependency 'rubocop', '~> 1.7'
37
41
  spec.add_development_dependency 'rubocop-minitest', '~> 0.10'
data/exe/emasser CHANGED
File without changes
Binary file
Binary file
data/lib/emasser/cli.rb CHANGED
@@ -16,6 +16,18 @@ module Emasser
16
16
  elsif ARGV[0].to_s.include? 'del'
17
17
  require 'emasser/delete'
18
18
  register(Emasser::Delete, 'delete', 'delete [RESOURCE]', 'Deletes resources')
19
+ elsif (ARGV[0].to_s.include? '-v') || (ARGV[0].to_s.include? '-V')
20
+ puts "emasser version: #{Emasser::VERSION}".green
21
+ exit
22
+ elsif ARGV[0].to_s.include? 'hello'
23
+ user_name = ENV.fetch('USERNAME', 'rookie')
24
+ puts "Hello #{user_name} - enjoy using emasser version #{Emasser::VERSION}!".cyan
25
+ exit
26
+ end
27
+
28
+ def help
29
+ puts 'Emasser commands:'.yellow
30
+ puts ' emasser [get, put, post, delete, -v, or -V]'.yellow
19
31
  end
20
32
 
21
33
  def self.exit_on_failure?
@@ -8,26 +8,41 @@ module Emasser
8
8
  def self.raise_unless_present(env)
9
9
  ENV.fetch(env) { raise Emasser::ConfigurationMissingError.new(env) }
10
10
  rescue Emasser::ConfigurationMissingError => e
11
- puts e.message.red
12
- puts 'See emasser environment variables requirements in emasser CLI Features'
11
+ if (ARGV[0].to_s.include? '-v') || (ARGV[0].to_s.include? '-V')
12
+ puts "emasser version: #{Emasser::VERSION}".green
13
+ else
14
+ puts "\n", e.message.red
15
+ puts 'Create a .env file containing required variables, place it in the root directory where the emasser command is executed'.yellow
16
+ puts 'Required environment variables are:'.yellow
17
+ puts ' export EMASSER_API_KEY_API_KEY=<API key>'.green
18
+ puts ' export EMASSER_API_KEY_USER_UID=<unique identifier of the eMASS user EMASSER_API_KEY_API_KEY belongs to>'.green
19
+ puts ' export EMASSER_HOST=<FQDN of the eMASS server>'.green
20
+ puts ' export EMASSER_KEY_FILE_PATH=<path to your emass key in PEM format>'.green
21
+ puts ' export EMASSER_CERT_FILE_PATH=<path to your emass certficate in PEM format>'.green
22
+ puts ' export EMASSER_KEY_PASSWORD=<password for the key given in EMASSER_KEY_FILE_PATH>'.green, "\n"
23
+ puts 'See emasser environment variables requirements in emasser CLI Features for more information (https://mitre.github.io/emasser/docs/features.html).', "\n"
24
+ end
13
25
  exit
14
26
  end
15
27
  # rubocop: enable Style/RaiseArgs
16
28
 
17
29
  # rubocop: disable Style/TernaryParentheses, Style/IfWithBooleanLiteralBranches
18
- SwaggerClient.configure do |config|
30
+ EmassClient.configure do |config|
31
+ # Required env variables
19
32
  config.api_key['api-key'] = raise_unless_present('EMASSER_API_KEY_API_KEY')
20
33
  config.api_key['user-uid'] = raise_unless_present('EMASSER_API_KEY_USER_UID')
21
34
  config.scheme = 'https'
22
35
  config.base_path = '/'
36
+ config.server_index = nil
23
37
  config.host = raise_unless_present('EMASSER_HOST')
24
38
  config.key_file = raise_unless_present('EMASSER_KEY_FILE_PATH')
25
39
  config.cert_file = raise_unless_present('EMASSER_CERT_FILE_PATH')
26
40
  config.key_password = raise_unless_present('EMASSER_KEY_PASSWORD')
27
- config.client_side_validation = (raise_unless_present('EMASSER_CLIENT_SIDE_VALIDATION') == 'false') ? false : true
28
- config.verify_ssl = (raise_unless_present('EMASSER_VERIFY_SSL') == 'false') ? false : true
29
- config.verify_ssl_host = (raise_unless_present('EMASSER_VERIFY_SSL_HOST') == 'false') ? false : true
30
- config.debugging = (ENV.fetch('EMASSER_DEBUGGING', false) == 'true') ? true : false
41
+ # Optional env variables
42
+ config.client_side_validation = (ENV.fetch('EMASSER_CLIENT_SIDE_VALIDATION', 'true').eql? 'true') ? true : false
43
+ config.verify_ssl = (ENV.fetch('EMASSER_VERIFY_SSL', 'true').eql? 'true') ? true : false
44
+ config.verify_ssl_host = (ENV.fetch('EMASSER_VERIFY_SSL_HOST', 'true').eql? 'true') ? true : false
45
+ config.debugging = (ENV.fetch('EMASSER_DEBUGGING', 'false') == 'false') ? false : true
31
46
  end
32
47
  # rubocop: enable Style/TernaryParentheses, Style/IfWithBooleanLiteralBranches
33
48
  end
@@ -5,14 +5,22 @@ module Emasser
5
5
  include_package: false,
6
6
  include_ditpr_metrics: false,
7
7
  include_decommissioned: false,
8
- return_type: 'SystemResponse' # This is used by swagger client only to format output
8
+ debug_return_type: 'SystemResponse' # This is used by swagger client only to format output
9
9
  }.freeze
10
10
 
11
11
  GET_SYSTEM_RETURN_TYPE = {
12
- return_type: 'SystemResponse'
12
+ debug_return_type: 'SystemResponse'
13
13
  }.freeze
14
14
 
15
15
  GET_ARTIFACTS_RETURN_TYPE = {
16
- return_type: 'String'
16
+ debug_return_type: 'String'
17
+ }.freeze
18
+
19
+ GET_WORKFLOWINSTANCES_RETURN_TYPE = {
20
+ debug_return_type: 'Object'
21
+ }.freeze
22
+
23
+ DEL_MILESTONES_RETURN_TYPE = {
24
+ debug_return_type: 'Object'
17
25
  }.freeze
18
26
  end
@@ -47,7 +47,7 @@ module Emasser
47
47
  end
48
48
 
49
49
  # Delete a POAM -----------------------------------------------------------
50
- desc 'remove', 'Add one or many POA&M items in a system'
50
+ desc 'remove', 'Delete one or many POA&M items in a system'
51
51
  long_desc Help.text(:poam_del_mapper)
52
52
 
53
53
  # Required parameters/fields
@@ -55,13 +55,13 @@ module Emasser
55
55
  option :poamId, type: :numeric, required: true, desc: 'A numeric value representing the poam identification'
56
56
 
57
57
  def remove
58
- body = SwaggerClient::DeletePoam.new
58
+ body = EmassClient::PoamGet.new
59
59
  body.poam_id = options[:poamId]
60
60
  body_array = Array.new(1, body)
61
61
 
62
- result = SwaggerClient::POAMApi.new.delete_poam(body_array, options[:systemId])
62
+ result = EmassClient::POAMApi.new.delete_poam(options[:systemId], body_array)
63
63
  puts to_output_hash(result).green
64
- rescue SwaggerClient::ApiError => e
64
+ rescue EmassClient::ApiError => e
65
65
  puts 'Exception when calling POAMApi->delete_poam'.red
66
66
  puts to_output_hash(e)
67
67
  end
@@ -88,16 +88,18 @@ module Emasser
88
88
  desc: 'A numeric value representing the milestone identification'
89
89
 
90
90
  def remove
91
- body = SwaggerClient::DeleteMilestone.new
91
+ body = EmassClient::MilestonesGet.new
92
92
  body.milestone_id = options[:milestoneId]
93
93
  body_array = Array.new(1, body)
94
94
 
95
- result = SwaggerClient::MilestonesApi.new.delete_milestone(body_array, options[:systemId], options[:poamId])
96
- # The server returns an empty object upon successfully deleting a milestone.
95
+ # Getting an empty return when utilizing the default return type - using 'Object' as return type
96
+ opts = Emasser::DEL_MILESTONES_RETURN_TYPE
97
+
98
+ result = EmassClient::MilestonesApi.new.delete_milestone(options[:systemId], options[:poamId], body_array, opts)
97
99
  puts to_output_hash(result).green
98
- rescue SwaggerClient::ApiError => e
100
+ rescue EmassClient::ApiError => e
99
101
  puts 'Exception when calling MilestonesApi->delete_milestone'.red
100
- puts to_output_hash(e)
102
+ puts to_output_hash(e).yellow
101
103
  end
102
104
  end
103
105
 
@@ -110,7 +112,7 @@ module Emasser
110
112
  true
111
113
  end
112
114
 
113
- desc 'remove', 'Remove one or many artifacts in a system'
115
+ desc 'remove', 'Delete one or many artifacts in a system'
114
116
  long_desc Help.text(:artifact_del_mapper)
115
117
 
116
118
  # Required parameters/fields
@@ -125,9 +127,9 @@ module Emasser
125
127
  body_array << obj
126
128
  end
127
129
 
128
- result = SwaggerClient::ArtifactsApi.new.delete_artifact(body_array, options[:systemId])
130
+ result = EmassClient::ArtifactsApi.new.delete_artifact(options[:systemId], body_array)
129
131
  puts to_output_hash(result).green
130
- rescue SwaggerClient::ApiError => e
132
+ rescue EmassClient::ApiError => e
131
133
  puts 'Exception when calling ArtifactsApi->delete_artifact'.red
132
134
  puts to_output_hash(e)
133
135
  end
data/lib/emasser/get.rb CHANGED
@@ -40,9 +40,9 @@ module Emasser
40
40
  desc 'connection', 'Test connection to the API'
41
41
 
42
42
  def connection
43
- result = SwaggerClient::TestApi.new.test_connection
43
+ result = EmassClient::TestApi.new.test_connection
44
44
  puts to_output_hash(result).green
45
- rescue SwaggerClient::ApiError => e
45
+ rescue EmassClient::ApiError => e
46
46
  puts 'Exception when calling TestApi->test_connection'.red
47
47
  puts to_output_hash(e)
48
48
  end
@@ -58,9 +58,8 @@ module Emasser
58
58
  true
59
59
  end
60
60
 
61
- desc 'id [--system-name [SYSTEM_NAME]] [--system-owner [SYSTEM_OWNER]]',
61
+ desc 'id [--system_name [SYSTEM_NAME]] [--system_owner [SYSTEM_OWNER]]',
62
62
  'Attempts to provide system ID of a system with name [NAME] and owner [SYSTEM_OWNER]'
63
- # desc 'id', 'Get a system ID given "name" or "owner"'
64
63
 
65
64
  # Required parameters/fields
66
65
  option :system_name
@@ -73,26 +72,29 @@ module Emasser
73
72
  end
74
73
 
75
74
  begin
76
- results = SwaggerClient::SystemsApi.new.get_systems.data
75
+ results = EmassClient::SystemsApi.new.get_systems
77
76
  results = filter_systems(results, options[:system_name], options[:system_owner])
78
77
  results.each { |result| puts "#{result[:systemId]} - #{result[:systemOwner]} - #{result[:name]}" }
79
- rescue SwaggerClient::ApiError => e
78
+ rescue EmassClient::ApiError => e
80
79
  puts 'Exception when calling SystemsApi->get_systems'
81
- puts to_output_hash(e)
80
+ puts to_output_hash(e).yellow
82
81
  end
83
82
  end
84
83
 
84
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
85
85
  no_commands do
86
86
  def filter_systems(results, system_name = nil, system_owner = nil)
87
+ results = results.to_body if results.respond_to?(:to_body)
87
88
  if system_owner.nil?
88
- results.filter { |result| result[:name].eql?(system_name) }
89
+ results[:data].filter { |result| result[:name].eql?(system_name) }
89
90
  elsif system_name.nil?
90
- results.filter { |result| result[:systemOwner].eql?(system_owner) }
91
+ results[:data].filter { |result| result[:systemOwner].eql?(system_owner) }
91
92
  else
92
- results.filter { |result| result[:name].eql?(system_name) && result[:systemOwner].eql?(system_owner) }
93
+ results[:data].filter { |result| result[:name].eql?(system_name) && result[:systemOwner].eql?(system_owner) }
93
94
  end
94
95
  end
95
96
  end
97
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
96
98
 
97
99
  desc "byId \[options\]", 'Retrieve a system - filtered by [options] params'
98
100
  option :systemId, type: :numeric, required: true,
@@ -107,11 +109,11 @@ module Emasser
107
109
 
108
110
  begin
109
111
  # Get system information matching provided parameters
110
- result = SwaggerClient::SystemsApi.new.get_system(options[:systemId], optional_options)
112
+ result = EmassClient::SystemsApi.new.get_system(options[:systemId], optional_options)
111
113
  puts to_output_hash(result).green
112
- rescue SwaggerClient::ApiError => e
113
- puts 'Exception when calling SystemsApi->get_systems'.red
114
- puts to_output_hash(e)
114
+ rescue EmassClient::ApiError => e
115
+ puts 'Exception when calling SystemsApi->get_system'.red
116
+ puts to_output_hash(e).yellow
115
117
  end
116
118
  end
117
119
  end
@@ -144,11 +146,11 @@ module Emasser
144
146
 
145
147
  begin
146
148
  # Get system information matching provided parameters
147
- result = SwaggerClient::SystemsApi.new.get_systems(optional_options)
149
+ result = EmassClient::SystemsApi.new.get_systems(optional_options)
148
150
  puts to_output_hash(result).green
149
- rescue SwaggerClient::ApiError => e
151
+ rescue EmassClient::ApiError => e
150
152
  puts 'Exception when calling SystemsApi->get_systems'.red
151
- puts to_output_hash(e)
153
+ puts to_output_hash(e).yellow
152
154
  end
153
155
  end
154
156
  end
@@ -170,11 +172,11 @@ module Emasser
170
172
  desc 'all', 'Retrieves all available system roles'
171
173
 
172
174
  def all
173
- result = SwaggerClient::SystemRolesApi.new.get_system_roles
175
+ result = EmassClient::SystemRolesApi.new.get_system_roles
174
176
  puts to_output_hash(result).green
175
- rescue SwaggerClient::ApiError => e
177
+ rescue EmassClient::ApiError => e
176
178
  puts 'Exception when calling SystemRolesApi->get_system_roles'.red
177
- puts to_output_hash(e)
179
+ puts to_output_hash(e).yellow
178
180
  end
179
181
 
180
182
  desc "byCategory \[options\]", 'Retrieves role(s) - filtered by [options] params'
@@ -184,7 +186,7 @@ module Emasser
184
186
  enum: ['AO', 'Auditor', 'Artifact Manager', 'C&A Team', 'IAO',
185
187
  'ISSO', 'PM/IAM', 'SCA', 'User Rep', 'Validator']
186
188
  # Optional parameters/fields
187
- option :policy, type: :string, required: false, enum: %w[diacap rmf reporting]
189
+ option :policy, type: :string, required: false, default: 'rmf', enum: %w[diacap rmf reporting]
188
190
  option :includeDecommissioned, type: :boolean, required: false, desc: 'BOOLEAN - true or false.'
189
191
 
190
192
  def byCategory
@@ -192,12 +194,12 @@ module Emasser
192
194
  optional_options = to_input_hash(optional_options_keys, options)
193
195
 
194
196
  begin
195
- result = SwaggerClient::SystemRolesApi.new.get_system_roles_by_category_id(options[:roleCategory],
196
- options[:role], optional_options)
197
+ result = EmassClient::SystemRolesApi.new.get_system_roles_by_category_id(options[:roleCategory],
198
+ options[:role], optional_options)
197
199
  puts to_output_hash(result).green
198
- rescue SwaggerClient::ApiError => e
200
+ rescue EmassClient::ApiError => e
199
201
  puts 'Exception when calling SystemRolesApi->get_system_by_role_category_id'.red
200
- puts to_output_hash(e)
202
+ puts to_output_hash(e).yellow
201
203
  end
202
204
  end
203
205
  end
@@ -226,11 +228,11 @@ module Emasser
226
228
  optional_options = to_input_hash(optional_options_keys, options)
227
229
 
228
230
  begin
229
- result = SwaggerClient::ControlsApi.new.get_system_controls(options[:systemId], optional_options)
231
+ result = EmassClient::ControlsApi.new.get_system_controls(options[:systemId], optional_options)
230
232
  puts to_output_hash(result).green
231
- rescue SwaggerClient::ApiError => e
233
+ rescue EmassClient::ApiError => e
232
234
  puts 'Exception when calling ControlsApi->get_system_controls'.red
233
- puts to_output_hash(e)
235
+ puts to_output_hash(e).yellow
234
236
  end
235
237
  end
236
238
  end
@@ -259,11 +261,11 @@ module Emasser
259
261
  optional_options = to_input_hash(optional_options_keys, options)
260
262
 
261
263
  begin
262
- result = SwaggerClient::TestResultsApi.new.get_system_test_results(options[:systemId], optional_options)
264
+ result = EmassClient::TestResultsApi.new.get_system_test_results(options[:systemId], optional_options)
263
265
  puts to_output_hash(result).green
264
- rescue SwaggerClient::ApiError => e
266
+ rescue EmassClient::ApiError => e
265
267
  puts 'Exception when calling TestResultsApi->get_system_test_results'.red
266
- puts to_output_hash(e)
268
+ puts to_output_hash(e).yellow
267
269
  end
268
270
  end
269
271
  end
@@ -289,8 +291,8 @@ module Emasser
289
291
  desc: 'The schedule completion start date - Unix time format.'
290
292
  option :scheduledCompletionDateEnd, type: :numeric, required: false,
291
293
  desc: 'The scheduled completion end date - Unix time format.'
292
- option :controlAcronyms, type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1, AC-2"'
293
- option :ccis, type: :string, required: false, desc: 'The system CCIS string numerical value'
294
+ option :controlAcronyms, type: :string, required: false, desc: 'The system acronym(s) e.g "AC-1" or "AC-1, AC-2"'
295
+ option :ccis, type: :string, required: false, desc: 'The system CCIS string numerical value e.g "000123" or "000123,000069"'
294
296
  option :systemOnly, type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
295
297
 
296
298
  def forSystem
@@ -298,11 +300,11 @@ module Emasser
298
300
  optional_options = to_input_hash(optional_options_keys, options)
299
301
 
300
302
  begin
301
- result = SwaggerClient::POAMApi.new.get_system_poams(options[:systemId], optional_options)
303
+ result = EmassClient::POAMApi.new.get_system_poams(options[:systemId], optional_options)
302
304
  puts to_output_hash(result).green
303
- rescue SwaggerClient::ApiError => e
305
+ rescue EmassClient::ApiError => e
304
306
  puts 'Exception when calling POAMApi->get_system_poams'.red
305
- puts to_output_hash(e)
307
+ puts to_output_hash(e).yellow
306
308
  end
307
309
  end
308
310
 
@@ -315,11 +317,11 @@ module Emasser
315
317
  desc: 'A numeric value representing the poam identification'
316
318
 
317
319
  def byPoamId
318
- result = SwaggerClient::POAMApi.new.get_system_poams_by_poam_id(options[:systemId], options[:poamId])
320
+ result = EmassClient::POAMApi.new.get_system_poams_by_poam_id(options[:systemId], options[:poamId])
319
321
  puts to_output_hash(result).green
320
- rescue SwaggerClient::ApiError => e
322
+ rescue EmassClient::ApiError => e
321
323
  puts 'Exception when calling POAMApi->get_system_poams_by_poam_id'.red
322
- puts to_output_hash(e)
324
+ puts to_output_hash(e).yellow
323
325
  end
324
326
  end
325
327
 
@@ -351,12 +353,12 @@ module Emasser
351
353
 
352
354
  begin
353
355
  # Get milestones in one or many poa&m items in a system
354
- result = SwaggerClient::MilestonesApi.new.get_system_milestones_by_poam_id(options[:systemId],
355
- options[:poamId], optional_options)
356
+ result = EmassClient::MilestonesApi.new.get_system_milestones_by_poam_id(options[:systemId],
357
+ options[:poamId], optional_options)
356
358
  puts to_output_hash(result).green
357
- rescue SwaggerClient::ApiError => e
359
+ rescue EmassClient::ApiError => e
358
360
  puts 'Exception when calling MilestonesApi->get_system_milestones_by_poam_id'.red
359
- puts to_output_hash(e)
361
+ puts to_output_hash(e).yellow
360
362
  end
361
363
  end
362
364
 
@@ -371,13 +373,13 @@ module Emasser
371
373
  desc: 'A numeric value representing the milestone identification'
372
374
 
373
375
  def byMilestoneId
374
- result = SwaggerClient::MilestonesApi.new.get_system_milestones_by_poam_id_and_milestone_id(
376
+ result = EmassClient::MilestonesApi.new.get_system_milestones_by_poam_id_and_milestone_id(
375
377
  options[:systemId], options[:poamId], options[:milestoneId]
376
378
  )
377
379
  puts to_output_hash(result).green
378
- rescue SwaggerClient::ApiError => e
380
+ rescue EmassClient::ApiError => e
379
381
  puts 'Exception when calling MilestonesApi->get_system_milestones_by_poam_id_and_milestone_id'.red
380
- puts to_output_hash(e)
382
+ puts to_output_hash(e).yellow
381
383
  end
382
384
  end
383
385
 
@@ -393,7 +395,7 @@ module Emasser
393
395
  true
394
396
  end
395
397
 
396
- desc 'system', 'Get all system artifacts for a system Id'
398
+ desc 'forSystem', 'Get all system artifacts for a system Id'
397
399
  # Required parameters/fields
398
400
  option :systemId, type: :numeric, required: true,
399
401
  desc: 'A numeric value representing the system identification'
@@ -409,12 +411,12 @@ module Emasser
409
411
 
410
412
  begin
411
413
  # Get one or many artifacts in a system
412
- result = SwaggerClient::ArtifactsApi.new.get_system_artifacts(options[:systemId],
413
- optional_options)
414
+ result = EmassClient::ArtifactsApi.new.get_system_artifacts(options[:systemId],
415
+ optional_options)
414
416
  puts to_output_hash(result).green
415
- rescue SwaggerClient::ApiError => e
417
+ rescue EmassClient::ApiError => e
416
418
  puts 'Exception when calling ArtifactsApi->get_system_artifacts'.red
417
- puts to_output_hash(e)
419
+ puts to_output_hash(e).yellow
418
420
  end
419
421
  end
420
422
 
@@ -433,11 +435,11 @@ module Emasser
433
435
  optional_options = to_input_hash(optional_options_keys, options)
434
436
  optional_options.merge!(Emasser::GET_ARTIFACTS_RETURN_TYPE)
435
437
 
436
- result = SwaggerClient::ArtifactsExportApi.new.get_system_artifacts_export(
438
+ result = EmassClient::ArtifactsExportApi.new.get_system_artifacts_export(
437
439
  options[:systemId], options[:filename], optional_options
438
440
  )
439
441
  if options[:compress]
440
- p result.green
442
+ pp result
441
443
  else
442
444
  begin
443
445
  puts JSON.pretty_generate(JSON.parse(result)).green
@@ -445,9 +447,9 @@ module Emasser
445
447
  puts result.red
446
448
  end
447
449
  end
448
- rescue SwaggerClient::ApiError => e
450
+ rescue EmassClient::ApiError => e
449
451
  puts 'Exception when calling ArtifactsApi->get_system_artifacts_export'.red
450
- puts to_output_hash(e)
452
+ puts to_output_hash(e).yellow
451
453
  end
452
454
  end
453
455
 
@@ -479,11 +481,11 @@ module Emasser
479
481
 
480
482
  begin
481
483
  # Get location of one or many controls in CAC
482
- result = SwaggerClient::CACApi.new.get_system_cac(options[:systemId], optional_options)
484
+ result = EmassClient::CACApi.new.get_system_cac(options[:systemId], optional_options)
483
485
  puts to_output_hash(result).green
484
- rescue SwaggerClient::ApiError => e
486
+ rescue EmassClient::ApiError => e
485
487
  puts 'Exception when calling ApprovalChainApi->get_system_cac'.red
486
- puts to_output_hash(e)
488
+ puts to_output_hash(e).yellow
487
489
  end
488
490
  end
489
491
  end
@@ -510,11 +512,11 @@ module Emasser
510
512
 
511
513
  def package
512
514
  # Get location of system package in PAC
513
- result = SwaggerClient::PACApi.new.get_system_pac(options[:systemId])
515
+ result = EmassClient::PACApi.new.get_system_pac(options[:systemId])
514
516
  puts to_output_hash(result).green
515
- rescue SwaggerClient::ApiError => e
517
+ rescue EmassClient::ApiError => e
516
518
  puts 'Exception when calling ApprovalChainApi->get_system_'.red
517
- puts to_output_hash(e)
519
+ puts to_output_hash(e).yellow
518
520
  end
519
521
  end
520
522
 
@@ -535,11 +537,11 @@ module Emasser
535
537
  option :sinceDate, type: :string, required: true, desc: 'The CMMC date. Unix date format'
536
538
 
537
539
  def assessments
538
- result = SwaggerClient::CMMCAssessmentsApi.new.get_cmmc_assessments(options[:sinceDate])
540
+ result = EmassClient::CMMCAssessmentsApi.new.get_cmmc_assessments(options[:sinceDate])
539
541
  puts to_output_hash(result).green
540
- rescue SwaggerClient::ApiError => e
542
+ rescue EmassClient::ApiError => e
541
543
  puts 'Exception when calling ApprovalChainApi->get_cmmc_assessments'.red
542
- puts to_output_hash(e)
544
+ puts to_output_hash(e).yellow
543
545
  end
544
546
  end
545
547
 
@@ -565,11 +567,11 @@ module Emasser
565
567
  optional_options_keys = optional_options(@_initializer).keys
566
568
  optional_options = to_input_hash(optional_options_keys, options)
567
569
 
568
- result = SwaggerClient::WorkflowDefinitionsApi.new.get_workflow_definitions(optional_options)
570
+ result = EmassClient::WorkflowDefinitionsApi.new.get_workflow_definitions(optional_options)
569
571
  puts to_output_hash(result).green
570
- rescue SwaggerClient::ApiError => e
572
+ rescue EmassClient::ApiError => e
571
573
  puts 'Exception when calling ApprovalChainApi->get_workflow_definitions'.red
572
- puts to_output_hash(e)
574
+ puts to_output_hash(e).yellow
573
575
  end
574
576
  end
575
577
 
@@ -577,17 +579,14 @@ module Emasser
577
579
  # active and historical workflows for a system.
578
580
  #
579
581
  # Endpoints:
580
- # /api/systems/{systemId}/workflow-instances - Get workflow instances in a system
581
- # /api/systems/{systemId}/workflow-instances/{workflowInstanceId} - Get workflow instance by ID in a system
582
+ # /api/workflows/instances - Get workflow instances in a site
583
+ # /api/workflows/instances/{workflowInstanceId} - Get workflow instance by ID
582
584
  class WorkflowInstances < SubCommandBase
583
585
  def self.exit_on_failure?
584
586
  true
585
587
  end
586
588
 
587
- desc 'forSystem', 'Get workflow instances in a system'
588
- # Required parameters/fields
589
- option :systemId, type: :numeric, required: true,
590
- desc: 'A numeric value representing the system identification'
589
+ desc 'all', 'Get workflow instances in a site'
591
590
 
592
591
  # Optional parameters/fields
593
592
  option :includeComments, type: :boolean, required: false, default: false, desc: 'BOOLEAN - true or false.'
@@ -595,36 +594,32 @@ module Emasser
595
594
  option :sinceDate, type: :string, required: false, desc: 'The workflow instance date. Unix date format'
596
595
  option :status, type: :string, required: false, enum: %w[active inactive all]
597
596
 
598
- def forSystem
597
+ def all
599
598
  optional_options_keys = optional_options(@_initializer).keys
600
599
  optional_options = to_input_hash(optional_options_keys, options)
601
600
 
602
- result = SwaggerClient::WorkflowInstancesApi.new.get_system_workflow_instances(
603
- options[:systemId], optional_options
604
- )
601
+ result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances(optional_options)
605
602
  puts to_output_hash(result).green
606
- rescue SwaggerClient::ApiError => e
603
+ rescue EmassClient::ApiError => e
607
604
  puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances'.red
608
- puts to_output_hash(e)
605
+ puts to_output_hash(e).yellow
609
606
  end
610
607
 
611
608
  # Workflow by workflowInstanceId ---------------------------------------------------------
612
- desc 'byWorkflowInstanceId', 'Get workflow instance by ID in a system'
609
+ desc 'byInstanceId', 'Get workflow instance by ID'
613
610
 
614
611
  # Required parameters/fields
615
- option :systemId, type: :numeric, required: true,
616
- desc: 'A numeric value representing the system identification'
617
612
  option :workflowInstanceId, type: :numeric, required: true,
618
613
  desc: 'A numeric value representing the workflowInstance identification'
619
614
 
620
- def byWorkflowInstanceId
621
- result = SwaggerClient::WorkflowInstancesApi.new.get_system_workflow_instances_by_workflow_instance_id(
622
- options[:systemId], options[:workflowInstanceId]
623
- )
615
+ def byInstanceId
616
+ opts = Emasser::GET_WORKFLOWINSTANCES_RETURN_TYPE
617
+ result = EmassClient::WorkflowInstancesApi.new
618
+ .get_system_workflow_instances_by_workflow_instance_id(options[:workflowInstanceId], opts)
624
619
  puts to_output_hash(result).green
625
- rescue SwaggerClient::ApiError => e
620
+ rescue EmassClient::ApiError => e
626
621
  puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances_by_workflow_instance_id'.red
627
- puts to_output_hash(e)
622
+ puts to_output_hash(e).yellow
628
623
  end
629
624
  end
630
625