ruby-jss 1.0.3b5 → 1.0.4b1
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 +10 -6
- data/lib/jss/api_object/package.rb +36 -12
- data/lib/jss/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c225dd8883168a2bf57d650196a6a535bd67e185736b3e61e6b60ce1a9b8385c
|
4
|
+
data.tar.gz: 2bd4a39129ea203b49aa9dc579b70f2a8e4b06bafeb4267d34ed80bea4254016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6652993d14454f54cc509a6d0835eecf9d3d4b1220135c5b492ccd4c64e3af8353233c718fa27c038dbd6501bfea67987c188ed501bdd5ecb0c0bddeacbeaabd
|
7
|
+
data.tar.gz: f3046e7dcba8e6673805ad1990082c541f12d5e6a9ca4e1306d4e9284cdacd60807be400435ca19a4d82424f45553b61ddc3ed2deb84aff17aeca0920d1aa0b3
|
data/CHANGES.md
CHANGED
@@ -26,17 +26,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
26
26
|
(Thanks @christopher.kemp!)
|
27
27
|
|
28
28
|
- Packages in Jamf Pro 10.10 and higher now include checksum data (`hash_type` and `hash_value` in the raw data) via the classic API. This has been integrated into JSS::Package via the following methods:
|
29
|
-
- New Class Method
|
29
|
+
- New Class Method
|
30
|
+
- `JSS::Package.calculate_checksum(filepath, type)` calcuates an MD5 or SHA_512 hash for an arbtrary file.
|
31
|
+
- New Instance Attributes:
|
32
|
+
- `JSS::Package#checksum` the checksum value, read-write
|
33
|
+
- `JSS::Package#checksum_type` the string 'MD5' or 'SHA_512' ('SHA_512' if no checksum is set), read-write
|
30
34
|
- New Instance Methods:
|
31
|
-
- `JSS::Package#checksum` returns the checksum value
|
32
|
-
- `JSS::Package#checksum_type` returns the string 'MD5' or 'SHA_512' ('SHA_512' if no checksum is set)
|
33
35
|
- `JSS::Package#caluclate_checksum(type: nil, local_file: nil, rw_pw: nil, ro_pw: nil, unmount: true )` recalculates and returns the checksum from a local file or the master dist. point. Doesn't change the Package instance
|
34
36
|
- `JSS::Package#checksum_valid?(local_file: nil, rw_pw: nil, ro_pw: nil, unmount: true)` recalculates the checksum from a local file or the master dist. point, and returns Boolean true if it matches the stored one, false if not. Always false if there is no stored checksum. Doesn't change the Package instance
|
35
37
|
- `JSS::Package#reset_checksum(type: nil, local_file: nil, rw_pw: nil, ro_pw: nil, unmount: true)` recalculates and resets the checksum from a local file or the master dist. point. The instance must be saved back to the server for the new checksum to stick,
|
36
|
-
- Modified Instance Method
|
38
|
+
- Modified Instance Method
|
39
|
+
- `JSS::Package#upload_master_file` now takes a `cksum:` parameter, the String 'MD5' or 'SHA_512'. Any other value means 'don't use a checksum on this package' Defaults to 'SHA_512' and a checksum will be calculated. Be sure to set `cksum:` to some other value if you don't want a checksum.
|
37
40
|
|
38
|
-
NOTE: Checksum calculation can be slow.
|
39
|
-
|
41
|
+
NOTE: Checksum calculation can be slow, especially for large packages on a network server.
|
42
|
+
|
43
|
+
_WARNING_: when using a local file to calculate checksums, BE 100% SURE it is identical to the file on the distribution point, or you will get an invalid checksum.
|
40
44
|
|
41
45
|
|
42
46
|
### Fixed
|
@@ -396,12 +396,41 @@ module JSS
|
|
396
396
|
#
|
397
397
|
def notes=(new_val)
|
398
398
|
return nil if new_val == @notes
|
399
|
+
|
399
400
|
# line breaks should be \r
|
400
401
|
new_val = new_val.to_s.tr("\n", "\r")
|
401
402
|
@notes = new_val
|
402
403
|
@need_to_update = true
|
403
404
|
end
|
404
405
|
|
406
|
+
# Change the checksum type
|
407
|
+
#
|
408
|
+
# @param new_val[String]
|
409
|
+
#
|
410
|
+
# @return [void]
|
411
|
+
#
|
412
|
+
def checksum_type=(new_val)
|
413
|
+
return if new_val == @checksum_type
|
414
|
+
raise JSS::InvalidDataError, "Checksum type must be one of: #{CHECKSUM_HASH_TYPES.keys.join ', '} " unless CHECKSUM_HASH_TYPES.key? new_val
|
415
|
+
|
416
|
+
@checksum_type = new_val
|
417
|
+
@need_to_update = true
|
418
|
+
end
|
419
|
+
|
420
|
+
# Change the checksum type
|
421
|
+
#
|
422
|
+
# @param new_val[String]
|
423
|
+
#
|
424
|
+
# @return [void]
|
425
|
+
#
|
426
|
+
def checksum=(new_val)
|
427
|
+
return if new_val == @checksum
|
428
|
+
raise JSS::InvalidDataError, 'Checksum must be a String or nil' unless new_val.is_a?(String) || new_val.nil?
|
429
|
+
|
430
|
+
@checksum = new_val
|
431
|
+
@need_to_update = true
|
432
|
+
end
|
433
|
+
|
405
434
|
# Change the os_requirements field in the JSS
|
406
435
|
# E.g. 10.5, 10.5.3, 10.6.x
|
407
436
|
#
|
@@ -611,14 +640,12 @@ module JSS
|
|
611
640
|
|
612
641
|
if CHECKSUM_HASH_TYPES.keys.include? chksum
|
613
642
|
@checksum_type = chksum
|
614
|
-
@checksum = calculate_checksum local_path, chksum
|
643
|
+
@checksum = calculate_checksum local_file: local_path, type: chksum, unmount: false
|
615
644
|
@need_to_update = true
|
616
645
|
end
|
617
|
-
|
618
646
|
update if @need_to_update
|
619
|
-
|
620
647
|
mdp.unmount if unmount
|
621
|
-
end # upload
|
648
|
+
end # upload master file
|
622
649
|
|
623
650
|
# Using either a local file, or the file on the master dist. point,
|
624
651
|
# re-set the checksum for this package. Call #update to save the
|
@@ -634,7 +661,7 @@ module JSS
|
|
634
661
|
#
|
635
662
|
# @return [void]
|
636
663
|
#
|
637
|
-
def reset_checksum(type: nil, local_file: nil,
|
664
|
+
def reset_checksum(type: nil, local_file: nil, rw_pw: nil, ro_pw: nil, unmount: true)
|
638
665
|
type ||= DEFAULT_CHECKSUM_HASH_TYPE
|
639
666
|
|
640
667
|
new_checksum = calculate_checksum(
|
@@ -1018,13 +1045,10 @@ module JSS
|
|
1018
1045
|
pkg.add_element('required_processor').text = @required_processor.to_s.empty? ? 'None' : @required_processor
|
1019
1046
|
pkg.add_element('send_notification').text = @send_notification
|
1020
1047
|
pkg.add_element('switch_with_package').text = @switch_with_package
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
pkg.add_element('hash_type').text = @checksum_type
|
1026
|
-
pkg.add_element('hash_value').text = @checksum
|
1027
|
-
end
|
1048
|
+
|
1049
|
+
pkg.add_element('hash_type').text = @checksum_type
|
1050
|
+
pkg.add_element('hash_value').text = @checksum.to_s
|
1051
|
+
|
1028
1052
|
add_category_to_xml(doc)
|
1029
1053
|
doc.to_s
|
1030
1054
|
end # rest xml
|
data/lib/jss/version.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.4b1
|
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: 2019-05-
|
12
|
+
date: 2019-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: plist
|
@@ -267,7 +267,7 @@ files:
|
|
267
267
|
- test/specs/policy_spec.rb
|
268
268
|
homepage: http://pixaranimationstudios.github.io/ruby-jss/
|
269
269
|
licenses:
|
270
|
-
-
|
270
|
+
- Nonstandard
|
271
271
|
metadata: {}
|
272
272
|
post_install_message:
|
273
273
|
rdoc_options:
|