ruby-jss 1.6.4 → 2.0.0b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/CHANGES.md +40 -4
- data/README-2.0.0.md +337 -0
- data/README.md +48 -34
- data/bin/cgrouper +3 -3
- data/bin/jamfHelperBackgrounder +2 -2
- data/bin/netseg-update +3 -3
- data/data/ruby-jss.conf.example +1 -1
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/account.rb +29 -22
- data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_computer_search.rb +6 -6
- data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_mobile_device_search.rb +6 -6
- data/lib/{jss/api_object/advanced_search → jamf/api/classic/api_objects}/advanced_user_search.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/building.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/categorizable.rb +10 -10
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/category.rb +17 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/computer.rb +222 -120
- data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/computer_extension_attribute.rb +19 -19
- data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/computer_group.rb +9 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/computer_invitation.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/creatable.rb +22 -24
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable/criteria.rb +24 -24
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable/criterion.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/criteriable.rb +25 -28
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/department.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding.rb +40 -40
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/active_directory.rb +47 -47
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/admitmac.rb +56 -56
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/centrify.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects/directory_binding_type}/directory_binding_type.rb +2 -25
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/open_directory.rb +19 -19
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/directory_binding_type/powerbroker_identity_services.rb +1 -1
- data/lib/jamf/api/classic/api_objects/directory_binding_type.rb +47 -0
- data/lib/{jss/api_object/disk_encryption_configurations.rb → jamf/api/classic/api_objects/disk_encryption_configuration.rb} +14 -14
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/distribution_point.rb +41 -35
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/dock_item.rb +12 -12
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/ebook.rb +3 -3
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/extendable.rb +23 -23
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/ibeacon.rb +15 -15
- data/lib/{jss/api_object/self_servable → jamf/api/classic/api_objects}/icon.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/ldap_server.rb +45 -34
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/locatable.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mac_application.rb +18 -18
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/audit_event.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/casper_imaging_log.rb +4 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/casper_remote_log.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/computer_usage_log.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/ebook.rb +7 -7
- data/lib/{jss/api_object/management_history/hashlike.rb → jamf/api/classic/api_objects/management_history/hash_like.rb} +3 -3
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mac_app_store_app.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mdm_command.rb +9 -9
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/mobile_device_app.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/policy_log.rb +5 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/screen_sharing_log.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history/user_location_change.rb +4 -4
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/management_history.rb +226 -189
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/matchable.rb +9 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mdm.rb +288 -167
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mobile_device.rb +63 -51
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/mobile_device_application.rb +77 -35
- data/lib/{jss/api_object/configuration_profile → jamf/api/classic/api_objects}/mobile_device_configuration_profile.rb +7 -10
- data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/mobile_device_extension_attribute.rb +19 -19
- data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/mobile_device_group.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/netboot_server.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/network_segment.rb +75 -61
- data/lib/{jss/api_object/configuration_profile → jamf/api/classic/api_objects}/osx_configuration_profile.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/package.rb +83 -74
- data/lib/{jss/api_object/patch_source → jamf/api/classic/api_objects}/patch_external_source.rb +9 -9
- data/lib/{jss/api_object/patch_source → jamf/api/classic/api_objects}/patch_internal_source.rb +5 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_policy.rb +70 -68
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_title/version.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/patch_title.rb +76 -64
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/peripheral.rb +24 -24
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/peripheral_type.rb +20 -20
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/policy.rb +121 -129
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/printer.rb +52 -52
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/purchasable.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/removable_macaddr.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/restricted_software.rb +21 -21
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/scopable/scope.rb +69 -64
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/scopable.rb +11 -13
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/script.rb +22 -22
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/self_servable.rb +49 -47
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/sitable.rb +8 -8
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/site.rb +6 -6
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/software_update_server.rb +5 -5
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/updatable.rb +13 -13
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/uploadable.rb +71 -29
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/user.rb +18 -18
- data/lib/{jss/api_object/extension_attribute → jamf/api/classic/api_objects}/user_extension_attribute.rb +12 -12
- data/lib/{jss/api_object/group → jamf/api/classic/api_objects}/user_group.rb +7 -7
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/vpp_account.rb +15 -15
- data/lib/{jss/api_object → jamf/api/classic/api_objects}/vppable.rb +5 -5
- data/lib/{jss/api_object/webhook.rb → jamf/api/classic/api_objects/web_hook.rb} +15 -15
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/advanced_search.rb +36 -40
- data/lib/{jss → jamf/api/classic/base_classes}/api_object.rb +320 -280
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/configuration_profile.rb +13 -16
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/extension_attribute.rb +55 -59
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/group.rb +97 -78
- data/lib/{jss/api_object → jamf/api/classic/base_classes}/patch_source.rb +107 -87
- data/lib/{jss → jamf/api/classic}/xml_workaround.rb +12 -12
- data/lib/jamf/api/connection/attributes.rb +224 -0
- data/lib/jamf/api/connection/cache.rb +148 -0
- data/lib/jamf/api/connection/classic_api.rb +288 -0
- data/lib/jamf/api/connection/connect.rb +538 -0
- data/lib/jamf/api/connection/constants.rb +112 -0
- data/lib/jamf/api/connection/default_connection.rb +103 -0
- data/lib/jamf/api/connection/jamf_pro_api.rb +174 -0
- data/lib/jamf/api/connection/jamf_pro_api_error.rb +109 -0
- data/lib/jamf/api/connection/token.rb +295 -99
- data/lib/jamf/api/connection.rb +189 -818
- data/lib/jamf/api/jamf_pro/api_objects/computer_prestage.rb +82 -0
- data/lib/jamf/api/jamf_pro/api_objects/device_enrollment.rb +358 -0
- data/lib/jamf/api/jamf_pro/api_objects/inventory_preload_record.rb +172 -0
- data/lib/jamf/api/jamf_pro/api_objects/jp_building.rb +116 -0
- data/lib/jamf/api/jamf_pro/api_objects/mobile_device_prestage.rb +87 -0
- data/lib/jamf/api/jamf_pro/base_classes/oapi_object.rb +614 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/bulk_deletable.rb +2 -1
- data/lib/jamf/api/jamf_pro/mixins/change_log.rb +246 -0
- data/lib/jamf/api/jamf_pro/mixins/collection_resource.rb +762 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/filterable.rb +21 -14
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/immutable.rb +6 -8
- data/lib/jamf/api/jamf_pro/mixins/jpapi_resource.rb +167 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/lockable.rb +29 -3
- data/lib/jamf/api/jamf_pro/mixins/macos_managed_updates.rb +168 -0
- data/lib/jamf/api/jamf_pro/mixins/prestage.rb +356 -0
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/sortable.rb +7 -17
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/uncreatable.rb +2 -2
- data/lib/jamf/api/{mixins → jamf_pro/mixins}/undeletable.rb +2 -2
- data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_preview_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/access_groups_v2_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account.rb +159 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_driven_user_enrollment_session_token_settings.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_group.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v1.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/account_preferences_v4.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_history.rb +160 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_history_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/active_patch_summary.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/admin_account.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search_criteria_choices.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_search_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_user_content_search.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/advanced_user_content_search_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/android_details.rb +162 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/api_error.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/api_error_cause.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_analytics_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_dynamics_config.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_path.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_form_input_field.rb +114 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_form_input_field_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/app_request_settings.rb +104 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/apple_tv_details.rb +132 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/application_attributes.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/application_configuration.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/assign_remove_profile_response_sync_state.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/attributes.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_account_v1.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_token.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/auth_token_v1.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/authorization.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/authorization_v1.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/available_updates.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_ad_migration_report_process_status.rb +115 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_ad_migration_report_request.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration_request.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_configuration_update.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_mappings.rb +157 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration_request.rb +145 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/azure_server_configuration_update.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/branding_image_url.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/building.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/building_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cache_settings.rb +149 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/categories_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/category.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_details.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_identity_v2.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_key.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/certificate_record.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/classic_ldap_mappings.rb +168 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/client_check_in_v2.rb +164 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/client_check_in_v3.rb +134 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common_request.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_id_p_common_response.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_connection_pool_statistics.rb +170 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_connection_status.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_keystore.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_keystore_file.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_mappings_request.rb +101 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_mappings_response.rb +101 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_request.rb +151 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_response.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/cloud_ldap_server_update.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_application.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_attachment.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_certificate.rb +151 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_configuration_profile.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching.rb +372 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_alert.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_cache_detail.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_data_migration_error_user_info.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_alert.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_capabilities.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_details.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_content_caching_parent_local_network.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk.rb +143 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_disk_encryption.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_extension_attribute.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_font.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general.rb +230 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_general_update.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_group.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware.rb +264 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_hardware_update.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_ibeacon.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory.rb +275 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_collection_preferences.rb +165 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_collection_settings.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_recovery_lock_password_response.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_inventory_update_request.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_licensed_software.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_local_user_account.rb +189 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_location.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_mdm_capability.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system.rb +132 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_operating_system_update.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_overview.rb +179 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_package_receipts.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition.rb +145 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_encryption.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_partition_file_vault2_state.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_plugin.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_prestage_v2.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_printer.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_purchase.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_remote_management.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_section.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_security.rb +179 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_service.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_software_update.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_storage.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computer_user_and_location.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/computers_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/configuration_profile.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/configuration_search_results.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_candidate_request.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_response.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_status_response.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/connection_configuration_update_request.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/country.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/country_codes.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/create_path.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/csa_token.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/current_account.rb +159 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/current_authorization.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/data_roaming_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/database_password.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/day_of_week.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/delete_user_command.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/department.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/departments_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/deployment_task.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/deployment_task_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_communication_settings.rb +128 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_compliance_information.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_device.rb +162 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_device_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_disown_body.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_disown_response.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance.rb +163 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_instance_sync_status.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_prestage.rb +215 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_prestage_v2.rb +234 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/device_enrollment_token.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/diagnostic_submission_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook.rb +152 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_exclusions.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_limitations.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_scope.rb +170 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ebook_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enable_lost_mode_command.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/engage.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group_preview.rb +141 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_access_group_v2.rb +132 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_branding_settings.rb +111 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_dependencies.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_dependency.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_ldap_group_access.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_ldap_auth.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_list.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_sso_auth.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_panel_text.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_customization_v2.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_method.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_process_text_object.rb +346 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/enrollment_settings_v2.rb +273 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/export_field.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/export_parameters.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/extension_attribute.rb +115 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/extension_attribute_v2.rb +116 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/external_recipient.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment_delete.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/file_attachment_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/filter.rb +104 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/font_path.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_computer_prestage.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_computer_prestage_v2.rb +104 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_ldap_auth.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_sso_auth.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_enrollment_customization_panel_text.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_mobile_device_prestage.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/get_mobile_device_prestage_v2.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_mappings.rb +138 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_membership.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search_request.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/group_test_search_response.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/history_search_results.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/history_search_results_v1.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/href_response.rb +168 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/icon_response.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/id_and_name.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/id_and_name_v2.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ids.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/initialize.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/initialize_v1.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/install_package.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/integer_wrapper.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/internal_recipient.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_information.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_error.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_error.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_error_cause.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_csv_validation_success.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute_column.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_extension_attribute_column_result.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_invalid_csv_response.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record.rb +248 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/inventory_preload_record_v2.rb +263 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_branding_configuration.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_branding_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_details.rb +255 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ios_details_v2.rb +255 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_application_response.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_nation_credentials.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_package_response.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_information.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_information_v2.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_server_url.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_pro_version.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/jamf_protect_plan.rb +125 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/language_code.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_request.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_response.rb +101 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_configuration_update.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_group.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_group_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/ldap_server.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/linked_connect_profile.rb +126 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/linked_connect_profile_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/locale.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location.rb +125 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_information.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_information_v2.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/location_v2.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_branding_configuration.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_branding_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_managed_software_update.rb +138 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mac_os_managed_software_update_response.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/markdown.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_client_type.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_client.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_request.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_state.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mdm_command_type.rb +172 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/membership_mappings.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/membership_test_search_request.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/membership_test_search_response.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/memcached_endpoints.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_application.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_attachment.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_attachment_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_certificate_v1.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_certificate_v2.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details.rb +235 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details_get_v2.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_details_v2.rb +259 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_ebook.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_extension_attribute_results.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_group.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage.rb +136 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_name_v2.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_names_v2.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_prestage_v2.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_params.rb +144 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_search_results_v2.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/mobile_device_v2.rb +158 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/network.rb +171 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/network_v2.rb +179 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/notification.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/notification_type.rb +141 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/notification_v1.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/object_history.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/object_history_note.rb +133 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/object_history_v1.rb +106 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/order_by.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/package_manifest.rb +148 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/parent_app.rb +131 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_ids_on_dashboard.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_attempt.rb +102 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_attempt_action.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_log.rb +124 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_log_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_on_dashboard.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_policy_summary.rb +146 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/patch_version.rb +96 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/personal_hotspot_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plan_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/plugin_path.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/policy_properties.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/policy_properties_v1.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/post_computer_prestage_v2.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_dependencies.rb +85 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_dependency.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_file_attachment.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_file_attachment_v2.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information.rb +174 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_purchasing_information_v2.rb +174 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_assignment_v2.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_response.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_response_v2.rb +109 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_update.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_scope_v2.rb +84 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_sync_status.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/prestage_sync_status_v2.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/process_texts_search_results.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/protect_registration_request.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/protect_settings_response.rb +141 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/protect_updatable_settings_request.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/provisioning_profile.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/purchasing.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/purchasing_v2.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_computer_prestage.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_computer_prestage_v2.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_mobile_device_prestage.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/put_mobile_device_prestage_v2.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/recalculation_results.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/recipient.rb +94 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/recipients.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/redeploy_jamf_management_framework_response.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/reenrollment.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/remote_administration_response.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/remote_administration_search_results.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/renew_mdm_profile_response.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/restart_device_command.rb +95 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/retry_patch_policy_params.rb +97 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/safelisted_app.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/script.rb +192 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/scripts_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/search_active_patch_history_params.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/search_patch_policy_log_params.rb +121 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/security.rb +130 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/security_v2.rb +129 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_install_settings.rb +92 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_interaction_settings.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_login_settings.rb +113 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/self_service_settings.rb +100 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_candidate_request.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_details.rb +175 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_details_search_results.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/session_status.rb +98 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/set_recovery_lock_command.rb +82 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/settings_command.rb +167 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/shared_device_configuration.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/signature.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/site.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/smart_search_criterion.rb +118 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/software_title_configuration.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/software_title_patch_policy_summaries.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/software_update_settings.rb +88 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore.rb +128 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_cert_parse_response.rb +130 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_details.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_parse.rb +103 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_response.rb +120 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_response_with_details.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_keystore_with_details.rb +93 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_metadata_url.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/sso_settings.rb +240 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/startup_status.rb +185 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/static_user_group.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_certificate_upload.rb +99 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_create.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/supervision_identity_update.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_features.rb +105 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_settings_request.rb +108 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/teacher_settings_response.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/time_frame.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/time_zone.rb +107 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/tv_os_details.rb +140 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/udids.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_apple_tv.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_ios.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_ios_v2.rb +81 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_mobile_device.rb +122 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_mobile_device_v2.rb +137 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/update_tv_os.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_attributes.rb +117 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_mappings.rb +193 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search.rb +112 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search_request.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/user_test_search_response.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/v1_site.rb +91 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_ca_record.rb +147 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_pki_payload_record.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_pki_payload_record_search_results.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/venafi_service_status.rb +83 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/verbose_package_deployment_response.rb +90 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/voice_roaming_setting.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_content.rb +153 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_list_view.rb +171 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_patch.rb +111 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_location_post.rb +114 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_locations.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscription.rb +86 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscription_base.rb +127 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/volume_purchasing_subscriptions.rb +89 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/vpp_admin_account.rb +119 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/vpp_token_subscription.rb +123 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas/web_link.rb +87 -0
- data/lib/jamf/api/jamf_pro/oapi_schemas.rb +35 -0
- data/lib/jamf/api/jamf_pro/other_classes/change_log_entry.rb +37 -0
- data/lib/jamf/api/{attribute_classes → jamf_pro/other_classes}/ip_address.rb +2 -8
- data/lib/jamf/api/jamf_pro/other_classes/pager.rb +257 -0
- data/lib/jamf/api/{attribute_classes → jamf_pro/other_classes}/timestamp.rb +18 -14
- data/lib/jamf/{api/mixins/base_class.rb → base_class.rb} +8 -8
- data/lib/jamf/client/jamf_binary.rb +104 -99
- data/lib/jamf/client/jamf_helper.rb +274 -256
- data/lib/jamf/client/management_action.rb +84 -75
- data/lib/jamf/client.rb +15 -86
- data/lib/jamf/composer.rb +5 -5
- data/lib/jamf/configuration.rb +219 -196
- data/lib/jamf/{api/json_objects/prestage_sync_status.rb → constants.rb} +15 -32
- data/lib/{jss → jamf}/db_connection.rb +23 -31
- data/lib/{jpapi.rb → jamf/deprecations/deprecated_api_constant.rb} +5 -4
- data/lib/{jss/ruby_extensions/string.rb → jamf/deprecations/deprecated_config_constant.rb} +4 -12
- data/lib/jamf/exceptions.rb +14 -15
- data/lib/jamf/oapi_validate.rb +502 -0
- data/lib/jamf/ruby_extensions/array/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/array/utils.rb +2 -11
- data/lib/jamf/ruby_extensions/array.rb +1 -1
- data/lib/jamf/ruby_extensions/filetest/predicates.rb +2 -1
- data/lib/jamf/ruby_extensions/filetest.rb +1 -1
- data/lib/jamf/ruby_extensions/hash/{backports.rb → utils.rb} +53 -34
- data/lib/jamf/ruby_extensions/hash.rb +3 -3
- data/lib/jamf/ruby_extensions/ipaddr/utils.rb +7 -4
- data/lib/jamf/ruby_extensions/ipaddr.rb +2 -2
- data/lib/jamf/ruby_extensions/object/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/object.rb +1 -1
- data/lib/jamf/ruby_extensions/pathname/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/pathname/utils.rb +11 -5
- data/lib/jamf/ruby_extensions/pathname.rb +1 -1
- data/lib/jamf/ruby_extensions/string/conversions.rb +16 -1
- data/lib/jamf/ruby_extensions/string/predicates.rb +3 -1
- data/lib/jamf/ruby_extensions/string.rb +1 -3
- data/lib/{jss/ruby_extensions/time.rb → jamf/ruby_extensions/time/utils.rb} +40 -25
- data/lib/{jss/version.rb → jamf/ruby_extensions/time.rb} +7 -6
- data/lib/jamf/ruby_extensions.rb +9 -9
- data/lib/jamf/utility.rb +626 -410
- data/lib/jamf/validate.rb +86 -125
- data/lib/jamf/version.rb +3 -3
- data/lib/jamf.rb +76 -131
- data/lib/jss-api.rb +2 -2
- data/lib/jss.rb +3 -215
- data/lib/ruby-jss.rb +2 -2
- data/lib/zeitwerk_config.rb +163 -0
- data/test/README-TEST.md +65 -0
- data/test/bin/runtests +97 -130
- data/test/lib/jamf_test/APITest.rb +106 -0
- data/{lib/jss/ruby_extensions/filetest.rb → test/lib/jamf_test/advanced_search.rb} +16 -20
- data/test/lib/jamf_test/auth.rb +267 -0
- data/test/lib/jamf_test/collection_tests.rb +388 -0
- data/test/lib/jamf_test/prestage_tests.rb +135 -0
- data/test/lib/{testhelper.rb → jamf_test.rb} +15 -12
- data/{lib/jss/ruby_extensions.rb → test/tests/advanced_computer_search.rb} +11 -12
- data/test/tests/advanced_mobile_device_search.rb +36 -0
- data/test/tests/advanced_user_search.rb +36 -0
- data/test/tests/building.rb +41 -0
- data/test/tests/category.rb +41 -0
- data/test/tests/computer.rb +41 -0
- data/test/tests/computer_group.rb +132 -0
- data/test/tests/computer_prestage.rb +36 -0
- data/test/tests/department.rb +41 -0
- data/test/tests/device_enrollment.rb +101 -0
- data/test/tests/inventory_preload_record.rb +131 -0
- data/test/tests/jp_building.rb +41 -0
- data/test/tests/mobile_device.rb +41 -0
- data/test/tests/mobile_device_prestage.rb +37 -0
- data/test/tests/policy.rb +151 -0
- metadata +654 -213
- data/lib/jamf/api/base_classes/collection_resource.rb +0 -612
- data/lib/jamf/api/base_classes/json_object.rb +0 -1103
- data/lib/jamf/api/base_classes/prestage.rb +0 -503
- data/lib/jamf/api/base_classes/resource.rb +0 -259
- data/lib/jamf/api/base_classes/singleton_resource.rb +0 -88
- data/lib/jamf/api/connection/api_error.rb +0 -111
- data/lib/jamf/api/connection/api_error_styleguide.rb +0 -96
- data/lib/jamf/api/json_objects/change_log_entry.rb +0 -77
- data/lib/jamf/api/json_objects/country.rb +0 -51
- data/lib/jamf/api/json_objects/device_enrollment_device.rb +0 -165
- data/lib/jamf/api/json_objects/device_enrollment_device_sync_state.rb +0 -81
- data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +0 -71
- data/lib/jamf/api/json_objects/inventory_preload_extension_attribute.rb +0 -57
- data/lib/jamf/api/json_objects/locale.rb +0 -59
- data/lib/jamf/api/json_objects/md_prestage_name.rb +0 -57
- data/lib/jamf/api/json_objects/md_prestage_names.rb +0 -82
- data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +0 -214
- data/lib/jamf/api/json_objects/prestage_assignment.rb +0 -76
- data/lib/jamf/api/json_objects/prestage_location.rb +0 -104
- data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +0 -132
- data/lib/jamf/api/json_objects/prestage_scope.rb +0 -57
- data/lib/jamf/api/json_objects/time_zone.rb +0 -105
- data/lib/jamf/api/mixins/change_log.rb +0 -288
- data/lib/jamf/api/mixins/extendable.rb +0 -75
- data/lib/jamf/api/mixins/pageable.rb +0 -208
- data/lib/jamf/api/mixins/searchable.rb +0 -202
- data/lib/jamf/api/resources/collection_resources/building.rb +0 -121
- data/lib/jamf/api/resources/collection_resources/category.rb +0 -83
- data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +0 -89
- data/lib/jamf/api/resources/collection_resources/department.rb +0 -78
- data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +0 -384
- data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +0 -289
- data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +0 -143
- data/lib/jamf/api/resources/collection_resources/script.rb +0 -226
- data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +0 -141
- data/lib/jamf/api/resources/singleton_resources/locales.rb +0 -155
- data/lib/jamf/api/resources/singleton_resources/time_zones.rb +0 -213
- data/lib/jamf/compatibility.rb +0 -88
- data/lib/jamf/ruby_extensions/dig.rb +0 -52
- data/lib/jamf/ruby_extensions/string/backports.rb +0 -66
- data/lib/jss/api_connection.rb +0 -1029
- data/lib/jss/api_object/app_store_country_codes.rb +0 -298
- data/lib/jss/api_object/computer/application_installs.rb +0 -118
- data/lib/jss/client/jamf_binary.rb +0 -132
- data/lib/jss/client/jamf_helper.rb +0 -298
- data/lib/jss/client/management_action.rb +0 -113
- data/lib/jss/client.rb +0 -301
- data/lib/jss/compatibility.rb +0 -88
- data/lib/jss/composer.rb +0 -190
- data/lib/jss/configuration.rb +0 -319
- data/lib/jss/exceptions.rb +0 -115
- data/lib/jss/ruby_extensions/array.rb +0 -52
- data/lib/jss/ruby_extensions/hash.rb +0 -140
- data/lib/jss/ruby_extensions/ipaddr.rb +0 -92
- data/lib/jss/ruby_extensions/object.rb +0 -19
- data/lib/jss/ruby_extensions/pathname.rb +0 -78
- data/lib/jss/ruby_extensions/string/backports.rb +0 -68
- data/lib/jss/ruby_extensions/string/conversions.rb +0 -69
- data/lib/jss/ruby_extensions/string/predicates.rb +0 -57
- data/lib/jss/server.rb +0 -146
- data/lib/jss/utility.rb +0 -672
- data/lib/jss/validate.rb +0 -248
- data/test/README.md +0 -147
- data/test/lib/testhelper/auth.rb +0 -275
- data/test/lib/testhelper/patch_mgmt.rb +0 -123
- data/test/specs/api_connection_spec.rb +0 -57
- data/test/specs/patch01_source_spec.rb +0 -54
- data/test/specs/patch02_internal_source_spec.rb +0 -88
- data/test/specs/patch03_external_source_spec.rb +0 -120
- data/test/specs/patch04_titles_spec.rb +0 -207
- data/test/specs/patch05_policies_spec.rb +0 -119
- data/test/specs/patch06_cleanup_spec.rb +0 -52
- data/test/specs/policy_spec.rb +0 -112
data/lib/jss/validate.rb
DELETED
@@ -1,248 +0,0 @@
|
|
1
|
-
# Copyright 2020 Pixar
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
-
# with the following modification; you may not use this file except in
|
5
|
-
# compliance with the Apache License and the following modification to it:
|
6
|
-
# Section 6. Trademarks. is deleted and replaced with:
|
7
|
-
#
|
8
|
-
# 6. Trademarks. This License does not grant permission to use the trade
|
9
|
-
# names, trademarks, service marks, or product names of the Licensor
|
10
|
-
# and its affiliates, except as required to comply with Section 4(c) of
|
11
|
-
# the License and to reproduce the content of the NOTICE file.
|
12
|
-
#
|
13
|
-
# You may obtain a copy of the Apache License at
|
14
|
-
#
|
15
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
16
|
-
#
|
17
|
-
# Unless required by applicable law or agreed to in writing, software
|
18
|
-
# distributed under the Apache License with the above modification is
|
19
|
-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
-
# KIND, either express or implied. See the Apache License for the specific
|
21
|
-
# language governing permissions and limitations under the Apache License.
|
22
|
-
#
|
23
|
-
#
|
24
|
-
|
25
|
-
module JSS
|
26
|
-
|
27
|
-
# A collection of methods for validating values. Mostly for
|
28
|
-
# ensuring the validity of data being set as attributes of APIObject
|
29
|
-
# subclass instances.
|
30
|
-
#
|
31
|
-
# Some of these methods can take multiple input types, such as a String
|
32
|
-
# or an Array. All of them will either raise an exception
|
33
|
-
# if the value isn't valid, or will return a standardized form of the input
|
34
|
-
# (e.g. an Array, even if given a String)
|
35
|
-
#
|
36
|
-
module Validate
|
37
|
-
|
38
|
-
# The regular expression that matches a valid MAC address.
|
39
|
-
MAC_ADDR_RE = /^[a-f0-9]{2}(:[a-f0-9]{2}){5}$/i
|
40
|
-
|
41
|
-
# Validate the format and content of a MAC address
|
42
|
-
#
|
43
|
-
# @param val[String] The value to validate
|
44
|
-
#
|
45
|
-
# @param msg[String] A custom error message when the value is invalid
|
46
|
-
#
|
47
|
-
# @return [String] The valid value
|
48
|
-
#
|
49
|
-
def self.mac_address(val, msg = nil)
|
50
|
-
msg ||= "Not a valid MAC address: '#{val}'"
|
51
|
-
raise JSS::InvalidDataError, msg unless val =~ MAC_ADDR_RE
|
52
|
-
|
53
|
-
val
|
54
|
-
end
|
55
|
-
|
56
|
-
# Segments of a valid IPv4 address are integers in this range.
|
57
|
-
IP_SEGMENT_RANGE = 0..255
|
58
|
-
|
59
|
-
# Validate the format and content of an IPv4 address
|
60
|
-
#
|
61
|
-
# @param val[String] The value to validate
|
62
|
-
#
|
63
|
-
# @param msg[String] A custom error message when the value is invalid
|
64
|
-
#
|
65
|
-
# @return [String] The valid value
|
66
|
-
#
|
67
|
-
def self.ip_address(val, msg = nil)
|
68
|
-
msg ||= "Not a valid IPv4 address: '#{val}'"
|
69
|
-
ok = true
|
70
|
-
parts = val.strip.split '.'
|
71
|
-
ok = false unless parts.size == 4
|
72
|
-
parts.each { |p| ok = false unless p.jss_integer? && IP_SEGMENT_RANGE.include?(p.to_i) }
|
73
|
-
raise JSS::InvalidDataError, msg unless ok
|
74
|
-
|
75
|
-
val
|
76
|
-
end
|
77
|
-
|
78
|
-
# Validate that a value doesn't already exist for a given identifier of a
|
79
|
-
# given class
|
80
|
-
#
|
81
|
-
# e.g. when klass = JSS::Computer, identifier = :name, and val = 'foo'
|
82
|
-
# will raise an error when a computer named 'foo' exists
|
83
|
-
#
|
84
|
-
# Otherwise returns val.
|
85
|
-
#
|
86
|
-
# @param klass[JSS::APIObject] A subclass of JSS::APIObject, e.g. JSS::Computer
|
87
|
-
#
|
88
|
-
# @param identifier[Symbol] One of the keys of an Item of the class's #all Array
|
89
|
-
#
|
90
|
-
# @param val[Object] The value to check for uniqueness
|
91
|
-
#
|
92
|
-
# @param msg[String] A custom error message when the value is invalid
|
93
|
-
#
|
94
|
-
# @param api[JSS::APIConnection] The api connection to use for validation
|
95
|
-
#
|
96
|
-
# @return [Object] the validated unique value
|
97
|
-
#
|
98
|
-
def self.doesnt_already_exist(klass, identifier, val, msg = nil, api: JSS.api)
|
99
|
-
msg ||= "A #{klass} already exists with #{identifier} '#{val}'"
|
100
|
-
return val unless klass.all(:refresh, api: api).map { |i| i[identifier] }.include? val
|
101
|
-
|
102
|
-
key = klass.real_lookup_key identifier
|
103
|
-
|
104
|
-
# use map_all_ids_to cuz it works with any identifer, even non-existing
|
105
|
-
existing_values = klass.map_all_ids_to( key, api: api).values
|
106
|
-
matches = existing_values.select { |existing_val| existing_val.casecmp? val }
|
107
|
-
return val if matches.empty?
|
108
|
-
|
109
|
-
raise JSS::AlreadyExistsError, msg
|
110
|
-
end
|
111
|
-
|
112
|
-
# Confirm that the given value is a boolean value, accepting
|
113
|
-
# strings and symbols and returning real booleans as needed
|
114
|
-
# Accepts: true, false, 'true', 'false', 'yes', 'no', 't','f', 'y', or 'n'
|
115
|
-
# as strings or symbols, case insensitive
|
116
|
-
#
|
117
|
-
# TODO: use this throughout ruby-jss
|
118
|
-
#
|
119
|
-
# @param bool [Boolean,String,Symbol] The value to validate
|
120
|
-
#
|
121
|
-
# @param msg[String] A custom error message when the value is invalid
|
122
|
-
#
|
123
|
-
# @return [Boolean] the valid boolean
|
124
|
-
#
|
125
|
-
def self.boolean(bool, msg = nil)
|
126
|
-
return bool if JSS::TRUE_FALSE.include? bool
|
127
|
-
return true if bool.to_s =~ /^(t(rue)?|y(es)?)$/i
|
128
|
-
return false if bool.to_s =~ /^(f(alse)?|no?)$/i
|
129
|
-
|
130
|
-
msg ||= 'Value must be boolean true or false, or an equivalent string or symbol'
|
131
|
-
raise JSS::InvalidDataError, msg
|
132
|
-
end
|
133
|
-
|
134
|
-
# Confirm that a value is an integer or a string representation of an
|
135
|
-
# integer. Return the integer, or raise an error
|
136
|
-
#
|
137
|
-
# TODO: use this throughout ruby-jss
|
138
|
-
#
|
139
|
-
# @param val[Object] the value to validate
|
140
|
-
#
|
141
|
-
# @param msg[String] A custom error message when the value is invalid
|
142
|
-
#
|
143
|
-
# @return [void]
|
144
|
-
#
|
145
|
-
def self.integer(val, msg = nil)
|
146
|
-
msg ||= 'Value must be an integer'
|
147
|
-
val = val.to_i if val.is_a?(String) && val.jss_integer?
|
148
|
-
raise JSS::InvalidDataError, msg unless val.is_a? Integer
|
149
|
-
|
150
|
-
val
|
151
|
-
end
|
152
|
-
|
153
|
-
# validate that the given value is a non-empty string
|
154
|
-
#
|
155
|
-
# @param val [Object] the thing to validate
|
156
|
-
#
|
157
|
-
# @param msg[String] A custom error message when the value is invalid
|
158
|
-
#
|
159
|
-
# @return [String] the valid non-empty string
|
160
|
-
#
|
161
|
-
def self.non_empty_string(val, msg = nil)
|
162
|
-
msg ||= 'value must be a non-empty String'
|
163
|
-
raise JSS::InvalidDataError, msg unless val.is_a?(String) && !val.empty?
|
164
|
-
|
165
|
-
val
|
166
|
-
end
|
167
|
-
|
168
|
-
UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.freeze
|
169
|
-
|
170
|
-
# validate that the given value is a valid uuid string
|
171
|
-
#
|
172
|
-
# @param val [Object] the thing to validate
|
173
|
-
#
|
174
|
-
# @param msg[String] A custom error message when the value is invalid
|
175
|
-
#
|
176
|
-
# @return [String] the valid uuid string
|
177
|
-
#
|
178
|
-
def self.uuid(val, msg = nil)
|
179
|
-
return val if val.is_a?(String) && val =~ UUID_RE
|
180
|
-
|
181
|
-
msg ||= 'value must be valid uuid'
|
182
|
-
raise JSS::InvalidDataError, msg
|
183
|
-
end
|
184
|
-
|
185
|
-
# validate that the given value is an integer in the JSS::IBeacon::MAJOR_MINOR_RANGE
|
186
|
-
#
|
187
|
-
# @param val [Object] the thing to validate
|
188
|
-
#
|
189
|
-
# @param msg[String] A custom error message when the value is invalid
|
190
|
-
#
|
191
|
-
# @return [String] the valid integer
|
192
|
-
#
|
193
|
-
def self.ibeacon_major_minor(val, msg = nil)
|
194
|
-
val = val.to_i if val.is_a?(String) && val.jss_integer?
|
195
|
-
ok = val.is_a? Integer
|
196
|
-
ok = JSS::IBeacon::MAJOR_MINOR_RANGE.include? val if ok
|
197
|
-
return val if ok
|
198
|
-
|
199
|
-
msg ||= "value must be an integer in the range #{JSS::IBeacon::MAJOR_MINOR_RANGE}"
|
200
|
-
raise JSS::InvalidDataError, msg unless ok
|
201
|
-
end
|
202
|
-
|
203
|
-
# validate a country name or code from JSS::APP_STORE_COUNTRY_CODES
|
204
|
-
# returning the validated code, or raising an error
|
205
|
-
#
|
206
|
-
# @param country[String] The country name or code
|
207
|
-
#
|
208
|
-
# @param msg[String] A custom error message when the value is invalid
|
209
|
-
#
|
210
|
-
# @return [String] the valid two-letter country code
|
211
|
-
#
|
212
|
-
def self.app_store_country_code(country, msg = nil)
|
213
|
-
country = country.to_s.upcase
|
214
|
-
return country if JSS::APP_STORE_COUNTRY_CODES.value? country
|
215
|
-
|
216
|
-
JSS::APP_STORE_COUNTRY_CODES.each do |name, code|
|
217
|
-
return code if name.upcase == country
|
218
|
-
end
|
219
|
-
|
220
|
-
msg ||= 'Unknown country name or code. See JSS::APP_STORE_COUNTRY_CODES or JSS.country_code_match(str)'
|
221
|
-
raise JSS::InvalidDataError, msg
|
222
|
-
end
|
223
|
-
|
224
|
-
# validate an email address - must match the RegEx /^\S+@\S+\.\S+$/
|
225
|
-
# i.e.:
|
226
|
-
# 1 or more non-whitespace chars, followed by
|
227
|
-
# an @ character, followed by
|
228
|
-
# 1 or more non-whitespace chars, followed by
|
229
|
-
# a dot, followed by
|
230
|
-
# 1 or more non-whitespace chars
|
231
|
-
#
|
232
|
-
# @param email[String] The email address
|
233
|
-
#
|
234
|
-
# @param msg[String] A custom error message when the value is invalid
|
235
|
-
#
|
236
|
-
# @return [String] the validly formatted email address
|
237
|
-
#
|
238
|
-
def self.email_address(email, msg = nil)
|
239
|
-
msg ||= "'#{email}' is not formatted as a valid email address"
|
240
|
-
email = email.to_s
|
241
|
-
return email if email =~ /^\S+@\S+\.\S+$/
|
242
|
-
|
243
|
-
raise JSS::InvalidDataError, msg
|
244
|
-
end
|
245
|
-
|
246
|
-
end # module validate
|
247
|
-
|
248
|
-
end # module JSS
|
data/test/README.md
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
# About the ruby-jss test suite
|
2
|
-
|
3
|
-
For years, I've attempted to use some ruby testing framework to automate testing of ruby-jss.
|
4
|
-
|
5
|
-
Every time I've run into walls because unit testing suites are designed for unit testing, and that's not really what we need to do. Yes we need to test individual methods of classes and so on, but when working with a REST API, there's a lot of
|
6
|
-
scaffolding that needs to happen before tests can even start - and that scaffolding itself is testing the code. And the details of the scaffolding will vary in different environments. We need to run integration tests.
|
7
|
-
|
8
|
-
For example, the tests *must* be very interactive from the start - you have to tell them what server to connect with, what credentials to use, and so on.
|
9
|
-
|
10
|
-
Once connected, objects have to be created before they can be listed, fetched, updated, or deleted - so test order matters.
|
11
|
-
|
12
|
-
Also, you need to be able to have later tests refer to the same objects you created in earlier tests. Once I've tested that I can create an object on the server and re-fetch it once, I should be able to use that object for all future tests without fetching every time, much less re-creating it every time!
|
13
|
-
|
14
|
-
Reading most tutorials about ruby testing just leads you in circles when you consider needs such as these.
|
15
|
-
|
16
|
-
Many propnents of unit testing might find this suite odd. Thats ok. Any functional testing suite is better than none and I'm open to suggestions for improvement.
|
17
|
-
|
18
|
-
### Here's how to use it:
|
19
|
-
|
20
|
-
tldr:
|
21
|
-
|
22
|
-
`/path/to/your/ruby-jss/gem/installation/test/bin/runtests --server myjss.company.com --user myjssusername`
|
23
|
-
|
24
|
-
Must be run on a mac, it uses your keychain to store connection data and credentials, so you only have to provide them the first time or when changing them.
|
25
|
-
|
26
|
-
See below for the help output
|
27
|
-
|
28
|
-
### Here's how this thing works:
|
29
|
-
|
30
|
-
- The tests are ultimatly MiniTest::Spec specifications, defined in files in the 'specs' folder.
|
31
|
-
- See http://ruby-doc.org/stdlib-2.0.0/libdoc/minitest/rdoc/MiniTest.html
|
32
|
-
- also, google around for help with minitest specs
|
33
|
-
|
34
|
-
|
35
|
-
- They do NOT use minitest/autorun. Instead, the 'runtests' executable handles loading and running them
|
36
|
-
- See below for the help output
|
37
|
-
|
38
|
-
|
39
|
-
- The runtests command, via methods in the JSSTestHelper module, handles connecting to servers.
|
40
|
-
- it takes options to define connection parameters.
|
41
|
-
- At the moment they are limited to user, hostname and port, but will be expanded eventually
|
42
|
-
- it prompts for passwords as needed
|
43
|
-
- it must be run on a Mac! It stores connection parameters in your keychain.
|
44
|
-
- it uses connection parameters from your keychain if they are present. meaning after the first use,
|
45
|
-
it will connect to the same server as the same user with no commandline options.
|
46
|
-
- If any commandline options are different from whats in the keychain, the keychain will be updated,
|
47
|
-
prompting for new passwords if needed.
|
48
|
-
|
49
|
-
- The JSSTestHelper module also provides ways for tests to share data.
|
50
|
-
|
51
|
-
- The runtests command will run the spec files listed on the command line, or all of them if none are listed.
|
52
|
-
- The tests are run verbosely, so you can see what tests are being run.
|
53
|
-
- Some tests are interactive - they will ask you to make choices about what's happening.
|
54
|
-
|
55
|
-
WARNING: **Be very careful about running these tests on your production JSS !!!**
|
56
|
-
|
57
|
-
These tests create and delete objects in the JSS. While they _shouldn't_ hurt any of the existing data - we cannot make any guarantees that they won't hurt something you care about.
|
58
|
-
|
59
|
-
As the license text for ruby-jss states, ruby-jss is...
|
60
|
-
|
61
|
-
```
|
62
|
-
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
63
|
-
KIND, either express or implied.
|
64
|
-
```
|
65
|
-
|
66
|
-
As a reminder, if you connect to the same server that's listed in your /etc/ruby-jss.conf, you'll be asked for confirmation before the tests are run.
|
67
|
-
|
68
|
-
|
69
|
-
### The Spec Files
|
70
|
-
|
71
|
-
Each spec file defines one or more MiniTest::Spec's, each one being a 'describe SomeClass' block, containing methods and individual tests in 'it' blocks.
|
72
|
-
|
73
|
-
If you plan to write any tests, please read up on how to write MiniTest Specs.
|
74
|
-
|
75
|
-
However, here's some info that wasn't obvious when I first started, and makes life much easier when writing specs:
|
76
|
-
|
77
|
-
- the 'describe' blocks eventually become classes
|
78
|
-
- you can do anything inside them that you would do in a class definition.
|
79
|
-
- the 'it' blocks become methods in the class defined by the 'describe' block.
|
80
|
-
- the 'it' blocks are run one at a time, each in a separate instance of the class defined by the 'describe' block.
|
81
|
-
- by default, the 'it' blocks are run in a random order. See below if you need them to run in the defined order.
|
82
|
-
|
83
|
-
All of the above means that you can use constants, class methods, class-instance variables and instance methods in concert for processing and passing things between the individual tests.
|
84
|
-
|
85
|
-
### Running tests in order
|
86
|
-
|
87
|
-
The individual spec files are run in the order given on the command line. If none are given on the command line, all files are run in alphabetical order.
|
88
|
-
|
89
|
-
If you define multiple 'describe' blocks in a file, they will be run in random order.
|
90
|
-
|
91
|
-
The individual tests in a describe block are also run in random order, by default.
|
92
|
-
|
93
|
-
If you need the tests to run in order within a 'describe' block, then define this class method somewhere inside it:
|
94
|
-
|
95
|
-
def self.test_order
|
96
|
-
:alpha
|
97
|
-
end
|
98
|
-
|
99
|
-
The presence of that method will cause MiniTest to run them in the order defined.
|
100
|
-
|
101
|
-
### Help output from 'runtests -H'
|
102
|
-
|
103
|
-
|
104
|
-
```
|
105
|
-
Usage: runtests [options] [spec [spec ...]]
|
106
|
-
|
107
|
-
Runs one or more specification tests of ruby-jss.
|
108
|
-
|
109
|
-
The specifications are files in the directory:
|
110
|
-
/Users/chrisl/git/gemdev/ruby-jss/test/specs
|
111
|
-
|
112
|
-
The files must have a _spec.rb suffix, however you need not use the suffix when
|
113
|
-
listing tests to run on the command line, e.g. 'patch_source' will run
|
114
|
-
'patch_source_spec.rb'
|
115
|
-
|
116
|
-
If no specs files are listed on the command line, all will be run, in
|
117
|
-
alphabetical order.
|
118
|
-
|
119
|
-
By default, JSS connection settings are used from your /etc/ruby-jss.conf file
|
120
|
-
and/or ~/.ruby-jss.conf. Connection settings from the command line will be used
|
121
|
-
if provided.
|
122
|
-
|
123
|
-
WARNING: These tests create, modify, and delete objects in the JSS.
|
124
|
-
While no existing objects should be changed, * Be Careful * running them on
|
125
|
-
a production server.
|
126
|
-
If the server you're connecting to matches one defined in /etc/ruby-jss.conf
|
127
|
-
you will be asked for confirmation before proceding.
|
128
|
-
|
129
|
-
The first time you connect from this machine to a given server, you must provide
|
130
|
-
a username for the connection with --user, and will be prompted for the password.
|
131
|
-
Once authenticated, credentials for the server are saved in your keychain, and
|
132
|
-
future connections to that server will read the user & password from there.
|
133
|
-
If a different user is later specified for that server, you'll be prompted again
|
134
|
-
for a password, and the keychain will be updated.
|
135
|
-
|
136
|
-
Options
|
137
|
-
--server, -s <host> the hostname for the JSS API connection
|
138
|
-
--port, -p <port> the port for the API connection
|
139
|
-
--user, -u <user> the API username for the connection
|
140
|
-
NOTE: must have permissions to perform the tests!
|
141
|
-
--db-server, -S <host> the hostname for the JSS API connection
|
142
|
-
--db-port, -P <port> the port for the API connectino
|
143
|
-
--db-user, -U <user> the API username for the connection
|
144
|
-
--gem-dir, -g, -i <path> the path from which to require ruby-jss
|
145
|
-
(sets GEM_HOME to this path before requiring)
|
146
|
-
--help, -h, -H show this help
|
147
|
-
```
|
data/test/lib/testhelper/auth.rb
DELETED
@@ -1,275 +0,0 @@
|
|
1
|
-
### Copyright 2020 Pixar
|
2
|
-
|
3
|
-
###
|
4
|
-
### Licensed under the Apache License, Version 2.0 (the "Apache License")
|
5
|
-
### with the following modification; you may not use this file except in
|
6
|
-
### compliance with the Apache License and the following modification to it:
|
7
|
-
### Section 6. Trademarks. is deleted and replaced with:
|
8
|
-
###
|
9
|
-
### 6. Trademarks. This License does not grant permission to use the trade
|
10
|
-
### names, trademarks, service marks, or product names of the Licensor
|
11
|
-
### and its affiliates, except as required to comply with Section 4(c) of
|
12
|
-
### the License and to reproduce the content of the NOTICE file.
|
13
|
-
###
|
14
|
-
### You may obtain a copy of the Apache License at
|
15
|
-
###
|
16
|
-
### http://www.apache.org/licenses/LICENSE-2.0
|
17
|
-
###
|
18
|
-
### Unless required by applicable law or agreed to in writing, software
|
19
|
-
### distributed under the Apache License with the above modification is
|
20
|
-
### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
21
|
-
### KIND, either express or implied. See the Apache License for the specific
|
22
|
-
### language governing permissions and limitations under the Apache License.
|
23
|
-
###
|
24
|
-
###
|
25
|
-
|
26
|
-
module JSSTestHelper
|
27
|
-
|
28
|
-
# auth
|
29
|
-
module Auth
|
30
|
-
|
31
|
-
KEYCHAIN_LABEL_BASE = 'com.pixar.ruby-jss.testing'.freeze
|
32
|
-
|
33
|
-
KEYCHAIN_JSS_LABEL = KEYCHAIN_LABEL_BASE + '.api'
|
34
|
-
KEYCHAIN_DB_LABEL = KEYCHAIN_LABEL_BASE + '.db'
|
35
|
-
KEYCHAIN_DIST_LABEL = KEYCHAIN_LABEL_BASE + '.distribution'
|
36
|
-
|
37
|
-
KEYCHAIN_DIST_ACCT = 'From JSS'.freeze
|
38
|
-
|
39
|
-
KEYCHAIN_LABELS = {
|
40
|
-
jss: KEYCHAIN_JSS_LABEL,
|
41
|
-
db: KEYCHAIN_DB_LABEL,
|
42
|
-
dist: KEYCHAIN_DIST_LABEL
|
43
|
-
}.freeze
|
44
|
-
|
45
|
-
module_function
|
46
|
-
|
47
|
-
# return the user's API password, prompting for it if we don't already have
|
48
|
-
# it
|
49
|
-
#
|
50
|
-
def api_pw(server: nil, port: nil, user: nil)
|
51
|
-
return @api_pw if @api_pw
|
52
|
-
# If we're here, we need to get the pw via prompt
|
53
|
-
@api_pw = prompt_for_password prompt: "Enter the API password for #{user}@#{server}:#{port}" do |apw|
|
54
|
-
begin
|
55
|
-
JSS.api.disconnect
|
56
|
-
JSS.api.connect user: user, pw: apw, server: server, port: port
|
57
|
-
true
|
58
|
-
rescue JSS::AuthenticationError
|
59
|
-
false
|
60
|
-
end # begin
|
61
|
-
end # do apw
|
62
|
-
raise JSS::AuthenticationError, "Incorrect API password for #{user}@#{server}:#{port}" unless @api_pw
|
63
|
-
@api_pw
|
64
|
-
end
|
65
|
-
|
66
|
-
# return the server, port, and user, which we might have gotten fromthe keychain
|
67
|
-
def connect_to_api(server: nil, user: nil, port: nil, pw: nil)
|
68
|
-
return if JSS.api.connected?
|
69
|
-
|
70
|
-
JSS.api.connect server: server, port: port, user: user, pw: pw
|
71
|
-
@api_pw = pw
|
72
|
-
{ server: JSS.api.hostname, port: JSS.api.port, user: JSS.api.jss_user }
|
73
|
-
rescue JSS::AuthenticationError
|
74
|
-
# If we're here, we need to prompt for the pw
|
75
|
-
pw = api_pw server: server, port: port, user: user
|
76
|
-
ensure
|
77
|
-
# store the pw
|
78
|
-
save_rw_credentials label: KEYCHAIN_JSS_LABEL, acct: JSS.api.jss_user, server: JSS.api.hostname, port: JSS.api.port, pw: pw if JSS.api.connected?
|
79
|
-
end
|
80
|
-
|
81
|
-
# TODO: update this as API above so there's only one per keychain.
|
82
|
-
def db_pw
|
83
|
-
return @db_pw if @db_pw
|
84
|
-
|
85
|
-
# If we're here, we need to get the passwd for the user
|
86
|
-
@db_pw = prompt_for_password prompt: "Enter the MySQL password for #{@db_user}@#{@db_server}" do |apw|
|
87
|
-
begin
|
88
|
-
JSS::DB_CNX.disconnect
|
89
|
-
JSS::DB_CNX.connect server: @db_server, user: @db_user, pw: apw
|
90
|
-
true
|
91
|
-
rescue Mysql::ServerError::AccessDeniedError
|
92
|
-
false
|
93
|
-
end # begin
|
94
|
-
end # do apw
|
95
|
-
|
96
|
-
raise JSS::AuthenticationError, "Incorrect MySQL password for #{@db_user}@#{@db_server}" unless @db_pw
|
97
|
-
@db_pw
|
98
|
-
end
|
99
|
-
|
100
|
-
# TODO: update this as API above so there's only one per keychain.
|
101
|
-
def connect_to_db(server: nil, user: nil)
|
102
|
-
return if JSS::DB_CNX.connected?
|
103
|
-
@db_server = server ? server : JSS::CONFIG.api_server_name
|
104
|
-
@db_user = user
|
105
|
-
|
106
|
-
raise 'No db_server_name defined in /etc/ruby-jss.conf. Please specify with --db-server' unless @db_server
|
107
|
-
|
108
|
-
# look in the keychain
|
109
|
-
keychain_creds = rw_credentials_from_keychain(:db, @db_server, @db_user)
|
110
|
-
|
111
|
-
# did we get a user/pw? Use it
|
112
|
-
if keychain_creds
|
113
|
-
@db_user ||= keychain_creds[:user]
|
114
|
-
begin
|
115
|
-
JSS::DB_CNX.connect server: @db_server, user: @db_user, pw: keychain_creds[:password]
|
116
|
-
|
117
|
-
return
|
118
|
-
rescue Mysql::ServerError::AccessDeniedError
|
119
|
-
# re-prompt if bad pw in keychain
|
120
|
-
say "Stored MySQL password for #{@db_user}@#{@db_server} is incorrect"
|
121
|
-
end # begin
|
122
|
-
else
|
123
|
-
# Couldn't find a stored user for server, and no user given on CLI - error.
|
124
|
-
raise "No user stored for MySQL server '#{@db_server}'. Please specify with --db-user" unless @db_user
|
125
|
-
end
|
126
|
-
|
127
|
-
# If we're here, we need to get the passwd for the user
|
128
|
-
pw = db_pw
|
129
|
-
|
130
|
-
# store the pw
|
131
|
-
save_rw_credentials KEYCHAIN_DB_LABEL, @db_user, @db_server, pw
|
132
|
-
end
|
133
|
-
|
134
|
-
# TODO: pass in the API server for which we want the dist point pw
|
135
|
-
# must be connected to api
|
136
|
-
# and make it like API connection above, 1 per keychain.
|
137
|
-
def dist_point_pw
|
138
|
-
keychain_creds = rw_credentials_from_keychain(:db, @api_server, KEYCHAIN_DIST_ACCT)
|
139
|
-
if keychain_creds
|
140
|
-
@distpw = keychain_creds[:password]
|
141
|
-
return @distpw if JSS::DistributionPoint.master_distribution_point.check_pw :rw, distpw
|
142
|
-
end
|
143
|
-
|
144
|
-
# if we're here, there was no stored pw or it was incorrect
|
145
|
-
|
146
|
-
# If we're here, we need to get the passwd for the master dist point
|
147
|
-
prmpt = "Enter the RW password for the Master Distribution Point on JSS #{@api_server}"
|
148
|
-
@distpw = prompt_for_password prompt: prmpt do |apw|
|
149
|
-
JSS::DistributionPoint.master_distribution_point.check_pw :rw, apw
|
150
|
-
end # do apw
|
151
|
-
|
152
|
-
raise JSS::AuthenticationError, "Incorrect RW password for the Master Distribution Point on JSS #{@api_server}" unless @distpw
|
153
|
-
|
154
|
-
# store the pw
|
155
|
-
save_rw_credentials KEYCHAIN_DIST_LABEL, KEYCHAIN_DIST_ACCT, @api_server, @distpw
|
156
|
-
@distpw
|
157
|
-
end
|
158
|
-
|
159
|
-
# Fetch read-write credentials from the login keychain
|
160
|
-
#
|
161
|
-
# If the login keychain is locked, the user will be prompted
|
162
|
-
# to unlock it in the GUI.
|
163
|
-
#
|
164
|
-
# @param kind[Symbol] which kind of credentials? :jss, :db, or :dist
|
165
|
-
#
|
166
|
-
# @return [Hash{Symbol => String}, nil] A Hash with :server, :user and :password
|
167
|
-
# values, nil if no matching keychain item.
|
168
|
-
#
|
169
|
-
def rw_credentials_from_keychain(kind)
|
170
|
-
Keychain.user_interaction_allowed = true
|
171
|
-
unlock_keychain
|
172
|
-
label = KEYCHAIN_LABELS[kind]
|
173
|
-
raise JSS::InvalidDataError, "argument must be one of :#{RW_CREDENTIAL_KINDS.join ', :'}" unless label
|
174
|
-
|
175
|
-
pw_search = { label: label }
|
176
|
-
pw_item = Keychain.default.internet_passwords.where(pw_search).first
|
177
|
-
|
178
|
-
return nil unless pw_item
|
179
|
-
|
180
|
-
{ server: pw_item.server, user: pw_item.account, pw: pw_item.password, port: pw_item.port }
|
181
|
-
end
|
182
|
-
|
183
|
-
# Save the credentials in the login keychain
|
184
|
-
#
|
185
|
-
# @param user[String] the username to save
|
186
|
-
#
|
187
|
-
# @param pw[String] the password to save with the username
|
188
|
-
#
|
189
|
-
# @return [void]
|
190
|
-
#
|
191
|
-
def save_rw_credentials(label: nil, acct: nil, server: nil, pw: nil, port: nil)
|
192
|
-
Keychain.default.internet_passwords.where(label: label).all.each(&:delete)
|
193
|
-
item = Keychain.default.internet_passwords.create label: label, account: acct, server: server, password: pw, port: port
|
194
|
-
item.save!
|
195
|
-
end
|
196
|
-
|
197
|
-
# Prompt the user to unlock the default keychain
|
198
|
-
#
|
199
|
-
# @return [void]
|
200
|
-
#
|
201
|
-
def unlock_keychain
|
202
|
-
return true unless Keychain.default.locked?
|
203
|
-
unlocked = prompt_for_password prompt: 'Enter your keychain password' do |pw|
|
204
|
-
begin
|
205
|
-
Keychain.default.unlock! pw
|
206
|
-
true
|
207
|
-
rescue Keychain::AuthFailedError
|
208
|
-
false
|
209
|
-
end # begin
|
210
|
-
end # prompt for pass
|
211
|
-
raise JSS::AuthenticationError, 'Failed to unlock default keychain' unless unlocked
|
212
|
-
end # unlock keychain
|
213
|
-
|
214
|
-
# Prompt the user for a password in the shell
|
215
|
-
# Returns:
|
216
|
-
# - a valid password, or
|
217
|
-
# - false if no valid password after the max number of tries
|
218
|
-
#
|
219
|
-
# Displays the provided promp. Passes what the user types to the block you
|
220
|
-
# provide, which must return a Boolean indicating if the password was correct.
|
221
|
-
#
|
222
|
-
# @param prompt[String] The message asking for the password
|
223
|
-
#
|
224
|
-
# @option max_tries[Integer] The max number of times to let the
|
225
|
-
# user enter the passwd. Defaults to 3
|
226
|
-
#
|
227
|
-
# @option retry_msg[String] the text to display after a failure,
|
228
|
-
# but before :max_tries failures. Defaults to "Try again: " followed
|
229
|
-
# by the text arg.
|
230
|
-
#
|
231
|
-
# @option failed_msg[String] The message to display after :max_tries
|
232
|
-
# failures. Defaults to "Too many failed attempts"
|
233
|
-
#
|
234
|
-
# @yield The block should figure out if the user typed the correct password
|
235
|
-
#
|
236
|
-
# @yieldparam pw [String] The password typed by the user in the input field
|
237
|
-
#
|
238
|
-
# @yieldreturn [Boolean] Was the password correct?
|
239
|
-
#
|
240
|
-
# @return [String] The validated password
|
241
|
-
# @return [false] The user failed after max_tries: attempts.
|
242
|
-
#
|
243
|
-
#
|
244
|
-
def prompt_for_password(**options)
|
245
|
-
colon = ':'
|
246
|
-
# set defaults
|
247
|
-
options[:prompt] ||= 'Enter your password:'
|
248
|
-
options[:prompt] << colon unless options[:prompt].end_with? colon
|
249
|
-
options[:max_tries] ||= 3
|
250
|
-
options[:retry_msg] ||= "Try Again. #{options[:prompt]}"
|
251
|
-
options[:failed_msg] ||= 'Too many failed attempts'
|
252
|
-
|
253
|
-
tries = 0
|
254
|
-
|
255
|
-
prompt = options[:prompt]
|
256
|
-
|
257
|
-
while tries < options[:max_tries]
|
258
|
-
print "#{prompt} "
|
259
|
-
system 'stty -echo'
|
260
|
-
pw = $stdin.gets.chomp
|
261
|
-
puts
|
262
|
-
system 'stty echo'
|
263
|
-
return pw if yield pw
|
264
|
-
prompt = options[:retry_msg]
|
265
|
-
tries += 1
|
266
|
-
end
|
267
|
-
puts options[:failed_msg]
|
268
|
-
false
|
269
|
-
ensure # make sure terminal is usable at the end of this
|
270
|
-
system 'stty echo'
|
271
|
-
end # prompt_for_password
|
272
|
-
|
273
|
-
end # module auth
|
274
|
-
|
275
|
-
end # module JSSTestHelper
|