emass_client 3.10.1 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +174 -131
- data/lib/emass_client/api/artifacts_api.rb +47 -52
- data/lib/emass_client/api/artifacts_export_api.rb +5 -5
- data/lib/emass_client/api/cac_api.rb +12 -12
- data/lib/emass_client/api/cloud_resource_results_api.rb +83 -9
- data/lib/emass_client/api/cmmc_assessment_dashboards_api.rb +314 -0
- data/lib/emass_client/api/cmmc_assessments_api.rb +5 -5
- data/lib/emass_client/api/coast_guard_system_fisma_metrics_dashboard_api.rb +95 -0
- data/lib/emass_client/api/container_scan_results_api.rb +83 -9
- data/lib/emass_client/api/controls_api.rb +17 -17
- data/lib/emass_client/api/device_scan_results_api.rb +112 -0
- data/lib/emass_client/api/hardware_baseline_api.rb +313 -0
- data/lib/emass_client/api/milestones_api.rb +18 -18
- data/lib/emass_client/api/organization_migration_status_dashboard_api.rb +95 -0
- data/lib/emass_client/api/pac_api.rb +16 -16
- data/lib/emass_client/api/poam_api.rb +47 -44
- data/lib/emass_client/api/registration_api.rb +5 -5
- data/lib/emass_client/api/software_baseline_api.rb +313 -0
- data/lib/emass_client/api/static_code_scans_api.rb +9 -9
- data/lib/emass_client/api/system_application_findings_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_artifacts_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_associations_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_atciatc_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_conmon_integration_status_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_connectivity_ccsd_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_critical_assets_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_device_findings_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_fisma_metrics_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_hardware_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_migration_status_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_poam_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_ports_protocols_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_privacy_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_questionnaire_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_roles_api.rb +8 -16
- data/lib/emass_client/api/system_security_controls_dashboards_api.rb +241 -0
- data/lib/emass_client/api/system_sensor_hardware_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_sensor_software_dashboards_api.rb +241 -0
- data/lib/emass_client/api/system_software_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_status_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_terms_conditions_dashboards_api.rb +168 -0
- data/lib/emass_client/api/system_vulnerability_dashboard_api.rb +95 -0
- data/lib/emass_client/api/system_workflows_dashboards_api.rb +241 -0
- data/lib/emass_client/api/systems_api.rb +22 -28
- data/lib/emass_client/api/test_api.rb +5 -5
- data/lib/emass_client/api/test_results_api.rb +19 -16
- data/lib/emass_client/api/user_system_assignments_dashboard_api.rb +95 -0
- data/lib/emass_client/api/va_system_dashboards_api.rb +679 -0
- data/lib/emass_client/api/vaombfisma_dashboard_api.rb +95 -0
- data/lib/emass_client/api/workflow_definitions_api.rb +9 -9
- data/lib/emass_client/api/workflow_instances_api.rb +17 -14
- data/lib/emass_client/api_client.rb +46 -32
- data/lib/emass_client/api_error.rb +4 -4
- data/lib/emass_client/configuration.rb +42 -12
- data/lib/emass_client/models/{response201.rb → api_rule_failed.rb} +29 -28
- data/lib/emass_client/models/{response490_meta.rb → api_rule_failed_meta.rb} +34 -29
- data/lib/emass_client/models/artifacts_ids.rb +221 -0
- data/lib/emass_client/models/artifacts_optional_fields.rb +298 -0
- data/lib/emass_client/models/artifacts_read_only_fields.rb +255 -0
- data/lib/emass_client/models/artifacts_request_delete_body_inner.rb +26 -25
- data/lib/emass_client/models/artifacts_required_fields.rb +252 -0
- data/lib/emass_client/models/artifacts_response_del.rb +26 -25
- data/lib/emass_client/models/artifacts_response_del_data_inner.rb +26 -25
- data/lib/emass_client/models/artifacts_response_get.rb +27 -26
- data/lib/emass_client/models/{artifacts_get.rb → artifacts_response_get_data_inner.rb} +91 -70
- data/lib/emass_client/models/artifacts_response_put_post.rb +26 -25
- data/lib/emass_client/models/artifacts_response_put_post_data_inner.rb +40 -30
- data/lib/emass_client/models/{response403.rb → bad_request.rb} +29 -28
- data/lib/emass_client/models/{response400_meta.rb → bad_request_meta.rb} +34 -29
- data/lib/emass_client/models/cac_get.rb +26 -25
- data/lib/emass_client/models/cac_response_get.rb +26 -25
- data/lib/emass_client/models/cac_response_post.rb +26 -25
- data/lib/emass_client/models/cac_response_post_data_inner.rb +40 -30
- data/lib/emass_client/models/{poam_response_post.rb → cloud_resources_delete.rb} +29 -28
- data/lib/emass_client/models/cloud_resources_delete_body_inner.rb +221 -0
- data/lib/emass_client/models/{cloud_resources_post.rb → cloud_resources_post_delete.rb} +42 -32
- data/lib/emass_client/models/cloud_resources_response_post.rb +27 -26
- data/lib/emass_client/models/cmmc_get.rb +96 -140
- data/lib/emass_client/models/cmmc_response_get.rb +26 -25
- data/lib/emass_client/models/connectivity_ccsd.rb +26 -25
- data/lib/emass_client/models/container_resources_delete_body_inner.rb +221 -0
- data/lib/emass_client/models/{containers_resources_post.rb → containers_resources_post_delete.rb} +42 -32
- data/lib/emass_client/models/{poam_response_delete.rb → containers_response_delete.rb} +29 -28
- data/lib/emass_client/models/containers_response_post.rb +27 -26
- data/lib/emass_client/models/controls_conditional_fields.rb +357 -0
- data/lib/emass_client/models/controls_ids.rb +221 -0
- data/lib/emass_client/models/controls_optional_fields.rb +471 -0
- data/lib/emass_client/models/controls_put.rb +40 -30
- data/lib/emass_client/models/controls_read_only_fields.rb +277 -0
- data/lib/emass_client/models/controls_required_fields.rb +295 -0
- data/lib/emass_client/models/controls_response_get.rb +27 -26
- data/lib/emass_client/models/{controls_get.rb → controls_response_get_data_inner.rb} +210 -166
- data/lib/emass_client/models/controls_response_put.rb +26 -25
- data/lib/emass_client/models/{response400.rb → created.rb} +29 -28
- data/lib/emass_client/models/{response201_meta.rb → created_meta.rb} +34 -29
- data/lib/emass_client/models/definition_transitions.rb +26 -25
- data/lib/emass_client/models/{success200_response.rb → device_scan_results_response_post.rb} +29 -28
- data/lib/emass_client/models/{success200_response_data_inner.rb → device_scan_results_response_post_data_inner.rb} +72 -33
- data/lib/emass_client/models/{response401.rb → forbidden.rb} +29 -28
- data/lib/emass_client/models/{response403_meta.rb → forbidden_meta.rb} +34 -29
- data/lib/emass_client/models/get_system_status_details200_response.rb +240 -0
- data/lib/emass_client/models/hw_baseline_conditional_fields.rb +244 -0
- data/lib/emass_client/models/hw_baseline_ids.rb +221 -0
- data/lib/emass_client/models/hw_baseline_optional_fields.rb +354 -0
- data/lib/emass_client/models/hw_baseline_read_only_fields.rb +222 -0
- data/lib/emass_client/models/hw_baseline_request_delete_body_inner.rb +220 -0
- data/lib/emass_client/models/hw_baseline_required_fields.rb +221 -0
- data/lib/emass_client/models/hw_baseline_response_delete.rb +231 -0
- data/lib/emass_client/models/hw_baseline_response_delete_data_inner.rb +274 -0
- data/lib/emass_client/models/{dashboard_mock_response.rb → hw_baseline_response_get.rb} +30 -29
- data/lib/emass_client/models/hw_baseline_response_get_data_inner.rb +429 -0
- data/lib/emass_client/models/hw_baseline_response_post_put.rb +231 -0
- data/lib/emass_client/models/hw_baseline_response_post_put_data_inner.rb +274 -0
- data/lib/emass_client/models/{instances_transitions.rb → instance_transitions.rb} +28 -27
- data/lib/emass_client/models/internal_server_error.rb +220 -0
- data/lib/emass_client/models/{response500_meta.rb → internal_server_error_meta.rb} +34 -29
- data/lib/emass_client/models/length_required.rb +220 -0
- data/lib/emass_client/models/{response411_meta.rb → length_required_meta.rb} +34 -29
- data/lib/emass_client/models/method_not_allowed.rb +220 -0
- data/lib/emass_client/models/{response405_meta.rb → method_not_allowed_meta.rb} +34 -29
- data/lib/emass_client/models/milestone_response_delete.rb +231 -0
- data/lib/emass_client/models/milestone_response_get.rb +26 -25
- data/lib/emass_client/models/milestone_response_get_milestone.rb +26 -25
- data/lib/emass_client/models/milestone_response_post.rb +26 -25
- data/lib/emass_client/models/milestone_response_put.rb +26 -25
- data/lib/emass_client/models/milestones_fields.rb +222 -0
- data/lib/emass_client/models/milestones_get.rb +55 -32
- data/lib/emass_client/models/milestones_put_post_delete.rb +40 -30
- data/lib/emass_client/models/milestones_request_delete_body_inner.rb +26 -25
- data/lib/emass_client/models/milestones_required_post.rb +35 -53
- data/lib/emass_client/models/milestones_required_post_milestones_inner.rb +265 -0
- data/lib/emass_client/models/milestones_required_put.rb +35 -68
- data/lib/emass_client/models/{ssps.rb → milestones_required_put_milestones_inner.rb} +101 -52
- data/lib/emass_client/models/{response404.rb → not_found.rb} +34 -29
- data/lib/emass_client/models/pac_get.rb +29 -37
- data/lib/emass_client/models/pac_post.rb +40 -30
- data/lib/emass_client/models/pac_response_get.rb +26 -25
- data/lib/emass_client/models/pac_response_post.rb +26 -25
- data/lib/emass_client/models/{dashboard_mock_response_pagination.rb → pagination.rb} +47 -46
- data/lib/emass_client/models/poam_conditional_fields.rb +402 -0
- data/lib/emass_client/models/poam_ids.rb +241 -0
- data/lib/emass_client/models/poam_optional_fields.rb +409 -0
- data/lib/emass_client/models/poam_post_put_del.rb +40 -30
- data/lib/emass_client/models/poam_read_only_fields.rb +332 -0
- data/lib/emass_client/models/poam_request_delete_body_inner.rb +26 -25
- data/lib/emass_client/models/poam_required_fields.rb +305 -0
- data/lib/emass_client/models/poam_response_get_poams.rb +27 -26
- data/lib/emass_client/models/poam_response_get_poams_data.rb +824 -0
- data/lib/emass_client/models/poam_response_get_systems.rb +27 -26
- data/lib/emass_client/models/poam_response_get_systems_data_inner.rb +824 -0
- data/lib/emass_client/models/{poam_response_put.rb → poam_response_post_put_delete.rb} +28 -27
- data/lib/emass_client/models/register.rb +26 -25
- data/lib/emass_client/models/register_data.rb +26 -25
- data/lib/emass_client/models/register_user_request_post_body.rb +38 -25
- data/lib/emass_client/models/response200.rb +32 -27
- data/lib/emass_client/models/role_category.rb +26 -25
- data/lib/emass_client/models/roles.rb +26 -25
- data/lib/emass_client/models/stage.rb +26 -25
- data/lib/emass_client/models/{static_code_application.rb → static_code_application_post.rb} +28 -27
- data/lib/emass_client/models/static_code_post.rb +40 -30
- data/lib/emass_client/models/static_code_request_post_body.rb +27 -26
- data/lib/emass_client/models/static_code_request_post_body_application.rb +26 -25
- data/lib/emass_client/models/static_code_response_post.rb +26 -25
- data/lib/emass_client/models/sw_baseline_conditional_fields.rb +222 -0
- data/lib/emass_client/models/sw_baseline_ids.rb +221 -0
- data/lib/emass_client/models/sw_baseline_optional_fields.rb +563 -0
- data/lib/emass_client/models/sw_baseline_read_only_fields.rb +222 -0
- data/lib/emass_client/models/sw_baseline_request_delete_body_inner.rb +220 -0
- data/lib/emass_client/models/sw_baseline_required_fields.rb +241 -0
- data/lib/emass_client/models/sw_baseline_response_delete.rb +231 -0
- data/lib/emass_client/models/sw_baseline_response_delete_data_inner.rb +274 -0
- data/lib/emass_client/models/sw_baseline_response_get.rb +240 -0
- data/lib/emass_client/models/sw_baseline_response_get_data_inner.rb +624 -0
- data/lib/emass_client/models/sw_baseline_response_post_put.rb +231 -0
- data/lib/emass_client/models/sw_baseline_response_post_put_data_inner.rb +274 -0
- data/lib/emass_client/models/system_response.rb +26 -25
- data/lib/emass_client/models/system_roles_category_response.rb +26 -25
- data/lib/emass_client/models/system_roles_response.rb +26 -25
- data/lib/emass_client/models/system_roles_response_data_inner.rb +26 -25
- data/lib/emass_client/models/systems.rb +950 -113
- data/lib/emass_client/models/systems_response.rb +26 -25
- data/lib/emass_client/models/test.rb +26 -25
- data/lib/emass_client/models/test_data.rb +26 -25
- data/lib/emass_client/models/test_results_get.rb +37 -26
- data/lib/emass_client/models/test_results_post.rb +40 -30
- data/lib/emass_client/models/test_results_response_get.rb +26 -25
- data/lib/emass_client/models/test_results_response_post.rb +26 -25
- data/lib/emass_client/models/unauthorized.rb +220 -0
- data/lib/emass_client/models/{response401_meta.rb → unauthorized_meta.rb} +34 -29
- data/lib/emass_client/models/users.rb +26 -25
- data/lib/emass_client/models/workflow_definition_get.rb +26 -25
- data/lib/emass_client/models/workflow_definition_response_get.rb +26 -25
- data/lib/emass_client/models/workflow_instance_get.rb +40 -28
- data/lib/emass_client/models/workflow_instance_response_get.rb +26 -25
- data/lib/emass_client/models/workflow_instances_response_get.rb +27 -26
- data/lib/emass_client/models/workflow_instances_response_get_pagination.rb +26 -25
- data/lib/emass_client/version.rb +5 -5
- data/lib/emass_client.rb +112 -39
- metadata +116 -43
- data/lib/emass_client/api/dashboards_api.rb +0 -2139
- data/lib/emass_client/models/mock_object.rb +0 -343
- data/lib/emass_client/models/poam_get.rb +0 -683
- data/lib/emass_client/models/response405.rb +0 -219
- data/lib/emass_client/models/response411.rb +0 -219
- data/lib/emass_client/models/response490.rb +0 -219
- data/lib/emass_client/models/response500.rb +0 -219
- data/lib/emass_client/models/workflow_instances_get.rb +0 -342
@@ -0,0 +1,95 @@
|
|
1
|
+
=begin
|
2
|
+
#Enterprise Mission Assurance Support Service (eMASS)
|
3
|
+
|
4
|
+
#The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3.22
|
7
|
+
Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.12.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module EmassClient
|
16
|
+
class VAOMBFISMADashboardApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# VA OMB FISMA SAOP Summary
|
23
|
+
# Get VA OMB-FISMA SAOP summary dashboard information.
|
24
|
+
# @param org_id [Integer] **Organization Id**: The unique organization identifier.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [Boolean] :excludeinherited **Exclude Inherited**: If no value is specified, the default returns false to include inherited data. (default to false)
|
27
|
+
# @option opts [Integer] :page_index **Page Index**: If no value is specified, the default returns results from the first page with an index of 0. (default to 0)
|
28
|
+
# @option opts [Integer] :page_size **Page Size**: If no value is specified, the default returns 20000 per page. (default to 20000)
|
29
|
+
# @return [GetSystemStatusDetails200Response]
|
30
|
+
def get_va_omb_fsma_saop_summary(org_id, opts = {})
|
31
|
+
data, _status_code, _headers = get_va_omb_fsma_saop_summary_with_http_info(org_id, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# VA OMB FISMA SAOP Summary
|
36
|
+
# Get VA OMB-FISMA SAOP summary dashboard information.
|
37
|
+
# @param org_id [Integer] **Organization Id**: The unique organization identifier.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [Boolean] :excludeinherited **Exclude Inherited**: If no value is specified, the default returns false to include inherited data. (default to false)
|
40
|
+
# @option opts [Integer] :page_index **Page Index**: If no value is specified, the default returns results from the first page with an index of 0. (default to 0)
|
41
|
+
# @option opts [Integer] :page_size **Page Size**: If no value is specified, the default returns 20000 per page. (default to 20000)
|
42
|
+
# @return [Array<(GetSystemStatusDetails200Response, Integer, Hash)>] GetSystemStatusDetails200Response data, response status code and response headers
|
43
|
+
def get_va_omb_fsma_saop_summary_with_http_info(org_id, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: VAOMBFISMADashboardApi.get_va_omb_fsma_saop_summary ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'org_id' is set
|
48
|
+
if @api_client.config.client_side_validation && org_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'org_id' when calling VAOMBFISMADashboardApi.get_va_omb_fsma_saop_summary"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/api/dashboards/va-omb-fisma-saop-summary'
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
query_params[:'orgId'] = org_id
|
57
|
+
query_params[:'excludeinherited'] = opts[:'excludeinherited'] if !opts[:'excludeinherited'].nil?
|
58
|
+
query_params[:'pageIndex'] = opts[:'page_index'] if !opts[:'page_index'].nil?
|
59
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
60
|
+
|
61
|
+
# header parameters
|
62
|
+
header_params = opts[:header_params] || {}
|
63
|
+
# HTTP header 'Accept' (if needed)
|
64
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
65
|
+
|
66
|
+
# form parameters
|
67
|
+
form_params = opts[:form_params] || {}
|
68
|
+
|
69
|
+
# http body (model)
|
70
|
+
post_body = opts[:debug_body]
|
71
|
+
|
72
|
+
# return_type
|
73
|
+
return_type = opts[:debug_return_type] || 'GetSystemStatusDetails200Response'
|
74
|
+
|
75
|
+
# auth_names
|
76
|
+
auth_names = opts[:debug_auth_names] || ['apiKey', 'mockType', 'userId']
|
77
|
+
|
78
|
+
new_options = opts.merge(
|
79
|
+
:operation => :"VAOMBFISMADashboardApi.get_va_omb_fsma_saop_summary",
|
80
|
+
:header_params => header_params,
|
81
|
+
:query_params => query_params,
|
82
|
+
:form_params => form_params,
|
83
|
+
:body => post_body,
|
84
|
+
:auth_names => auth_names,
|
85
|
+
:return_type => return_type
|
86
|
+
)
|
87
|
+
|
88
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug "API called: VAOMBFISMADashboardApi#get_va_omb_fsma_saop_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
91
|
+
end
|
92
|
+
return data, status_code, headers
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Enterprise Mission Assurance Support Service (eMASS)
|
3
3
|
|
4
|
-
#The
|
4
|
+
#The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
|
5
5
|
|
6
|
-
The version of the OpenAPI document: v3.
|
7
|
-
Contact: disa.
|
6
|
+
The version of the OpenAPI document: v3.22
|
7
|
+
Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -20,10 +20,10 @@ module EmassClient
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
# Get workflow definitions in a site
|
23
|
-
# View all workflow schemas available on the eMASS instance filtered by
|
23
|
+
# View all workflow schemas available on the eMASS instance filtered by status `includeInactive` and registration type `registrationType`.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
25
|
# @option opts [Boolean] :include_inactive **Include Inactive**: If no value is specified, the default returns false to not include outdated workflow definitions. (default to true)
|
26
|
-
# @option opts [String] :registration_type **Registration Type**: Filter record by selected registration type (single value or comma delimited values).
|
26
|
+
# @option opts [String] :registration_type **Registration Type**: Filter record by selected registration type (single value or comma delimited values). **Valid Options Are:** assessAndAuthorize, assessOnly, guest, regular, functional, cloudServiceProvider, commonControlProvider, authorizationToUse, reciprocityAcceptanc (default to 'regular')
|
27
27
|
# @return [WorkflowDefinitionResponseGet]
|
28
28
|
def get_workflow_definitions(opts = {})
|
29
29
|
data, _status_code, _headers = get_workflow_definitions_with_http_info(opts)
|
@@ -31,10 +31,10 @@ module EmassClient
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Get workflow definitions in a site
|
34
|
-
# View all workflow schemas available on the eMASS instance filtered by
|
34
|
+
# View all workflow schemas available on the eMASS instance filtered by status `includeInactive` and registration type `registrationType`.
|
35
35
|
# @param [Hash] opts the optional parameters
|
36
36
|
# @option opts [Boolean] :include_inactive **Include Inactive**: If no value is specified, the default returns false to not include outdated workflow definitions. (default to true)
|
37
|
-
# @option opts [String] :registration_type **Registration Type**: Filter record by selected registration type (single value or comma delimited values).
|
37
|
+
# @option opts [String] :registration_type **Registration Type**: Filter record by selected registration type (single value or comma delimited values). **Valid Options Are:** assessAndAuthorize, assessOnly, guest, regular, functional, cloudServiceProvider, commonControlProvider, authorizationToUse, reciprocityAcceptanc (default to 'regular')
|
38
38
|
# @return [Array<(WorkflowDefinitionResponseGet, Integer, Hash)>] WorkflowDefinitionResponseGet data, response status code and response headers
|
39
39
|
def get_workflow_definitions_with_http_info(opts = {})
|
40
40
|
if @api_client.config.debugging
|
@@ -51,7 +51,7 @@ module EmassClient
|
|
51
51
|
# header parameters
|
52
52
|
header_params = opts[:header_params] || {}
|
53
53
|
# HTTP header 'Accept' (if needed)
|
54
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
55
55
|
|
56
56
|
# form parameters
|
57
57
|
form_params = opts[:form_params] || {}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Enterprise Mission Assurance Support Service (eMASS)
|
3
3
|
|
4
|
-
#The
|
4
|
+
#The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
|
5
5
|
|
6
|
-
The version of the OpenAPI document: v3.
|
7
|
-
Contact: disa.
|
6
|
+
The version of the OpenAPI document: v3.22
|
7
|
+
Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -22,10 +22,11 @@ module EmassClient
|
|
22
22
|
# Get workflow instances in a site
|
23
23
|
# View detailed information on all active and historical workflows filtered by provided parameters.
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @option opts [Boolean] :include_comments **Include Comments**: If no value is specified, the default returns true to not include transition comments.
|
26
|
-
# @option opts [
|
27
|
-
# @option opts [
|
28
|
-
# @option opts [String] :
|
25
|
+
# @option opts [Boolean] :include_comments **Include Comments**: If no value is specified, the default returns true to not include transition comments. Note: Corresponds to the Comments textbox that is required at most workflow transitions. Does not include other text input fields such as Terms / Conditions for Authorization. (default to true)
|
26
|
+
# @option opts [Boolean] :include_decommission_systems **Include Decommission Systems**: If no value is specified, the default returns false to exclude decommissioned systems. (default to false)
|
27
|
+
# @option opts [Integer] :page_index **Page Index**: If no value is specified, the default returns results from the first page with an index of 0. **Note:** Pages contain 1000 workflow instances. (default to 0)
|
28
|
+
# @option opts [String] :since_date **Date**: Filter on authorization/assessment date (Unix date format). Note: Filters off the lastEditedDate field. Note: The authorization/assessment decisions on completed workflows can be edited for up to 30 days after the initial decision is made.
|
29
|
+
# @option opts [String] :status **Status**: Filter by status. If no value is specified, the default returns all to include both active and inactive workflows. Note: Any workflows at a current stage of Complete or Cancelled are inactive. Ongoing workflows currently at other stages are active. (default to 'all')
|
29
30
|
# @return [WorkflowInstancesResponseGet]
|
30
31
|
def get_system_workflow_instances(opts = {})
|
31
32
|
data, _status_code, _headers = get_system_workflow_instances_with_http_info(opts)
|
@@ -35,10 +36,11 @@ module EmassClient
|
|
35
36
|
# Get workflow instances in a site
|
36
37
|
# View detailed information on all active and historical workflows filtered by provided parameters.
|
37
38
|
# @param [Hash] opts the optional parameters
|
38
|
-
# @option opts [Boolean] :include_comments **Include Comments**: If no value is specified, the default returns true to not include transition comments.
|
39
|
-
# @option opts [
|
40
|
-
# @option opts [
|
41
|
-
# @option opts [String] :
|
39
|
+
# @option opts [Boolean] :include_comments **Include Comments**: If no value is specified, the default returns true to not include transition comments. Note: Corresponds to the Comments textbox that is required at most workflow transitions. Does not include other text input fields such as Terms / Conditions for Authorization. (default to true)
|
40
|
+
# @option opts [Boolean] :include_decommission_systems **Include Decommission Systems**: If no value is specified, the default returns false to exclude decommissioned systems. (default to false)
|
41
|
+
# @option opts [Integer] :page_index **Page Index**: If no value is specified, the default returns results from the first page with an index of 0. **Note:** Pages contain 1000 workflow instances. (default to 0)
|
42
|
+
# @option opts [String] :since_date **Date**: Filter on authorization/assessment date (Unix date format). Note: Filters off the lastEditedDate field. Note: The authorization/assessment decisions on completed workflows can be edited for up to 30 days after the initial decision is made.
|
43
|
+
# @option opts [String] :status **Status**: Filter by status. If no value is specified, the default returns all to include both active and inactive workflows. Note: Any workflows at a current stage of Complete or Cancelled are inactive. Ongoing workflows currently at other stages are active. (default to 'all')
|
42
44
|
# @return [Array<(WorkflowInstancesResponseGet, Integer, Hash)>] WorkflowInstancesResponseGet data, response status code and response headers
|
43
45
|
def get_system_workflow_instances_with_http_info(opts = {})
|
44
46
|
if @api_client.config.debugging
|
@@ -54,6 +56,7 @@ module EmassClient
|
|
54
56
|
# query parameters
|
55
57
|
query_params = opts[:query_params] || {}
|
56
58
|
query_params[:'includeComments'] = opts[:'include_comments'] if !opts[:'include_comments'].nil?
|
59
|
+
query_params[:'includeDecommissionSystems'] = opts[:'include_decommission_systems'] if !opts[:'include_decommission_systems'].nil?
|
57
60
|
query_params[:'pageIndex'] = opts[:'page_index'] if !opts[:'page_index'].nil?
|
58
61
|
query_params[:'sinceDate'] = opts[:'since_date'] if !opts[:'since_date'].nil?
|
59
62
|
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
@@ -61,7 +64,7 @@ module EmassClient
|
|
61
64
|
# header parameters
|
62
65
|
header_params = opts[:header_params] || {}
|
63
66
|
# HTTP header 'Accept' (if needed)
|
64
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
67
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
65
68
|
|
66
69
|
# form parameters
|
67
70
|
form_params = opts[:form_params] || {}
|
@@ -124,7 +127,7 @@ module EmassClient
|
|
124
127
|
# header parameters
|
125
128
|
header_params = opts[:header_params] || {}
|
126
129
|
# HTTP header 'Accept' (if needed)
|
127
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
130
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
128
131
|
|
129
132
|
# form parameters
|
130
133
|
form_params = opts[:form_params] || {}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Enterprise Mission Assurance Support Service (eMASS)
|
3
3
|
|
4
|
-
#The
|
4
|
+
#The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
|
5
5
|
|
6
|
-
The version of the OpenAPI document: v3.
|
7
|
-
Contact: disa.
|
6
|
+
The version of the OpenAPI document: v3.22
|
7
|
+
Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -17,6 +17,7 @@ require 'tempfile'
|
|
17
17
|
require 'time'
|
18
18
|
require 'typhoeus'
|
19
19
|
|
20
|
+
|
20
21
|
module EmassClient
|
21
22
|
class ApiClient
|
22
23
|
# The Configuration object holding settings to be used in the API client.
|
@@ -45,9 +46,11 @@ module EmassClient
|
|
45
46
|
# Call an API with given options.
|
46
47
|
#
|
47
48
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
48
|
-
# the data deserialized from response body (
|
49
|
+
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
49
50
|
def call_api(http_method, path, opts = {})
|
50
51
|
request = build_request(http_method, path, opts)
|
52
|
+
exportFilename = opts[:query_params][:filename].to_s || ''
|
53
|
+
tempfile = download_file(request, exportFilename) if opts[:return_type] == 'File'
|
51
54
|
response = request.run
|
52
55
|
|
53
56
|
if @config.debugging
|
@@ -69,7 +72,9 @@ module EmassClient
|
|
69
72
|
end
|
70
73
|
end
|
71
74
|
|
72
|
-
if opts[:return_type]
|
75
|
+
if opts[:return_type] == 'File'
|
76
|
+
data = tempfile
|
77
|
+
elsif opts[:return_type]
|
73
78
|
data = deserialize(response, opts[:return_type])
|
74
79
|
else
|
75
80
|
data = nil
|
@@ -93,6 +98,7 @@ module EmassClient
|
|
93
98
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
94
99
|
query_params = opts[:query_params] || {}
|
95
100
|
form_params = opts[:form_params] || {}
|
101
|
+
follow_location = opts[:follow_location] || true
|
96
102
|
|
97
103
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
98
104
|
|
@@ -110,7 +116,8 @@ module EmassClient
|
|
110
116
|
:sslcert => @config.cert_file,
|
111
117
|
:sslkey => @config.key_file,
|
112
118
|
:verbose => @config.debugging,
|
113
|
-
:keypasswd => @config.key_password
|
119
|
+
:keypasswd => @config.key_password,
|
120
|
+
:followlocation => follow_location
|
114
121
|
}
|
115
122
|
|
116
123
|
# set custom cert, if provided
|
@@ -124,9 +131,7 @@ module EmassClient
|
|
124
131
|
end
|
125
132
|
end
|
126
133
|
|
127
|
-
|
128
|
-
download_file(request) if opts[:return_type] == 'File'
|
129
|
-
request
|
134
|
+
Typhoeus::Request.new(url, req_opts)
|
130
135
|
end
|
131
136
|
|
132
137
|
# Builds the HTTP request body
|
@@ -158,41 +163,55 @@ module EmassClient
|
|
158
163
|
end
|
159
164
|
|
160
165
|
# Save response body into a file in (the defined) temporary folder, using the filename
|
161
|
-
# from the "Content-Disposition" header if provided, otherwise
|
166
|
+
# from the "Content-Disposition" header if provided, otherwise use the request filename.
|
162
167
|
# The response body is written to the file in chunks in order to handle files which
|
163
168
|
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
164
169
|
# process can use.
|
165
170
|
#
|
166
171
|
# @see Configuration#temp_folder_path
|
167
|
-
|
172
|
+
#
|
173
|
+
# @return [Tempfile] the tempfile generated
|
174
|
+
def download_file(request, exportFilename)
|
168
175
|
tempfile = nil
|
169
176
|
encoding = nil
|
177
|
+
tempfilename = nil
|
170
178
|
request.on_headers do |response|
|
171
179
|
content_disposition = response.headers['Content-Disposition']
|
172
180
|
if content_disposition && content_disposition =~ /filename=/i
|
173
181
|
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
174
182
|
prefix = sanitize_filename(filename)
|
175
183
|
else
|
176
|
-
prefix = 'download-'
|
184
|
+
prefix = 'download-' + exportFilename
|
177
185
|
end
|
178
|
-
prefix =
|
186
|
+
prefix = '/' + prefix unless @config.temp_folder_path.end_with?('/')
|
179
187
|
encoding = response.body.encoding
|
180
|
-
|
181
|
-
@
|
188
|
+
# If temp folder provided use it, otherwise use the OS temp directory
|
189
|
+
if @config.temp_folder_path.empty?
|
190
|
+
tempfilename = Dir.tmpdir() + prefix
|
191
|
+
else
|
192
|
+
tempfilename = @config.temp_folder_path + prefix
|
193
|
+
end
|
194
|
+
tempfile = File.new(tempfilename, 'w+')
|
182
195
|
end
|
183
196
|
request.on_body do |chunk|
|
184
197
|
chunk.force_encoding(encoding)
|
185
198
|
tempfile.write(chunk)
|
186
199
|
end
|
187
|
-
request
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
"
|
194
|
-
|
200
|
+
# run the request to ensure the tempfile is created successfully before returning it
|
201
|
+
request.run
|
202
|
+
if tempfile
|
203
|
+
tempfile.close
|
204
|
+
if @config.temp_folder_path.empty?
|
205
|
+
@config.logger.info "Temp file downloaded (written) to #{tempfile.path}, please copy the file to a proper folder. "\
|
206
|
+
"otherwise the temp file will be deleted automatically with GC."
|
207
|
+
else
|
208
|
+
@config.logger.info "File downloaded (written) to #{tempfile.path}"
|
209
|
+
end
|
210
|
+
else
|
211
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
195
212
|
end
|
213
|
+
|
214
|
+
tempfile
|
196
215
|
end
|
197
216
|
|
198
217
|
# Check if the given MIME is a JSON MIME.
|
@@ -204,7 +223,7 @@ module EmassClient
|
|
204
223
|
# @param [String] mime MIME
|
205
224
|
# @return [Boolean] True if the MIME is application/json
|
206
225
|
def json_mime?(mime)
|
207
|
-
(mime == '*/*') || !(mime =~
|
226
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
208
227
|
end
|
209
228
|
|
210
229
|
# Deserialize the response to the given return type.
|
@@ -213,15 +232,10 @@ module EmassClient
|
|
213
232
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
214
233
|
def deserialize(response, return_type)
|
215
234
|
body = response.body
|
216
|
-
|
217
|
-
# handle file downloading - return the File instance processed in request callbacks
|
218
|
-
# note that response body is empty when the file is written in chunks in request on_body callback
|
219
|
-
return @tempfile if return_type == 'File'
|
220
|
-
|
221
235
|
return nil if body.nil? || body.empty?
|
222
236
|
|
223
237
|
# return response body directly for String return type
|
224
|
-
return body if return_type == 'String'
|
238
|
+
return body.to_s if return_type == 'String'
|
225
239
|
|
226
240
|
# ensuring a default content type
|
227
241
|
content_type = response.headers['Content-Type'] || 'application/json'
|
@@ -288,7 +302,7 @@ module EmassClient
|
|
288
302
|
# @param [String] filename the filename to be sanitized
|
289
303
|
# @return [String] the sanitized filename
|
290
304
|
def sanitize_filename(filename)
|
291
|
-
filename.
|
305
|
+
filename.split(/[\/\\]/).last
|
292
306
|
end
|
293
307
|
|
294
308
|
def build_request_url(path, opts = {})
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Enterprise Mission Assurance Support Service (eMASS)
|
3
3
|
|
4
|
-
#The
|
4
|
+
#The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
|
5
5
|
|
6
|
-
The version of the OpenAPI document: v3.
|
7
|
-
Contact: disa.
|
6
|
+
The version of the OpenAPI document: v3.22
|
7
|
+
Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Enterprise Mission Assurance Support Service (eMASS)
|
3
3
|
|
4
|
-
#The
|
4
|
+
#The eMASS Representational State Transfer (REST) Application Programming Interface (API) enables users to perform assessments and complete actions associated with system records. The eMASS API provides an interface for application to communicate eMASS Services. For information on how to register and use the eMASS API reference the [eMASS API Getting Started](eMASSGettingStarted.md). Additional information about eMASS can be obtain by contacting the National Industrial Security Program (NISP). Points of Contact are:
|
5
5
|
|
6
|
-
The version of the OpenAPI document: v3.
|
7
|
-
Contact: disa.
|
6
|
+
The version of the OpenAPI document: v3.22
|
7
|
+
Contact: disa.global.servicedesk.mbx.ma-ticket-request@mail.mil
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
|
9
|
+
Generator version: 7.12.0-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -62,6 +62,16 @@ module EmassClient
|
|
62
62
|
# Defines the access token (Bearer) used with OAuth2.
|
63
63
|
attr_accessor :access_token
|
64
64
|
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
66
|
+
# Overrides the access_token if set
|
67
|
+
# @return [Proc]
|
68
|
+
attr_accessor :access_token_getter
|
69
|
+
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
72
|
+
# Default to false.
|
73
|
+
attr_accessor :return_binary_data
|
74
|
+
|
65
75
|
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
66
76
|
# details will be logged with `logger.debug` (see the `logger` attribute).
|
67
77
|
# Default to false.
|
@@ -69,6 +79,14 @@ module EmassClient
|
|
69
79
|
# @return [true, false]
|
70
80
|
attr_accessor :debugging
|
71
81
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
86
|
+
# Default to false.
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :ignore_operation_servers
|
89
|
+
|
72
90
|
# Defines the logger used for debugging.
|
73
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
74
92
|
#
|
@@ -137,6 +155,7 @@ module EmassClient
|
|
137
155
|
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
138
156
|
attr_accessor :params_encoding
|
139
157
|
|
158
|
+
|
140
159
|
attr_accessor :inject_format
|
141
160
|
|
142
161
|
attr_accessor :force_ending_format
|
@@ -145,7 +164,7 @@ module EmassClient
|
|
145
164
|
@scheme = 'http'
|
146
165
|
@host = 'localhost:4010'
|
147
166
|
@base_path = ''
|
148
|
-
@server_index =
|
167
|
+
@server_index = nil
|
149
168
|
@server_operation_index = {}
|
150
169
|
@server_variables = {}
|
151
170
|
@server_operation_variables = {}
|
@@ -154,12 +173,13 @@ module EmassClient
|
|
154
173
|
@client_side_validation = true
|
155
174
|
@verify_ssl = true
|
156
175
|
@verify_ssl_host = true
|
157
|
-
@params_encoding = nil
|
158
176
|
@cert_file = nil
|
159
177
|
@key_file = nil
|
160
178
|
@key_password = nil
|
161
179
|
@timeout = 0
|
180
|
+
@params_encoding = nil
|
162
181
|
@debugging = false
|
182
|
+
@ignore_operation_servers = false
|
163
183
|
@inject_format = false
|
164
184
|
@force_ending_format = false
|
165
185
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
@@ -194,10 +214,13 @@ module EmassClient
|
|
194
214
|
|
195
215
|
# Returns base URL for specified operation based on server settings
|
196
216
|
def base_url(operation = nil)
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
217
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
218
|
+
if operation_server_settings.key?(operation) then
|
219
|
+
index = server_operation_index.fetch(operation, server_index)
|
220
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
221
|
+
else
|
222
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
223
|
+
end
|
201
224
|
end
|
202
225
|
|
203
226
|
# Gets API key (with prefix if set).
|
@@ -212,6 +235,12 @@ module EmassClient
|
|
212
235
|
end
|
213
236
|
end
|
214
237
|
|
238
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
239
|
+
def access_token_with_refresh
|
240
|
+
return access_token if access_token_getter.nil?
|
241
|
+
access_token_getter.call
|
242
|
+
end
|
243
|
+
|
215
244
|
# Gets Basic Auth token string
|
216
245
|
def basic_auth_token
|
217
246
|
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
@@ -271,8 +300,8 @@ module EmassClient
|
|
271
300
|
servers = server_settings if servers == nil
|
272
301
|
|
273
302
|
# check array index out of bound
|
274
|
-
if (index < 0 || index >= servers.size)
|
275
|
-
fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
|
303
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
304
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
276
305
|
end
|
277
306
|
|
278
307
|
server = servers[index]
|
@@ -297,5 +326,6 @@ module EmassClient
|
|
297
326
|
url
|
298
327
|
end
|
299
328
|
|
329
|
+
|
300
330
|
end
|
301
331
|
end
|