emasser 1.0.0 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +5 -8
- data/.env-example +3 -1
- data/.github/release-drafter.yml +2 -2
- data/.github/workflows/gh-pages.yml +4 -5
- data/.github/workflows/push-to-docker-mail.yml +28 -0
- data/.github/workflows/push-to-docker.yml +35 -0
- data/.github/workflows/release.yml +7 -3
- data/.github/workflows/test-cli.yml +4 -5
- data/.gitignore +3 -1
- data/Dockerfile +37 -3
- data/Gemfile +1 -1
- data/Gemfile.lock +37 -43
- data/README.md +131 -61
- data/docs/features.md +345 -207
- data/docs/images/emasser_architecture.jpg +0 -0
- data/emasser.gemspec +16 -12
- data/exe/emasser +0 -0
- data/images/emasser_architecture.jpg +0 -0
- data/images/emasser_diagram-Page-3.jpg +0 -0
- data/lib/emasser/cli.rb +12 -0
- data/lib/emasser/configuration.rb +22 -7
- data/lib/emasser/constants.rb +11 -3
- data/lib/emasser/delete.rb +14 -12
- data/lib/emasser/get.rb +83 -88
- data/lib/emasser/help/cloudresource_post_mapper.md +62 -0
- data/lib/emasser/help/container_post_mapper.md +44 -0
- data/lib/emasser/output_converters.rb +101 -4
- data/lib/emasser/post.rb +248 -55
- data/lib/emasser/put.rb +29 -22
- data/lib/emasser/version.rb +1 -1
- data/lib/emasser.rb +1 -1
- metadata +64 -447
- data/.github/workflows/generate_docs.yml +0 -33
- data/TAGS +0 -2393
- data/docs/developers.md +0 -115
- data/docs/swagger/dist/favicon-16x16.png +0 -0
- data/docs/swagger/dist/favicon-32x32.png +0 -0
- data/docs/swagger/dist/oauth2-redirect.html +0 -75
- data/docs/swagger/dist/swagger-ui-bundle.js +0 -3
- data/docs/swagger/dist/swagger-ui-bundle.js.map +0 -1
- data/docs/swagger/dist/swagger-ui-es-bundle-core.js +0 -3
- data/docs/swagger/dist/swagger-ui-es-bundle-core.js.map +0 -1
- data/docs/swagger/dist/swagger-ui-es-bundle.js +0 -3
- data/docs/swagger/dist/swagger-ui-es-bundle.js.map +0 -1
- data/docs/swagger/dist/swagger-ui-standalone-preset.js +0 -3
- data/docs/swagger/dist/swagger-ui-standalone-preset.js.map +0 -1
- data/docs/swagger/dist/swagger-ui.css +0 -4
- data/docs/swagger/dist/swagger-ui.css.map +0 -1
- data/docs/swagger/dist/swagger-ui.js +0 -3
- data/docs/swagger/dist/swagger-ui.js.map +0 -1
- data/docs/swagger/index.html +0 -60
- data/emass_client/eMASSRestOpenApi.yaml +0 -5698
- data/emass_client/ruby_client/.gitignore +0 -39
- data/emass_client/ruby_client/.rspec +0 -2
- data/emass_client/ruby_client/.rubocop.yml +0 -154
- data/emass_client/ruby_client/.swagger-codegen/VERSION +0 -1
- data/emass_client/ruby_client/.swagger-codegen-ignore +0 -23
- data/emass_client/ruby_client/Gemfile +0 -9
- data/emass_client/ruby_client/README.md +0 -1284
- data/emass_client/ruby_client/Rakefile +0 -8
- data/emass_client/ruby_client/docs/ArtifactsApi.md +0 -284
- data/emass_client/ruby_client/docs/ArtifactsDelete.md +0 -6
- data/emass_client/ruby_client/docs/ArtifactsDeleteInner.md +0 -7
- data/emass_client/ruby_client/docs/ArtifactsExportApi.md +0 -76
- data/emass_client/ruby_client/docs/ArtifactsGet.md +0 -20
- data/emass_client/ruby_client/docs/ArtifactsRequestPutBody.md +0 -16
- data/emass_client/ruby_client/docs/ArtifactsResponseDel.md +0 -8
- data/emass_client/ruby_client/docs/ArtifactsResponseDelData.md +0 -9
- data/emass_client/ruby_client/docs/ArtifactsResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/ArtifactsResponsePutPost.md +0 -8
- data/emass_client/ruby_client/docs/CACApi.md +0 -140
- data/emass_client/ruby_client/docs/CMMCAssessmentsApi.md +0 -71
- data/emass_client/ruby_client/docs/CacGet.md +0 -13
- data/emass_client/ruby_client/docs/CacRequestPostBody.md +0 -8
- data/emass_client/ruby_client/docs/CacResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/CacResponsePost.md +0 -8
- data/emass_client/ruby_client/docs/CacResponsePostData.md +0 -9
- data/emass_client/ruby_client/docs/CmmcGet.md +0 -19
- data/emass_client/ruby_client/docs/CmmcResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/ConnectivityCcsd.md +0 -8
- data/emass_client/ruby_client/docs/ControlsApi.md +0 -140
- data/emass_client/ruby_client/docs/ControlsGet.md +0 -36
- data/emass_client/ruby_client/docs/ControlsPut.md +0 -9
- data/emass_client/ruby_client/docs/ControlsRequestPutBody.md +0 -29
- data/emass_client/ruby_client/docs/ControlsResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/ControlsResponsePut.md +0 -8
- data/emass_client/ruby_client/docs/DefinitionTransitions.md +0 -9
- data/emass_client/ruby_client/docs/DeleteMilestone.md +0 -7
- data/emass_client/ruby_client/docs/DeletePoam.md +0 -7
- data/emass_client/ruby_client/docs/Empty200Response.md +0 -6
- data/emass_client/ruby_client/docs/Error.md +0 -8
- data/emass_client/ruby_client/docs/InstancesTransitions.md +0 -12
- data/emass_client/ruby_client/docs/MilestoneResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/MilestoneResponsePost.md +0 -8
- data/emass_client/ruby_client/docs/MilestoneResponsePut.md +0 -8
- data/emass_client/ruby_client/docs/MilestonesApi.md +0 -350
- data/emass_client/ruby_client/docs/MilestonesDelete.md +0 -6
- data/emass_client/ruby_client/docs/MilestonesGet.md +0 -12
- data/emass_client/ruby_client/docs/MilestonesPost.md +0 -6
- data/emass_client/ruby_client/docs/MilestonesPut.md +0 -6
- data/emass_client/ruby_client/docs/MilestonesPutPostDelete.md +0 -11
- data/emass_client/ruby_client/docs/MilestonesRequestPostBody.md +0 -9
- data/emass_client/ruby_client/docs/MilestonesRequestPutBody.md +0 -9
- data/emass_client/ruby_client/docs/MilestonesRequiredPost.md +0 -8
- data/emass_client/ruby_client/docs/MilestonesRequiredPut.md +0 -9
- data/emass_client/ruby_client/docs/Model200.md +0 -7
- data/emass_client/ruby_client/docs/Model201.md +0 -7
- data/emass_client/ruby_client/docs/Model201Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model400.md +0 -7
- data/emass_client/ruby_client/docs/Model400Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model400Response.md +0 -7
- data/emass_client/ruby_client/docs/Model401.md +0 -7
- data/emass_client/ruby_client/docs/Model401Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model403.md +0 -7
- data/emass_client/ruby_client/docs/Model403Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model404.md +0 -8
- data/emass_client/ruby_client/docs/Model404Response.md +0 -7
- data/emass_client/ruby_client/docs/Model405.md +0 -7
- data/emass_client/ruby_client/docs/Model405Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model411.md +0 -7
- data/emass_client/ruby_client/docs/Model411Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model490.md +0 -7
- data/emass_client/ruby_client/docs/Model490Meta.md +0 -8
- data/emass_client/ruby_client/docs/Model500.md +0 -7
- data/emass_client/ruby_client/docs/Model500Meta.md +0 -8
- data/emass_client/ruby_client/docs/PACApi.md +0 -137
- data/emass_client/ruby_client/docs/POAMApi.md +0 -346
- data/emass_client/ruby_client/docs/PacGet.md +0 -14
- data/emass_client/ruby_client/docs/PacPost.md +0 -9
- data/emass_client/ruby_client/docs/PacRequestPostBody.md +0 -9
- data/emass_client/ruby_client/docs/PacResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/PacResponsePost.md +0 -8
- data/emass_client/ruby_client/docs/PoamDelete.md +0 -6
- data/emass_client/ruby_client/docs/PoamGet.md +0 -39
- data/emass_client/ruby_client/docs/PoamPost.md +0 -6
- data/emass_client/ruby_client/docs/PoamPostPutDel.md +0 -10
- data/emass_client/ruby_client/docs/PoamPut.md +0 -6
- data/emass_client/ruby_client/docs/PoamRequestPostBody.md +0 -6
- data/emass_client/ruby_client/docs/PoamRequestPutBody.md +0 -6
- data/emass_client/ruby_client/docs/PoamRequiredPost.md +0 -32
- data/emass_client/ruby_client/docs/PoamRequiredPut.md +0 -35
- data/emass_client/ruby_client/docs/PoamResponseDelete.md +0 -8
- data/emass_client/ruby_client/docs/PoamResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/PoamResponsePost.md +0 -8
- data/emass_client/ruby_client/docs/PoamResponsePut.md +0 -8
- data/emass_client/ruby_client/docs/Register.md +0 -8
- data/emass_client/ruby_client/docs/RegisterData.md +0 -7
- data/emass_client/ruby_client/docs/RegisterUserRequestPostBody.md +0 -7
- data/emass_client/ruby_client/docs/RegistrationApi.md +0 -71
- data/emass_client/ruby_client/docs/RoleCategory.md +0 -10
- data/emass_client/ruby_client/docs/Roles.md +0 -9
- data/emass_client/ruby_client/docs/Ssps.md +0 -9
- data/emass_client/ruby_client/docs/Stage.md +0 -8
- data/emass_client/ruby_client/docs/StaticCodeApplication.md +0 -12
- data/emass_client/ruby_client/docs/StaticCodeRequestPostBody.md +0 -6
- data/emass_client/ruby_client/docs/StaticCodeRequiredPost.md +0 -8
- data/emass_client/ruby_client/docs/StaticCodeRequiredPostApplication.md +0 -8
- data/emass_client/ruby_client/docs/StaticCodeScansApi.md +0 -73
- data/emass_client/ruby_client/docs/Success200Response.md +0 -8
- data/emass_client/ruby_client/docs/SystemIdArtifactsBody.md +0 -10
- data/emass_client/ruby_client/docs/SystemResponse.md +0 -8
- data/emass_client/ruby_client/docs/SystemRolesApi.md +0 -137
- data/emass_client/ruby_client/docs/SystemRolesCategoryResponse.md +0 -8
- data/emass_client/ruby_client/docs/SystemRolesResponse.md +0 -8
- data/emass_client/ruby_client/docs/SystemRolesResponseData.md +0 -8
- data/emass_client/ruby_client/docs/Systems.md +0 -70
- data/emass_client/ruby_client/docs/SystemsApi.md +0 -155
- data/emass_client/ruby_client/docs/Test.md +0 -8
- data/emass_client/ruby_client/docs/TestApi.md +0 -66
- data/emass_client/ruby_client/docs/TestData.md +0 -7
- data/emass_client/ruby_client/docs/TestResultsApi.md +0 -144
- data/emass_client/ruby_client/docs/TestResultsGet.md +0 -15
- data/emass_client/ruby_client/docs/TestResultsPost.md +0 -9
- data/emass_client/ruby_client/docs/TestResultsRequestPostBody.md +0 -11
- data/emass_client/ruby_client/docs/TestResultsResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/TestResultsResponsePost.md +0 -8
- data/emass_client/ruby_client/docs/Users.md +0 -9
- data/emass_client/ruby_client/docs/WorkflowDefinitionGet.md +0 -11
- data/emass_client/ruby_client/docs/WorkflowDefinitionResponseGet.md +0 -8
- data/emass_client/ruby_client/docs/WorkflowDefinitionsApi.md +0 -74
- data/emass_client/ruby_client/docs/WorkflowInstancesApi.md +0 -146
- data/emass_client/ruby_client/docs/WorkflowInstancesGet.md +0 -16
- data/emass_client/ruby_client/docs/WorkflowInstancesResponseGet.md +0 -8
- data/emass_client/ruby_client/git_push.sh +0 -55
- data/emass_client/ruby_client/lib/swagger_client/api/artifacts_api.rb +0 -310
- data/emass_client/ruby_client/lib/swagger_client/api/artifacts_export_api.rb +0 -86
- data/emass_client/ruby_client/lib/swagger_client/api/cac_api.rb +0 -143
- data/emass_client/ruby_client/lib/swagger_client/api/cmmc_assessments_api.rb +0 -77
- data/emass_client/ruby_client/lib/swagger_client/api/controls_api.rb +0 -143
- data/emass_client/ruby_client/lib/swagger_client/api/milestones_api.rb +0 -366
- data/emass_client/ruby_client/lib/swagger_client/api/pac_api.rb +0 -140
- data/emass_client/ruby_client/lib/swagger_client/api/poam_api.rb +0 -345
- data/emass_client/ruby_client/lib/swagger_client/api/registration_api.rb +0 -78
- data/emass_client/ruby_client/lib/swagger_client/api/static_code_scans_api.rb +0 -84
- data/emass_client/ruby_client/lib/swagger_client/api/system_roles_api.rb +0 -150
- data/emass_client/ruby_client/lib/swagger_client/api/systems_api.rb +0 -162
- data/emass_client/ruby_client/lib/swagger_client/api/test_api.rb +0 -70
- data/emass_client/ruby_client/lib/swagger_client/api/test_results_api.rb +0 -149
- data/emass_client/ruby_client/lib/swagger_client/api/workflow_definitions_api.rb +0 -76
- data/emass_client/ruby_client/lib/swagger_client/api/workflow_instances_api.rb +0 -153
- data/emass_client/ruby_client/lib/swagger_client/api_client.rb +0 -389
- data/emass_client/ruby_client/lib/swagger_client/api_error.rb +0 -57
- data/emass_client/ruby_client/lib/swagger_client/configuration.rb +0 -224
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_delete.rb +0 -201
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_delete_inner.rb +0 -207
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_get.rb +0 -383
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_request_put_body.rb +0 -363
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_del.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_del_data.rb +0 -225
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/artifacts_response_put_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/cac_get.rb +0 -301
- data/emass_client/ruby_client/lib/swagger_client/models/cac_request_post_body.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/cac_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/cac_response_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/cac_response_post_data.rb +0 -225
- data/emass_client/ruby_client/lib/swagger_client/models/cmmc_get.rb +0 -398
- data/emass_client/ruby_client/lib/swagger_client/models/cmmc_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/connectivity_ccsd.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/controls_get.rb +0 -663
- data/emass_client/ruby_client/lib/swagger_client/models/controls_put.rb +0 -227
- data/emass_client/ruby_client/lib/swagger_client/models/controls_request_put_body.rb +0 -606
- data/emass_client/ruby_client/lib/swagger_client/models/controls_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/controls_response_put.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/definition_transitions.rb +0 -274
- data/emass_client/ruby_client/lib/swagger_client/models/delete_milestone.rb +0 -212
- data/emass_client/ruby_client/lib/swagger_client/models/delete_poam.rb +0 -212
- data/emass_client/ruby_client/lib/swagger_client/models/empty200_response.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/error.rb +0 -225
- data/emass_client/ruby_client/lib/swagger_client/models/instances_transitions.rb +0 -327
- data/emass_client/ruby_client/lib/swagger_client/models/milestone_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/milestone_response_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/milestone_response_put.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_delete.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_get.rb +0 -291
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_post.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_put.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_put_post_delete.rb +0 -247
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_request_post_body.rb +0 -242
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_request_put_body.rb +0 -242
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_required_post.rb +0 -227
- data/emass_client/ruby_client/lib/swagger_client/models/milestones_required_put.rb +0 -242
- data/emass_client/ruby_client/lib/swagger_client/models/model_200.rb +0 -208
- data/emass_client/ruby_client/lib/swagger_client/models/model_201.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_201_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_400.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_400_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_400_response.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_401.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_401_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_403.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_403_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_404.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_404_response.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_405.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_405_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_411.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_411_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_490.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_490_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/model_500.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/model_500_meta.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/pac_get.rb +0 -311
- data/emass_client/ruby_client/lib/swagger_client/models/pac_post.rb +0 -259
- data/emass_client/ruby_client/lib/swagger_client/models/pac_request_post_body.rb +0 -261
- data/emass_client/ruby_client/lib/swagger_client/models/pac_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/pac_response_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/poam_delete.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/poam_get.rb +0 -646
- data/emass_client/ruby_client/lib/swagger_client/models/poam_post.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/poam_post_put_del.rb +0 -237
- data/emass_client/ruby_client/lib/swagger_client/models/poam_put.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/poam_request_post_body.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/poam_request_put_body.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/poam_required_post.rb +0 -564
- data/emass_client/ruby_client/lib/swagger_client/models/poam_required_put.rb +0 -594
- data/emass_client/ruby_client/lib/swagger_client/models/poam_response_delete.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/poam_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/poam_response_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/poam_response_put.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/register.rb +0 -215
- data/emass_client/ruby_client/lib/swagger_client/models/register_data.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/register_user_request_post_body.rb +0 -211
- data/emass_client/ruby_client/lib/swagger_client/models/role_category.rb +0 -272
- data/emass_client/ruby_client/lib/swagger_client/models/roles.rb +0 -274
- data/emass_client/ruby_client/lib/swagger_client/models/ssps.rb +0 -227
- data/emass_client/ruby_client/lib/swagger_client/models/stage.rb +0 -252
- data/emass_client/ruby_client/lib/swagger_client/models/static_code_application.rb +0 -303
- data/emass_client/ruby_client/lib/swagger_client/models/static_code_request_post_body.rb +0 -197
- data/emass_client/ruby_client/lib/swagger_client/models/static_code_required_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/static_code_required_post_application.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/success200_response.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/system_id_artifacts_body.rb +0 -284
- data/emass_client/ruby_client/lib/swagger_client/models/system_response.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/system_roles_category_response.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/system_roles_response.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/system_roles_response_data.rb +0 -219
- data/emass_client/ruby_client/lib/swagger_client/models/systems.rb +0 -1137
- data/emass_client/ruby_client/lib/swagger_client/models/test.rb +0 -215
- data/emass_client/ruby_client/lib/swagger_client/models/test_data.rb +0 -206
- data/emass_client/ruby_client/lib/swagger_client/models/test_results_get.rb +0 -333
- data/emass_client/ruby_client/lib/swagger_client/models/test_results_post.rb +0 -227
- data/emass_client/ruby_client/lib/swagger_client/models/test_results_request_post_body.rb +0 -306
- data/emass_client/ruby_client/lib/swagger_client/models/test_results_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/test_results_response_post.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/users.rb +0 -224
- data/emass_client/ruby_client/lib/swagger_client/models/workflow_definition_get.rb +0 -282
- data/emass_client/ruby_client/lib/swagger_client/models/workflow_definition_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/models/workflow_instances_get.rb +0 -368
- data/emass_client/ruby_client/lib/swagger_client/models/workflow_instances_response_get.rb +0 -217
- data/emass_client/ruby_client/lib/swagger_client/version.rb +0 -14
- data/emass_client/ruby_client/lib/swagger_client.rb +0 -161
- data/emass_client/ruby_client/spec/api/artifacts_api_spec.rb +0 -92
- data/emass_client/ruby_client/spec/api/artifacts_export_api_spec.rb +0 -48
- data/emass_client/ruby_client/spec/api/cac_api_spec.rb +0 -60
- data/emass_client/ruby_client/spec/api/cmmc_assessments_api_spec.rb +0 -46
- data/emass_client/ruby_client/spec/api/controls_api_spec.rb +0 -60
- data/emass_client/ruby_client/spec/api/milestones_api_spec.rb +0 -105
- data/emass_client/ruby_client/spec/api/pac_api_spec.rb +0 -59
- data/emass_client/ruby_client/spec/api/poam_api_spec.rb +0 -103
- data/emass_client/ruby_client/spec/api/registration_api_spec.rb +0 -46
- data/emass_client/ruby_client/spec/api/static_code_scans_api_spec.rb +0 -47
- data/emass_client/ruby_client/spec/api/system_roles_api_spec.rb +0 -60
- data/emass_client/ruby_client/spec/api/systems_api_spec.rb +0 -67
- data/emass_client/ruby_client/spec/api/test_api_spec.rb +0 -45
- data/emass_client/ruby_client/spec/api/test_results_api_spec.rb +0 -62
- data/emass_client/ruby_client/spec/api/workflow_definitions_api_spec.rb +0 -47
- data/emass_client/ruby_client/spec/api/workflow_instances_api_spec.rb +0 -63
- data/emass_client/ruby_client/spec/api_client_spec.rb +0 -225
- data/emass_client/ruby_client/spec/base_object_spec.rb +0 -109
- data/emass_client/ruby_client/spec/configuration_spec.rb +0 -41
- data/emass_client/ruby_client/spec/models/artifacts_delete_inner_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/artifacts_delete_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/artifacts_get_spec.rb +0 -126
- data/emass_client/ruby_client/spec/models/artifacts_request_put_body_spec.rb +0 -102
- data/emass_client/ruby_client/spec/models/artifacts_response_del_data_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/artifacts_response_del_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/artifacts_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/artifacts_response_put_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/cac_get_spec.rb +0 -80
- data/emass_client/ruby_client/spec/models/cac_request_post_body_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/cac_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/cac_response_post_data_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/cac_response_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/cmmc_get_spec.rb +0 -128
- data/emass_client/ruby_client/spec/models/cmmc_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/connectivity_ccsd_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/controls_get_spec.rb +0 -262
- data/emass_client/ruby_client/spec/models/controls_put_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/controls_request_put_body_spec.rb +0 -216
- data/emass_client/ruby_client/spec/models/controls_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/controls_response_put_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/definition_transitions_spec.rb +0 -64
- data/emass_client/ruby_client/spec/models/delete_milestone_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/delete_poam_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/empty200_response_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/error_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/instances_transitions_spec.rb +0 -86
- data/emass_client/ruby_client/spec/models/milestone_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/milestone_response_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/milestone_response_put_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/milestones_delete_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/milestones_get_spec.rb +0 -74
- data/emass_client/ruby_client/spec/models/milestones_post_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/milestones_put_post_delete_spec.rb +0 -64
- data/emass_client/ruby_client/spec/models/milestones_put_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/milestones_request_post_body_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/milestones_request_put_body_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/milestones_required_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/milestones_required_put_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/model_200_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_201_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_201_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_400_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_400_response_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_400_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_401_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_401_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_403_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_403_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_404_response_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_404_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_405_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_405_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_411_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_411_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_490_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_490_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/model_500_meta_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/model_500_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/pac_get_spec.rb +0 -86
- data/emass_client/ruby_client/spec/models/pac_post_spec.rb +0 -56
- data/emass_client/ruby_client/spec/models/pac_request_post_body_spec.rb +0 -56
- data/emass_client/ruby_client/spec/models/pac_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/pac_response_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/poam_delete_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/poam_get_spec.rb +0 -264
- data/emass_client/ruby_client/spec/models/poam_post_put_del_spec.rb +0 -58
- data/emass_client/ruby_client/spec/models/poam_post_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/poam_put_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/poam_request_post_body_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/poam_request_put_body_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/poam_required_post_spec.rb +0 -218
- data/emass_client/ruby_client/spec/models/poam_required_put_spec.rb +0 -236
- data/emass_client/ruby_client/spec/models/poam_response_delete_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/poam_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/poam_response_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/poam_response_put_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/register_data_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/register_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/register_user_request_post_body_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/role_category_spec.rb +0 -62
- data/emass_client/ruby_client/spec/models/roles_spec.rb +0 -60
- data/emass_client/ruby_client/spec/models/ssps_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/stage_spec.rb +0 -50
- data/emass_client/ruby_client/spec/models/static_code_application_spec.rb +0 -78
- data/emass_client/ruby_client/spec/models/static_code_request_post_body_spec.rb +0 -34
- data/emass_client/ruby_client/spec/models/static_code_required_post_application_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/static_code_required_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/success200_response_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/system_id_artifacts_body_spec.rb +0 -66
- data/emass_client/ruby_client/spec/models/system_response_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/system_roles_category_response_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/system_roles_response_data_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/system_roles_response_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/systems_spec.rb +0 -510
- data/emass_client/ruby_client/spec/models/test_data_spec.rb +0 -40
- data/emass_client/ruby_client/spec/models/test_results_get_spec.rb +0 -96
- data/emass_client/ruby_client/spec/models/test_results_post_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/test_results_request_post_body_spec.rb +0 -68
- data/emass_client/ruby_client/spec/models/test_results_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/test_results_response_post_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/test_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/users_spec.rb +0 -52
- data/emass_client/ruby_client/spec/models/workflow_definition_get_spec.rb +0 -68
- data/emass_client/ruby_client/spec/models/workflow_definition_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/models/workflow_instances_get_spec.rb +0 -110
- data/emass_client/ruby_client/spec/models/workflow_instances_response_get_spec.rb +0 -46
- data/emass_client/ruby_client/spec/spec_helper.rb +0 -110
- data/emass_client/ruby_client/swagger_client.gemspec +0 -38
- data/emass_client/swagger-codegen/ruby_template/api_client.mustache +0 -384
- data/emass_client/swagger-codegen/ruby_template/api_info.mustache +0 -12
- data/emass_client/swagger-codegen/ruby_template/configuration.mustache +0 -234
- data/emass_client/swagger-codegen/ruby_template/gemspec.mustache +0 -37
Binary file
|
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
|
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 '
|
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.
|
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
|
-
|
12
|
-
|
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
|
-
|
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
|
-
|
28
|
-
config.
|
29
|
-
config.
|
30
|
-
config.
|
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
|
data/lib/emasser/constants.rb
CHANGED
@@ -5,14 +5,22 @@ module Emasser
|
|
5
5
|
include_package: false,
|
6
6
|
include_ditpr_metrics: false,
|
7
7
|
include_decommissioned: false,
|
8
|
-
|
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
|
-
|
12
|
+
debug_return_type: 'SystemResponse'
|
13
13
|
}.freeze
|
14
14
|
|
15
15
|
GET_ARTIFACTS_RETURN_TYPE = {
|
16
|
-
|
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
|
data/lib/emasser/delete.rb
CHANGED
@@ -47,7 +47,7 @@ module Emasser
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# Delete a POAM -----------------------------------------------------------
|
50
|
-
desc 'remove', '
|
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 =
|
58
|
+
body = EmassClient::PoamGet.new
|
59
59
|
body.poam_id = options[:poamId]
|
60
60
|
body_array = Array.new(1, body)
|
61
61
|
|
62
|
-
result =
|
62
|
+
result = EmassClient::POAMApi.new.delete_poam(options[:systemId], body_array)
|
63
63
|
puts to_output_hash(result).green
|
64
|
-
rescue
|
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 =
|
91
|
+
body = EmassClient::MilestonesGet.new
|
92
92
|
body.milestone_id = options[:milestoneId]
|
93
93
|
body_array = Array.new(1, body)
|
94
94
|
|
95
|
-
|
96
|
-
|
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
|
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', '
|
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 =
|
130
|
+
result = EmassClient::ArtifactsApi.new.delete_artifact(options[:systemId], body_array)
|
129
131
|
puts to_output_hash(result).green
|
130
|
-
rescue
|
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 =
|
43
|
+
result = EmassClient::TestApi.new.test_connection
|
44
44
|
puts to_output_hash(result).green
|
45
|
-
rescue
|
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 [--
|
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 =
|
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
|
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 =
|
112
|
+
result = EmassClient::SystemsApi.new.get_system(options[:systemId], optional_options)
|
111
113
|
puts to_output_hash(result).green
|
112
|
-
rescue
|
113
|
-
puts 'Exception when calling SystemsApi->
|
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 =
|
149
|
+
result = EmassClient::SystemsApi.new.get_systems(optional_options)
|
148
150
|
puts to_output_hash(result).green
|
149
|
-
rescue
|
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 =
|
175
|
+
result = EmassClient::SystemRolesApi.new.get_system_roles
|
174
176
|
puts to_output_hash(result).green
|
175
|
-
rescue
|
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 =
|
196
|
-
|
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
|
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 =
|
231
|
+
result = EmassClient::ControlsApi.new.get_system_controls(options[:systemId], optional_options)
|
230
232
|
puts to_output_hash(result).green
|
231
|
-
rescue
|
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 =
|
264
|
+
result = EmassClient::TestResultsApi.new.get_system_test_results(options[:systemId], optional_options)
|
263
265
|
puts to_output_hash(result).green
|
264
|
-
rescue
|
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 =
|
303
|
+
result = EmassClient::POAMApi.new.get_system_poams(options[:systemId], optional_options)
|
302
304
|
puts to_output_hash(result).green
|
303
|
-
rescue
|
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 =
|
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
|
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 =
|
355
|
-
|
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
|
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 =
|
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
|
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 '
|
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 =
|
413
|
-
|
414
|
+
result = EmassClient::ArtifactsApi.new.get_system_artifacts(options[:systemId],
|
415
|
+
optional_options)
|
414
416
|
puts to_output_hash(result).green
|
415
|
-
rescue
|
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 =
|
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
|
-
|
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
|
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 =
|
484
|
+
result = EmassClient::CACApi.new.get_system_cac(options[:systemId], optional_options)
|
483
485
|
puts to_output_hash(result).green
|
484
|
-
rescue
|
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 =
|
515
|
+
result = EmassClient::PACApi.new.get_system_pac(options[:systemId])
|
514
516
|
puts to_output_hash(result).green
|
515
|
-
rescue
|
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 =
|
540
|
+
result = EmassClient::CMMCAssessmentsApi.new.get_cmmc_assessments(options[:sinceDate])
|
539
541
|
puts to_output_hash(result).green
|
540
|
-
rescue
|
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 =
|
570
|
+
result = EmassClient::WorkflowDefinitionsApi.new.get_workflow_definitions(optional_options)
|
569
571
|
puts to_output_hash(result).green
|
570
|
-
rescue
|
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/
|
581
|
-
# /api/
|
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 '
|
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
|
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 =
|
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
|
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 '
|
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
|
621
|
-
|
622
|
-
|
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
|
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
|
|