ruby-jss 4.2.4 → 5.0.0b1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +25 -0
- data/lib/jamf/api/classic/api_objects/computer.rb +20 -0
- data/lib/jamf/api/classic/api_objects/mdm.rb +429 -238
- data/lib/jamf/api/classic/api_objects/mdm_classic.rb +1416 -0
- data/lib/jamf/api/classic/api_objects/mobile_device.rb +20 -0
- data/lib/jamf/version.rb +1 -1
- data/lib/jamf/zeitwerk_config.rb +1 -0
- metadata +28 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe2a1fd9beba704e48499993ccfbc030e07eb9a7f008d695d652f5b906dca691
|
|
4
|
+
data.tar.gz: 58ba3c159e925c3f86eb65b9d2c3583921810ec7ed18daa0f230219f8c8e5b1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6ab10f5930e059100ce9783714a8495b33719bd3d2445b2aae2b6f5ab4980ba76cd4dfa07b0a9a0e272be8a38913aa7fd2afee609aefc873043e906fa9cb394
|
|
7
|
+
data.tar.gz: 19dda1b6bec99106e64e02b04c56d2f3e8387afb6e64bf40d6a61b0dafdab720c9094184eee551c02ec0bf0226c58a462bb97ae42970205fb483d2a460bcd5c8
|
data/CHANGES.md
CHANGED
|
@@ -14,6 +14,31 @@ __Please update all installations of ruby-jss to at least v1.6.0.__
|
|
|
14
14
|
|
|
15
15
|
Many many thanks to actae0n of Blacksun Hackers Club for reporting this issue and providing examples of how it could be exploited.
|
|
16
16
|
|
|
17
|
+
--------
|
|
18
|
+
## \[5.0.0] Unreleased
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- A new dependency on the [pixar-ruby-extensions gem](https://rubygems.org/gems/pixar-ruby-extensions), which are similar to those found in the JamfRubyExtensions module built into ruby-jss. Once all use of JamfRubyExtensions has been replaced by the new gem, JamfRubyExtensions will be removed. Staying DRY is a good thing.
|
|
23
|
+
|
|
24
|
+
- Jamf::Computer and Jamf::MobileDevice now have a class method `.management_id(ident, cnx: Jamf.cnx)` and a matching instance method `#management_id`. Even though the classes are based on the Classic API endpoints for Computers and MobileDevices, the 'managementId' value (a UUID used by Apples MDM/DDM) is not available in the Classic API data. These methods reach out to the Jamf Pro API to find the id for the instance, or the identified object.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- The Jamf Pro API is now used for sending MDM commands.
|
|
29
|
+
|
|
30
|
+
The Jamf::MDM mixin module has been updated to use the Jamf Pro API for nearly all defined methods. As of Jamf Pro 11.21, most of the Classic API endpoints have been deprecated for a while and are now removed. We now mostly uses the `/v2/mdm/commands` endpoint for POSTing commands.
|
|
31
|
+
|
|
32
|
+
This module is mixed in to the Computer, ComputerGroup, MobileDevice, and MobileDeviceGroup classes, which are still based on the Classic API. Those classes will be ported to the Jamf Pro API (as JComputer, JMobileDevice, etc..) in the coming months, but until then, the existing classes can now continue to send MDM commands.
|
|
33
|
+
|
|
34
|
+
Also at that time, newer MDM commands supported by the Jamf Pro API, but not yet by ruby-jss, will be implemented.
|
|
35
|
+
|
|
36
|
+
NOTE: The 'update_inventory' MDM command for mobile devices is no longer a thing and calling #update_inventory will raise an exception. Some of the MDM-based subcommands now in the JP API, such as CERTIFICATE_LIST, DEVICE_INFORMATION, INSTALLED_APPLICATION_LIST, etc, will be implemented in the future.
|
|
37
|
+
|
|
38
|
+
This fixes [GitHub Issue 107](https://github.com/PixarAnimationStudios/ruby-jss/issues/107) - many thanks to @csfjeff for reporting the problem!
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
17
42
|
--------
|
|
18
43
|
## \[4.2.4] 2025-10-31
|
|
19
44
|
|
|
@@ -596,6 +596,20 @@ module Jamf
|
|
|
596
596
|
end
|
|
597
597
|
private_class_method :management_data_subset
|
|
598
598
|
|
|
599
|
+
# Get the MDM Management ID for a computer by identifer
|
|
600
|
+
# @param ident [Integer,String] An identifier (id, name, serialnumber, macaddr)
|
|
601
|
+
# of the computer for which to retrieve the Management ID
|
|
602
|
+
# @param cnx [Jamf::Connection] an API connection to use for the query.
|
|
603
|
+
#
|
|
604
|
+
# @return [String, nil] the management ID, or nil if the computer is not MDM managed
|
|
605
|
+
##########################################
|
|
606
|
+
def self.management_id(ident, cnx: Jamf.cnx)
|
|
607
|
+
jid = valid_id ident
|
|
608
|
+
raise Jamf::NoSuchItemError, "No Computer with identifier '#{ident}'" unless jid
|
|
609
|
+
|
|
610
|
+
cnx.jp_get("v2/computers-inventory/#{jid}").dig :general, :managementId
|
|
611
|
+
end
|
|
612
|
+
|
|
599
613
|
# Attributes
|
|
600
614
|
#####################################
|
|
601
615
|
|
|
@@ -1073,6 +1087,12 @@ module Jamf
|
|
|
1073
1087
|
Jamf::Computer.application_usage @id, start_date, end_date, cnx: @cnx
|
|
1074
1088
|
end # app usage
|
|
1075
1089
|
|
|
1090
|
+
# The management id for this computer
|
|
1091
|
+
# @return [String, nil] the management ID, or nil if the computer is not MDM managed
|
|
1092
|
+
def management_id
|
|
1093
|
+
@management_id ||= self.class.management_id @id, cnx: @cnx
|
|
1094
|
+
end
|
|
1095
|
+
|
|
1076
1096
|
# The 'computer management' data for this computer
|
|
1077
1097
|
#
|
|
1078
1098
|
# NOTE: the data isn't cached locally, and the API is queried every time
|