ruby-jss 1.2.6 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ruby-jss might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGES.md +189 -1
- data/README.md +1 -1
- data/bin/cgrouper +1 -1
- data/bin/jamfHelperBackgrounder +1 -1
- data/bin/netseg-update +1 -1
- data/data/ruby-jss.conf.example +1 -1
- data/lib/jamf.rb +1 -1
- data/lib/jamf/api/abstract_classes/advanced_search.rb +1 -1
- data/lib/jamf/api/abstract_classes/collection_resource.rb +17 -9
- data/lib/jamf/api/abstract_classes/generic_reference.rb +1 -1
- data/lib/jamf/api/abstract_classes/json_object.rb +2 -2
- data/lib/jamf/api/abstract_classes/prestage.rb +2 -2
- data/lib/jamf/api/abstract_classes/prestage_skip_setup_items.rb +1 -1
- data/lib/jamf/api/abstract_classes/resource.rb +1 -1
- data/lib/jamf/api/abstract_classes/singleton_resource.rb +1 -1
- data/lib/jamf/api/attribute_classes/ip_address.rb +1 -1
- data/lib/jamf/api/attribute_classes/timestamp.rb +1 -1
- data/lib/jamf/api/connection.rb +9 -5
- data/lib/jamf/api/connection/api_error.rb +1 -1
- data/lib/jamf/api/connection/api_error_styleguide.rb +1 -1
- data/lib/jamf/api/connection/token.rb +22 -2
- data/lib/jamf/api/json_objects/account_prefs.rb +1 -1
- data/lib/jamf/api/json_objects/android_details.rb +1 -1
- data/lib/jamf/api/json_objects/appletv_details.rb +1 -1
- data/lib/jamf/api/json_objects/attachment.rb +1 -1
- data/lib/jamf/api/json_objects/cellular_network.rb +1 -1
- data/lib/jamf/api/json_objects/change_log_entry.rb +1 -1
- data/lib/jamf/api/json_objects/computer_prestage_skip_setup_items.rb +1 -1
- data/lib/jamf/api/json_objects/country.rb +1 -1
- data/lib/jamf/api/json_objects/criterion.rb +1 -1
- data/lib/jamf/api/json_objects/device_enrollment_device.rb +1 -1
- data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +1 -1
- data/lib/jamf/api/json_objects/extension_attribute_value.rb +1 -1
- data/lib/jamf/api/json_objects/installed_application.rb +1 -1
- data/lib/jamf/api/json_objects/installed_certificate.rb +1 -1
- data/lib/jamf/api/json_objects/installed_configuration_profile.rb +1 -1
- data/lib/jamf/api/json_objects/installed_ebook.rb +1 -1
- data/lib/jamf/api/json_objects/installed_provisioning_profile.rb +1 -1
- data/lib/jamf/api/json_objects/inventory_preload_extension_attribute.rb +1 -1
- data/lib/jamf/api/json_objects/ios_details.rb +1 -1
- data/lib/jamf/api/json_objects/location.rb +1 -1
- data/lib/jamf/api/json_objects/md_prestage_name.rb +1 -1
- data/lib/jamf/api/json_objects/md_prestage_names.rb +1 -1
- data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +1 -1
- data/lib/jamf/api/json_objects/mobile_device_details.rb +1 -1
- data/lib/jamf/api/json_objects/mobile_device_security.rb +1 -1
- data/lib/jamf/api/json_objects/prestage_assignment.rb +1 -1
- data/lib/jamf/api/json_objects/prestage_location.rb +1 -1
- data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +1 -1
- data/lib/jamf/api/json_objects/prestage_scope.rb +1 -1
- data/lib/jamf/api/json_objects/prestage_sync_status.rb +1 -1
- data/lib/jamf/api/json_objects/purchasing_data.rb +1 -1
- data/lib/jamf/api/mixins/abstract.rb +1 -1
- data/lib/jamf/api/mixins/bulk_deletable.rb +1 -1
- data/lib/jamf/api/mixins/change_log.rb +1 -1
- data/lib/jamf/api/mixins/extendable.rb +1 -1
- data/lib/jamf/api/mixins/immutable.rb +1 -1
- data/lib/jamf/api/mixins/locatable.rb +1 -1
- data/lib/jamf/api/mixins/lockable.rb +1 -1
- data/lib/jamf/api/mixins/referable.rb +1 -1
- data/lib/jamf/api/mixins/searchable.rb +1 -1
- data/lib/jamf/api/mixins/uncreatable.rb +1 -1
- data/lib/jamf/api/mixins/undeletable.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/account.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/advanced_mobile_device_search.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/advanced_user_search.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/building.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/category.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/computer.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/department.rb +2 -2
- data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +4 -4
- data/lib/jamf/api/resources/collection_resources/extension_attribute.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/mobile_device.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/script.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/site.rb +1 -1
- data/lib/jamf/api/resources/collection_resources/time_zone.rb +1 -1
- data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +1 -1
- data/lib/jamf/api/resources/singleton_resources/authorization.rb +1 -1
- data/lib/jamf/api/resources/singleton_resources/client_checkin_settings.rb +1 -1
- data/lib/jamf/api/resources/singleton_resources/reenrollment_settings.rb +1 -1
- data/lib/jamf/client.rb +1 -1
- data/lib/jamf/client/jamf_binary.rb +1 -1
- data/lib/jamf/client/jamf_helper.rb +1 -1
- data/lib/jamf/client/management_action.rb +1 -1
- data/lib/jamf/compatibility.rb +1 -1
- data/lib/jamf/composer.rb +1 -1
- data/lib/jamf/configuration.rb +8 -10
- data/lib/jamf/exceptions.rb +1 -1
- data/lib/jamf/ruby_extensions.rb +2 -1
- data/lib/jamf/ruby_extensions/array.rb +2 -2
- data/lib/jamf/ruby_extensions/array/predicates.rb +1 -1
- data/lib/jamf/ruby_extensions/array/utils.rb +4 -4
- data/lib/jamf/ruby_extensions/dig.rb +52 -0
- data/lib/jamf/ruby_extensions/filetest.rb +1 -1
- data/lib/jamf/ruby_extensions/filetest/predicates.rb +1 -1
- data/lib/jamf/ruby_extensions/hash.rb +1 -1
- data/lib/jamf/ruby_extensions/hash/backports.rb +2 -2
- data/lib/jamf/ruby_extensions/ipaddr.rb +1 -1
- data/lib/jamf/ruby_extensions/ipaddr/utils.rb +1 -1
- data/lib/jamf/ruby_extensions/object.rb +1 -1
- data/lib/jamf/ruby_extensions/object/predicates.rb +1 -1
- data/lib/jamf/ruby_extensions/pathname.rb +1 -1
- data/lib/jamf/ruby_extensions/pathname/predicates.rb +1 -1
- data/lib/jamf/ruby_extensions/pathname/utils.rb +1 -1
- data/lib/jamf/ruby_extensions/string.rb +1 -1
- data/lib/jamf/ruby_extensions/string/backports.rb +1 -1
- data/lib/jamf/ruby_extensions/string/conversions.rb +1 -1
- data/lib/jamf/ruby_extensions/string/predicates.rb +14 -4
- data/lib/jamf/utility.rb +1 -1
- data/lib/jamf/validate.rb +1 -1
- data/lib/jamf/version.rb +2 -2
- data/lib/jpapi.rb +1 -1
- data/lib/jss-api.rb +1 -1
- data/lib/jss.rb +3 -1
- data/lib/jss/api_connection.rb +3 -30
- data/lib/jss/api_object.rb +23 -4
- data/lib/jss/api_object/account.rb +1 -1
- data/lib/jss/api_object/advanced_search.rb +28 -27
- data/lib/jss/api_object/advanced_search/advanced_computer_search.rb +1 -1
- data/lib/jss/api_object/advanced_search/advanced_mobile_device_search.rb +1 -1
- data/lib/jss/api_object/advanced_search/advanced_user_search.rb +1 -1
- data/lib/jss/api_object/app_store_country_codes.rb +298 -0
- data/lib/jss/api_object/building.rb +1 -1
- data/lib/jss/api_object/categorizable.rb +1 -1
- data/lib/jss/api_object/category.rb +1 -1
- data/lib/jss/api_object/computer.rb +12 -6
- data/lib/jss/api_object/computer/application_installs.rb +1 -1
- data/lib/jss/api_object/computer_invitation.rb +1 -1
- data/lib/jss/api_object/configuration_profile.rb +4 -2
- data/lib/jss/api_object/configuration_profile/mobile_device_configuration_profile.rb +1 -1
- data/lib/jss/api_object/configuration_profile/osx_configuration_profile.rb +1 -1
- data/lib/jss/api_object/creatable.rb +1 -1
- data/lib/jss/api_object/criteriable.rb +1 -1
- data/lib/jss/api_object/criteriable/criteria.rb +1 -1
- data/lib/jss/api_object/criteriable/criterion.rb +1 -1
- data/lib/jss/api_object/department.rb +1 -1
- data/lib/jss/api_object/directory_binding.rb +273 -0
- data/lib/jss/api_object/directory_binding_type.rb +90 -0
- data/lib/jss/api_object/directory_binding_type/active_directory.rb +502 -0
- data/lib/jss/api_object/directory_binding_type/admitmac.rb +525 -0
- data/lib/jss/api_object/directory_binding_type/centrify.rb +212 -0
- data/lib/jss/api_object/directory_binding_type/open_directory.rb +178 -0
- data/lib/jss/api_object/directory_binding_type/powerbroker_identity_services.rb +73 -0
- data/lib/jss/api_object/disk_encryption_configurations.rb +114 -0
- data/lib/jss/api_object/distribution_point.rb +96 -36
- data/lib/jss/api_object/dock_item.rb +137 -0
- data/lib/jss/api_object/ebook.rb +2 -3
- data/lib/jss/api_object/extendable.rb +67 -28
- data/lib/jss/api_object/extension_attribute.rb +5 -4
- data/lib/jss/api_object/extension_attribute/computer_extension_attribute.rb +1 -1
- data/lib/jss/api_object/extension_attribute/mobile_device_extension_attribute.rb +1 -1
- data/lib/jss/api_object/extension_attribute/user_extension_attribute.rb +1 -1
- data/lib/jss/api_object/group.rb +1 -1
- data/lib/jss/api_object/group/computer_group.rb +1 -1
- data/lib/jss/api_object/group/mobile_device_group.rb +1 -1
- data/lib/jss/api_object/group/user_group.rb +1 -1
- data/lib/jss/api_object/ibeacon.rb +1 -1
- data/lib/jss/api_object/ldap_server.rb +1 -1
- data/lib/jss/api_object/locatable.rb +1 -1
- data/lib/jss/api_object/mac_application.rb +108 -9
- data/lib/jss/api_object/management_history.rb +1 -1
- data/lib/jss/api_object/management_history/audit_event.rb +1 -1
- data/lib/jss/api_object/management_history/casper_imaging_log.rb +1 -1
- data/lib/jss/api_object/management_history/casper_remote_log.rb +1 -1
- data/lib/jss/api_object/management_history/computer_usage_log.rb +1 -1
- data/lib/jss/api_object/management_history/ebook.rb +1 -1
- data/lib/jss/api_object/management_history/hashlike.rb +1 -1
- data/lib/jss/api_object/management_history/mac_app_store_app.rb +1 -1
- data/lib/jss/api_object/management_history/mdm_command.rb +1 -1
- data/lib/jss/api_object/management_history/mobile_device_app.rb +1 -1
- data/lib/jss/api_object/management_history/policy_log.rb +1 -1
- data/lib/jss/api_object/management_history/screen_sharing_log.rb +1 -1
- data/lib/jss/api_object/management_history/user_location_change.rb +1 -1
- data/lib/jss/api_object/matchable.rb +1 -1
- data/lib/jss/api_object/mdm.rb +1 -1
- data/lib/jss/api_object/mobile_device.rb +12 -6
- data/lib/jss/api_object/mobile_device_application.rb +13 -1
- data/lib/jss/api_object/netboot_server.rb +1 -1
- data/lib/jss/api_object/network_segment.rb +153 -59
- data/lib/jss/api_object/package.rb +106 -41
- data/lib/jss/api_object/patch_policy.rb +1 -1
- data/lib/jss/api_object/patch_source.rb +1 -1
- data/lib/jss/api_object/patch_source/patch_external_source.rb +1 -1
- data/lib/jss/api_object/patch_source/patch_internal_source.rb +1 -1
- data/lib/jss/api_object/patch_title.rb +1 -1
- data/lib/jss/api_object/patch_title/version.rb +1 -1
- data/lib/jss/api_object/peripheral.rb +1 -1
- data/lib/jss/api_object/peripheral_type.rb +1 -1
- data/lib/jss/api_object/policy.rb +492 -8
- data/lib/jss/api_object/printer.rb +440 -0
- data/lib/jss/api_object/purchasable.rb +1 -1
- data/lib/jss/api_object/removable_macaddr.rb +1 -1
- data/lib/jss/api_object/restricted_software.rb +1 -1
- data/lib/jss/api_object/scopable.rb +1 -1
- data/lib/jss/api_object/scopable/scope.rb +387 -72
- data/lib/jss/api_object/script.rb +1 -1
- data/lib/jss/api_object/self_servable.rb +24 -16
- data/lib/jss/api_object/self_servable/icon.rb +1 -1
- data/lib/jss/api_object/sitable.rb +1 -1
- data/lib/jss/api_object/site.rb +1 -1
- data/lib/jss/api_object/software_update_server.rb +1 -1
- data/lib/jss/api_object/updatable.rb +1 -1
- data/lib/jss/api_object/uploadable.rb +2 -2
- data/lib/jss/api_object/user.rb +43 -2
- data/lib/jss/api_object/vpp_account.rb +209 -0
- data/lib/jss/api_object/vppable.rb +170 -14
- data/lib/jss/api_object/webhook.rb +1 -1
- data/lib/jss/client.rb +1 -1
- data/lib/jss/client/jamf_binary.rb +1 -1
- data/lib/jss/client/jamf_helper.rb +1 -1
- data/lib/jss/client/management_action.rb +1 -1
- data/lib/jss/compatibility.rb +1 -1
- data/lib/jss/composer.rb +2 -2
- data/lib/jss/configuration.rb +1 -1
- data/lib/jss/db_connection.rb +1 -1
- data/lib/jss/exceptions.rb +1 -1
- data/lib/jss/ruby_extensions.rb +1 -1
- data/lib/jss/ruby_extensions/array.rb +1 -1
- data/lib/jss/ruby_extensions/filetest.rb +1 -1
- data/lib/jss/ruby_extensions/hash.rb +1 -1
- data/lib/jss/ruby_extensions/ipaddr.rb +1 -1
- data/lib/jss/ruby_extensions/pathname.rb +1 -1
- data/lib/jss/ruby_extensions/string.rb +1 -1
- data/lib/jss/ruby_extensions/string/backports.rb +1 -1
- data/lib/jss/ruby_extensions/string/conversions.rb +1 -1
- data/lib/jss/ruby_extensions/string/predicates.rb +14 -4
- data/lib/jss/ruby_extensions/time.rb +1 -1
- data/lib/jss/server.rb +1 -1
- data/lib/jss/utility.rb +9 -23
- data/lib/jss/validate.rb +54 -11
- data/lib/jss/version.rb +2 -2
- data/lib/jss/xml_workaround.rb +1 -1
- data/lib/ruby-jss.rb +1 -1
- data/test/bin/runtests +1 -1
- data/test/lib/testhelper.rb +1 -1
- data/test/lib/testhelper/auth.rb +1 -1
- data/test/lib/testhelper/patch_mgmt.rb +1 -1
- data/test/specs/api_connection_spec.rb +1 -1
- data/test/specs/patch01_source_spec.rb +1 -1
- data/test/specs/patch02_internal_source_spec.rb +1 -1
- data/test/specs/patch03_external_source_spec.rb +1 -1
- data/test/specs/patch04_titles_spec.rb +1 -1
- data/test/specs/patch05_policies_spec.rb +1 -1
- data/test/specs/patch06_cleanup_spec.rb +1 -1
- data/test/specs/policy_spec.rb +1 -1
- metadata +15 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0484427943d39089bb11eb73af827c5137d79550c34ea5fdf7ca683c7c69f0
|
4
|
+
data.tar.gz: '09abd63abb133ee6c34aa2fcb9ae8ccc3e11b3248061ee410223bd8f25f5a7ae'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 962236f6ca861fbfa3f706df0d8d977f15fb1436238f7d9c061ae8043c4148b956fc187a9858f9444b8461cc7d707067278e6a9030c676af26febdc565b0cd0f
|
7
|
+
data.tar.gz: 7f7027d207de8ea3fd3d1c010483a9e261d4962857ec48ac6f4df0ba4d38526720ff3700078900e1df2182f191a0aaf7c3284ef3438714e1fbc9118f3aeb03ca
|
data/CHANGES.md
CHANGED
@@ -4,13 +4,200 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## \[1.4.1] - 2020-10-01
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Support for JP API connections to https://tryitout.jamfcloud.com/, the open API test server provided by Jamf. It uses internal tokens, so the /auth endpoint is disabled. Now as with the Classic API, `Jamf::Connection.connect` will accpt any name & password when connecting to that host.
|
12
|
+
|
13
|
+
## \[1.4.0] - 2020-09-14
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- Class JSS::VPPAccount, implementing the 'vppacconts' endpoint.
|
18
|
+
|
19
|
+
- Constant JSS::APP_STORE_COUNTRY_CODES, a Hash with keys being the official country names used by the App Store, and values being the two-letter codes for those names. This static Hash is derived from a Jamf Pro API end point, and will be updated as needed. These codes are used by JSS::VPPAccount
|
20
|
+
|
21
|
+
- Module Method JSS.country_code_match(str) whic allows you to filter the JSS::APP_STORE_COUNTRY_CODES Hash to only those key-value pairs that include the given string.
|
22
|
+
|
23
|
+
- Mixin Class Method VPPable.all_vpp_device_assignable, returns a Hash of Hashes showing the total, used, and remaining licenses for all members of the target class that are VPP-assignable by device.
|
24
|
+
|
25
|
+
- Scopable::Scope#in_scope?(machine) Given a JSS::Computer or MobileDevice, or an identifier for one, it is in the scope? WARNING: For scopes that include Jamf Users or User Groups as targets or exclusions, this method may return an incorrect value. See the discussion in the comments/documentation for the Scopable::Scope class under `IMPORTANT - Users & User Groups in Targets and Exclusions`
|
26
|
+
|
27
|
+
- Scopable::Scope#scoped_machines returns a Hash of ids=>names for all machines in this scope. WARNING: This must instantiate all machines in the target class. It will still be slow, at least the first time for each target class. On the upside, the instantiated machines will be cached, so generating this list for other scopes with the same target class will be much much faster. In tests, with 1600 Computers in the JSS, it took about 7 minutes the first time, but less than 1 second after caching.
|
28
|
+
See also the warning for #in_scope? above, which applies here as well.
|
29
|
+
|
30
|
+
- JSS::Policy objects support 'Policy Retry' via the getter/setter methods #retry_event, #retry_attempts, and #notify_failed_retries. You can only set these values if the #frequency is :once_per_computer. To turn off policy-retry, either set the retry_event to :none, or set the retry_attempts to 0
|
31
|
+
|
32
|
+
### Changed
|
33
|
+
|
34
|
+
- Prettier XML for JSS::APIObject#ppx
|
35
|
+
|
36
|
+
- Improved JSS::Validate.boolean. Accepts: true, false, 'true', 'false', 'yes', 'no', 't','f', 'y', or 'n' as Strings or Symbols, case insensitive
|
37
|
+
|
38
|
+
- The JSS::MacApplication class is more fully implemented
|
39
|
+
|
40
|
+
- JSS::Scopable::Scope now uses the word 'targets' consistently to match the UI's 'Targets' tab. The previous word 'inclusions' still works as before.
|
41
|
+
|
42
|
+
- When using the Jamf module to access the Jamf Pro API, the minumum JamfPro version is now 10.23.0. WARNING: Like the Jamf Pro API itself, the Jamf module that accesses it is in beta and may have breaking changes at any time.
|
43
|
+
|
44
|
+
### Fixed
|
45
|
+
|
46
|
+
- JSS::ExtensionAttribute: when used as a display field in an AdvancedSearch, the name of the EA in the search result Hash comes from the API as a String (turned into a Symbol) that is the EA name with colons removed and spaces & dashes turned to underscores. Previously ruby-jss didn't remove the colons
|
47
|
+
|
48
|
+
- Used an XML workaround for the common classic API bug where an XML array comes as a single-item JSON hash. This time in the JSS::User class's user_groups method.
|
49
|
+
|
50
|
+
- The Jamf Pro API endpoints for /v1/device-enrollment changed to /v1/device-enrollments and /v1/device-enrollment/sync/<id> changed to /v1/device-enrollments/<id>/syncs. /v1/devive-enrollments/syncs.
|
51
|
+
|
52
|
+
- The Jamf Pro API endpoint for bulk-deleting Departments changed from 'delete-departments' to 'delete-multiple'
|
53
|
+
|
54
|
+
## \[1.3.3] - 2020-08-07
|
55
|
+
|
56
|
+
### Fixed
|
57
|
+
- Regression where JSS::Package#required_processor= wouldn't take 'x86'
|
58
|
+
|
59
|
+
## \[1.3.2] - 2020-07-31
|
60
|
+
Many thanks to @cybertunnel for adding a huge amount of code to get JSS::Policy fully implimented, as well as other fixes and updates!
|
61
|
+
|
62
|
+
### Added
|
63
|
+
- new class JSS::DockItem
|
64
|
+
- new classes JSS::DirectoryBinding and JSS::DirectoryBindingType
|
65
|
+
- new class JSS::Printer
|
66
|
+
- new class JSS::DiskEncryptionConfiguration
|
67
|
+
- JSS::Policy:
|
68
|
+
- getters and setters for `#user_message_start` and `#user_message_end`
|
69
|
+
- `#set_management_account` and `#verify_management_password`
|
70
|
+
- `#add_dock_item` and `#remove_dock_item`
|
71
|
+
- `#directory_bindings`, `#add_directory_binding` and `#remove_directory_binding`
|
72
|
+
- `#add_printer` and `#remove_printer`
|
73
|
+
- `#reissue_key`, `#apply_encryption_configuration`, and `#remove_encryption_configuration`
|
74
|
+
|
75
|
+
|
76
|
+
### Changed
|
77
|
+
- JSS::Package:
|
78
|
+
- no longer issues a warning when changing the file_name of a package
|
79
|
+
- Updated the CPU type string from 'x86' to 'Intel/x86'
|
80
|
+
- Methods which used to always use the master distribution point now accept a parameter `dist_point: dp` where dp is the name or id of a fileshare distribution point. If not specified, it still defaults to the Master Distribution Point. This is needed because if the Cloud Distribution Point is the master, there is no access to it via the Classic API, and any use of DistributionPoint.master_distribution_point will raise an error.
|
81
|
+
|
82
|
+
## \[1.3.1] - 2020-06-21
|
83
|
+
|
84
|
+
### Changed
|
85
|
+
|
86
|
+
- JSS::MobileDeviceApplication when using PrettyPrint (pp) in irb, no longer shows the base64 data for the ipa file.
|
87
|
+
|
88
|
+
- JSS::DistributionPoint.my_distribution_point and .master_distribution_point now have options for dealing with the Cloud Distribution Point (which is not available in the classic API) being the master.
|
89
|
+
|
90
|
+
### Fixed
|
91
|
+
|
92
|
+
- JSS::NetworkSegment.distribution_point= now takes nil or an empty string to unset the dist point.
|
93
|
+
|
94
|
+
## \[1.3.0] - 2020-06-05
|
95
|
+
|
96
|
+
### Added
|
97
|
+
|
98
|
+
- JSS::NetworkSegment.network_ranges_as_integers method, Similar to NetworkSegment.network_ranges, but the ranges are of Integers, not IPAddr instances. This makes for *MUCH* faster range calculations, needed to implement improvements to NetworkSegment.network_segment_for_ip
|
99
|
+
|
100
|
+
- JSS::Package.all_filenames_by, returns a Hash of all distribution point filenames for all packages, keyed by either the package id, or the package name. NOTE: as with JSS::Package.all_filenames, this method must instantiate all JSS::Package objects, so it will be slow.
|
101
|
+
|
102
|
+
### Changed
|
103
|
+
|
104
|
+
- JSS.expand_min_os now expands to macOS 10.30.x, which should hold us for a while
|
105
|
+
|
106
|
+
- JSS::NetworkSegment.network_segment_for_ip and .my_network_segment are no longer deprecated, but now return an integer NetSeg id (or nil). The plural forms of those methods still return an Array of ids for all the matching network segments.
|
107
|
+
|
108
|
+
- The logic for JSS::NetworkSegment.network_segment_for_ip (and .my_network_segment) now matches how the Jamf server does it: when you IP address is in more than one Network Segment, Jamf uses the smallest/narrowest one (the one containing fewest IP addresses). If more than one of your Network Segments are that same width, the one with the lowest starting IP address is used.
|
109
|
+
|
110
|
+
- In some networking situations (e.g. Split-tunnel VPN with multiple active network ports) the JSS::APIObject.delete method will raise a 404 NotFound error, seemingly because the object was already deleted but a second http DELETE is sent (I think). We now just rescue and ignore that error, since the fact that it's not found means it was indeed deleted.
|
111
|
+
|
112
|
+
### Fixed
|
113
|
+
|
114
|
+
- A copy/paste bug in Jamf::Prestage.serials_for_prestage
|
115
|
+
|
116
|
+
## \[1.2.15] - 2020-04-30
|
117
|
+
|
118
|
+
### Fixed
|
119
|
+
|
120
|
+
- USER_CONF_FILE is always a pathname, never nil
|
121
|
+
|
122
|
+
- issues with Array#j_ci_* methods related to removing safe navigation
|
123
|
+
|
124
|
+
## \[1.2.13] - 2020-04-29
|
125
|
+
|
126
|
+
### Fixed
|
127
|
+
|
128
|
+
- Ruby 2.6 needs parens in more places than 2.3, apparently
|
129
|
+
|
130
|
+
## \[1.2.12] - 2020-04-29
|
131
|
+
|
132
|
+
### Added
|
133
|
+
|
134
|
+
- Backport of `#dig` for Arrays, Hashes and OpenStructs, for compatibiliy with older rubiesd (for a while longer anyway). Gratefully borrowed from https://github.com/Invoca/ruby_dig
|
135
|
+
|
136
|
+
### Changed
|
137
|
+
|
138
|
+
- Removed all safe navigation operators (`&.`) for compatibility with older rubies (for a while longer anyway)
|
139
|
+
|
140
|
+
|
141
|
+
## \[1.2.11] - 2020-04-26
|
142
|
+
|
143
|
+
### Fixed
|
144
|
+
|
145
|
+
- Bug in Package#install that prevented installs from 'alt_download_url'.
|
146
|
+
|
147
|
+
## \[1.2.10] - 2020-04-25
|
148
|
+
|
149
|
+
### Added
|
150
|
+
|
151
|
+
- Computer#reported_ip_address. This value is collected in newer versions of Jamf Pro. While the #ip_address is the client's IP address from the Jamf Server's perspective, the #reported_ip_address is the IP from the client's perspective, which may be different on a NATted network like a home network.
|
152
|
+
|
153
|
+
### Fixed
|
154
|
+
|
155
|
+
- MobileDevice#upload now works like Computer#upload
|
156
|
+
|
157
|
+
### Changed
|
158
|
+
|
159
|
+
- Validation of Ext. Attribute values is improved, namely for EAs with integer values, integer-strings like "12" are accepted and converted to real integers as needed.
|
160
|
+
|
161
|
+
## \[1.2.9] - 2020-04-13
|
162
|
+
|
163
|
+
### Fixed
|
164
|
+
|
165
|
+
- Fixed a bug where passing a frozen string into some setters, e.g. `JSS::Computer.asset_tag=`, would cause an error when it tried to `#strip!` the string.
|
166
|
+
|
167
|
+
## \[1.2.8] - 2020-04-12
|
168
|
+
|
169
|
+
### Added
|
170
|
+
|
171
|
+
- MobileDevice#update now takes the `no_mdm_rename:` boolean parameter. Prevents an MDM rename command being sent when changing the name of a supervised device with enforced names. Useful when the MDM command fails, as when there's already a pending rename command.
|
172
|
+
|
173
|
+
- `String#jss_float?` and `String#j_float?` predicate methods.
|
174
|
+
|
175
|
+
### Changed
|
176
|
+
|
177
|
+
- Jamf Pro API endpoints that have paging options have an undocumented max page size of 2000. The `CollectionResource#all*` methods now account for this.
|
178
|
+
|
179
|
+
- `String#jss_integer?` and `String#j_integer?` now recognize negative integers
|
180
|
+
|
181
|
+
- Ext. Attributes defined to have interger values will now accept integer strings, e.g. `'12345'` as well as integers e.g. `12345`
|
182
|
+
|
183
|
+
- Ext. Attributes defined to have date values will once again accept blanks (i.e. empty strings)
|
184
|
+
|
185
|
+
## \[1.2.7] - 2020-04-01
|
186
|
+
|
187
|
+
### Changed
|
188
|
+
|
189
|
+
- Jamf Pro API endpoints that have paging options have an undocumented max page size of 2000. The `CollectionResource#all*` methods now account for this.
|
190
|
+
|
191
|
+
|
7
192
|
## \[1.2.6] - 2020-04-01
|
8
193
|
|
9
194
|
### Fixed
|
10
195
|
|
11
196
|
- Classic API (JSS module)
|
12
197
|
- Sitable objects now recognize the string "None" as meaning no site is assigned. Thanks @cybertunnel for this fix!
|
198
|
+
|
13
199
|
- Scopable::Scope now deals with some bugs in the API regarding Jamf & LDAP users & user groups in targets, limitations, & exclusions. Please see the documentation/comments for the class in the file or the online documentation. Thanks @cybertunnel again!
|
200
|
+
|
14
201
|
- Criteriable::Criteria can now be empty - containing no criterion objects. When criteriable objects are created (such as Advanced Searches) the default JSS::Criteriable::Criteria object has no criteria. To remove all criteria, use `criteria.clear`, `criteria = nil`, or `criteria = JSS::Criteriable::Criteria.new` and then save. Once again, thanks to @cybertunnel for finding this.
|
15
202
|
|
16
203
|
- Jamf Pro API (Jamf module)
|
@@ -54,7 +241,8 @@ Note that the `last_inventory_update` value does NOT indicate such communication
|
|
54
241
|
|
55
242
|
- All APIObject Subclasses (Policy, Computer, MobileDevice, ComputerGroup, etc..) now have `get_raw`, `post_raw` & `put_raw` class methods, which are simpler wrappers for APIConnection#get_rsrc, #post_rsrc, and #put_rsrc.
|
56
243
|
- `get_raw` takes an object's id, and returns the 'raw' JSON (parsed into a ruby Hash with symbolized keys) or a REXML::Document (from which you'll probably want to use the `root` element). If you pass `as_string: true` you'll get the un-parsed JSON or XML string directly from the API
|
57
|
-
This can be useful when you need to retrieve the full object, to get some data not available in the summary-list, but instantiating the full ruby class is too slow
|
244
|
+
This can be useful when you need to retrieve the full object, to get some data not available in the summary-list, but instantiating the full ruby class is too slow
|
245
|
+
|
58
246
|
- `post_raw` & `put_raw` can send raw XML to the API without instantiating objects. In some cases, where you're making simple changes to simple XML, this can be faster than fetching a full instance and the re-saving it.
|
59
247
|
WARNING You must create or acquire the XML to be sent, and no validation will be performed on it. It must be a String of XML, or something that returns such a string with #to_s, such as a REXML::Document, or a REXML::Element.
|
60
248
|
|
data/README.md
CHANGED
@@ -419,6 +419,6 @@ There's a [wiki on the github page](https://github.com/PixarAnimationStudios/rub
|
|
419
419
|
|
420
420
|
## LICENSE
|
421
421
|
|
422
|
-
Copyright
|
422
|
+
Copyright 2020 Pixar
|
423
423
|
|
424
424
|
Licensed under the Apache License, Version 2.0 (the "Apache License") with modifications. See LICENSE.txt for details
|
data/bin/cgrouper
CHANGED
data/bin/jamfHelperBackgrounder
CHANGED
data/bin/netseg-update
CHANGED
data/data/ruby-jss.conf.example
CHANGED
data/lib/jamf.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2020 Pixar
|
2
2
|
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
@@ -106,13 +106,21 @@ module Jamf
|
|
106
106
|
return cnx.collection_cache[self].map { |m| new m }
|
107
107
|
end
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
109
|
+
# TODO: make sure all collection resources use this format
|
110
|
+
# for paging. Also -ask Jamf about a url that returns
|
111
|
+
# ALL objects in one query, regardless of number.
|
112
|
+
page = 0
|
113
|
+
raw = cnx.get "#{rsrc_path}?page=#{page}&size=1000000&sort=id%3Aasc"
|
114
|
+
results = raw[:results]
|
115
|
+
|
116
|
+
until results.size >= raw[:totalCount]
|
117
|
+
page += 1
|
118
|
+
raw = cnx.get "#{rsrc_path}?page=#{page}&size=1000000&sort=id%3Aasc"
|
119
|
+
results += raw[:results]
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
cnx.collection_cache[self] = results
|
116
124
|
|
117
125
|
return cnx.collection_cache[self] unless instantiate
|
118
126
|
|
@@ -220,7 +228,7 @@ module Jamf
|
|
220
228
|
val_is_str = value.is_a? String
|
221
229
|
|
222
230
|
idents.each do |ident|
|
223
|
-
match = all(refresh
|
231
|
+
match = all(refresh, cnx: cnx).select do |m|
|
224
232
|
val_is_str ? m[ident].to_s.casecmp?(value) : m[ident] == value
|
225
233
|
end.first
|
226
234
|
return match[:id] if match
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2020 Pixar
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
4
|
# with the following modification; you may not use this file except in
|
@@ -524,7 +524,7 @@ module Jamf
|
|
524
524
|
#
|
525
525
|
def self.attr_key_for_alias(als)
|
526
526
|
validate_not_abstract
|
527
|
-
self::OBJECT_MODEL.each { |k, deets| return k if k == als || deets[:aliases]
|
527
|
+
self::OBJECT_MODEL.each { |k, deets| return k if k == als || deets[:aliases].to_a.include?(als) }
|
528
528
|
nil
|
529
529
|
end
|
530
530
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2020 Pixar
|
2
2
|
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
@@ -235,7 +235,7 @@ module Jamf
|
|
235
235
|
#
|
236
236
|
def self.serials_for_prestage(prestage_ident, refresh = false, cnx: Jamf.cnx)
|
237
237
|
id = valid_id prestage_ident, cnx: cnx
|
238
|
-
raise Jamf::NoSuchItemError, "No #{self} matching '#{
|
238
|
+
raise Jamf::NoSuchItemError, "No #{self} matching '#{prestage_ident}'" unless id
|
239
239
|
|
240
240
|
serials_by_prestage_id(refresh, cnx: cnx).select { |_sn, psid| id == psid }.keys
|
241
241
|
end
|
data/lib/jamf/api/connection.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2020 Pixar
|
2
2
|
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
@@ -48,7 +48,7 @@ module Jamf
|
|
48
48
|
RSRC_BASE = 'uapi'.freeze
|
49
49
|
|
50
50
|
# The API version must be this or higher
|
51
|
-
MIN_JAMF_VERSION = Gem::Version.new('10.
|
51
|
+
MIN_JAMF_VERSION = Gem::Version.new('10.23.0')
|
52
52
|
|
53
53
|
HTTPS_SCHEME = 'https'.freeze
|
54
54
|
|
@@ -454,7 +454,9 @@ module Jamf
|
|
454
454
|
|
455
455
|
# Are we keeping the connection alive?
|
456
456
|
def keep_alive?
|
457
|
-
@keep_alive_thread
|
457
|
+
return false unless @keep_alive_thread
|
458
|
+
|
459
|
+
@keep_alive_thread.alive?
|
458
460
|
end
|
459
461
|
|
460
462
|
# @return [Jamf::Timestamp, nil]
|
@@ -806,7 +808,9 @@ module Jamf
|
|
806
808
|
# @return [void]
|
807
809
|
#
|
808
810
|
def stop_keep_alive
|
809
|
-
@keep_alive_thread
|
811
|
+
return unless @keep_alive_thread
|
812
|
+
|
813
|
+
@keep_alive_thread.kill if @keep_alive_thread.alive?
|
810
814
|
@keep_alive_thread = nil
|
811
815
|
end
|
812
816
|
|
@@ -853,7 +857,7 @@ module Jamf
|
|
853
857
|
end
|
854
858
|
|
855
859
|
def self.disconnect
|
856
|
-
@active_connection
|
860
|
+
@active_connection.disconnect if @active_connection
|
857
861
|
end
|
858
862
|
|
859
863
|
end # module Jamf
|