ruby-jss 4.2.1 → 4.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4954d82549682beafa2624e07bad383d732fae5f77b8d1a3a07f499504b4be2
4
- data.tar.gz: 2bd26c0615a368da8988779fb6a2d2726090a8484dbef6005f98a60c8db50326
3
+ metadata.gz: 1c7c5b51e4752d7be68fb4e6caab5fa98d00e2bba66bfa356a316004a5f7ea49
4
+ data.tar.gz: 455ef851b1e8bb75faf2e9abc171a0fbd84a8a1b30156c18b30933fc0ad51edf
5
5
  SHA512:
6
- metadata.gz: ad08c4b7028c37be9b8b0a941ef59eabf8e77530d4533c69f9ff824fed78d8624808640121fd84a08d14f0fac55c14a19d58c36a2a2a76ce4f6b503ef93c1796
7
- data.tar.gz: 88d53f94ac7412b278c6dac089ed52b12327476a32b7e57fd92c0509c3a7dffec9f55c03c533ae1545a7d7b771599192baadfb141af0e230b8648fdcfd6d7267
6
+ metadata.gz: c8c9d09216f3105002b9c9200896223d94a191a5601cb21cde79df1aeb1745275d86481765cfa840ed25fcb93ba9d634f1efd4332e774d8a74d079a7a036604f
7
+ data.tar.gz: 640aef2c3794c0337ab6ce7c08598eb096280e3feab54d245f5e0af7cef62903898f0c8d405c0265c2febe065f2bac05182081f3736c5d5fe75f879ce44d40ba
data/CHANGES.md CHANGED
@@ -14,6 +14,28 @@ __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
+ ## \[4.2.2] Unreleased
19
+
20
+ ### Fixed
21
+ - Class `Jamf::JPackage` no longer raises `Errno::EINVAL Invalid argument @ io_fread` when generating manifest checksums for very large package files.
22
+
23
+
24
+ ### Deprecated
25
+
26
+ - Class `Jamf::DBConnection`. Access to the MySQL backend database for on-prem Jamf Pro installations will be removed in a future release, probably some time in mid-late 2026. If you use this class, please update your code to make and use such connections independently of ruby-jss. This removal also includes the 'default' instance stored in `Jamf::DB_CNX` and `Jamf.db`.
27
+
28
+ The following methods will also be removed, as they require that class for direct database access.
29
+ - `Jamf::ComputerExtensionAttribute#history`
30
+ - `Jamf::MobileDeviceExtensionAttribute#history`
31
+ - `Jamf::Icon.all`
32
+ - `Jamf::SelfServable#validate_icon`
33
+ - `Jamf::APIObject#add_object_history_entry`
34
+
35
+ Note that some objects in the Jamf Pro API have access to their object_history. As classes are migrated (see release notes for 4.2.0 below) that access will be included when available.
36
+
37
+
38
+
17
39
  --------
18
40
  ## \[4.2.1] 2025-08-11
19
41
 
@@ -661,7 +661,15 @@ module Jamf
661
661
  # @return [void]
662
662
  ##############################
663
663
  def calculate_manifest_checksums(file, new_manifest, chunk_size: nil)
664
+ # we need the whole file checksum even if chunking, so
665
+ # get that first
666
+ # The Digest::SHA256.file method will read even huge files successfully
667
+ # without loading the whole file into memory, as would File.read.
668
+ #
669
+ whole_file_checksum = Digest::SHA256.file(file).hexdigest
670
+
664
671
  # are we chunking the download?
672
+ # we need checksums for each chunk, and the size of each chunk
665
673
  if chunk_size.is_a? Integer
666
674
  new_manifest[:items][0][:assets][0]['sha256-size'] = chunk_size
667
675
  file.open do |f|
@@ -670,23 +678,17 @@ module Jamf
670
678
  end
671
679
  end
672
680
 
673
- # not chunking, use the file filesize
681
+ # not chunking, use the file filesize and whole-file checksum
674
682
  else
675
683
  new_manifest[:items][0][:assets][0]['sha256-size'] = file.size
676
- new_manifest[:items][0][:assets][0]['sha256s'] = [Digest::SHA256.hexdigest(file.read)]
684
+ new_manifest[:items][0][:assets][0]['sha256s'] = [whole_file_checksum]
677
685
  end
678
686
 
679
687
  # Store the whole-file checksum in
680
- # manifest[:items][0][:metadata]['sha256-whole']. taking it from
681
- # manifest[:items][0][:assets][0]['sha256s'][0], if available, or generate it if needed
688
+ # manifest[:items][0][:metadata]['sha256-whole'], a non-standard key used by ruby-jss.
682
689
  # It is used by the deploy_via_mdm method.
683
690
  # This value is required for MDM deployments, even if the file is chunked in the manifest.
684
- new_manifest[:items][0][:metadata]['sha256-whole'] =
685
- if new_manifest[:items][0][:assets][0]['sha256s'].size == 1
686
- new_manifest[:items][0][:assets][0]['sha256s'][0]
687
- else
688
- Digest::SHA256.hexdigest(file.read)
689
- end
691
+ new_manifest[:items][0][:metadata]['sha256-whole'] = whole_file_checksum
690
692
  end
691
693
  private :calculate_manifest_checksums
692
694
 
data/lib/jamf/version.rb CHANGED
@@ -27,6 +27,6 @@
27
27
  module Jamf
28
28
 
29
29
  ### The version of ruby-jss
30
- VERSION = '4.2.1'.freeze
30
+ VERSION = '4.2.2'.freeze
31
31
 
32
32
  end # module
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jss
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lasell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-08-11 00:00:00.000000000 Z
12
+ date: 2025-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: CFPropertyList
@@ -502,7 +502,7 @@ files:
502
502
  - test/tests/policy.rb
503
503
  homepage: http://pixaranimationstudios.github.io/ruby-jss/
504
504
  licenses:
505
- - Nonstandard
505
+ - LicenseRef-LICENSE.txt
506
506
  metadata:
507
507
  source_code_uri: https://github.com/PixarAnimationStudios/ruby-jss
508
508
  changelog_uri: https://github.com/PixarAnimationStudios/ruby-jss/blob/master/CHANGES.md