ruby-jss 3.2.0b3 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f0e6a46c0c834feb898c00c2df2f509756a7f84cd346510c6f2502be433258a
4
- data.tar.gz: f765f17913f8bf75f8ea9d066845b451150ce893139d089e797fed061a84929d
3
+ metadata.gz: 487b55418c4189c503c97d8700afa29964905875ffcf3ab356af044bba0eb1ea
4
+ data.tar.gz: 76c942852d9cc0df7bb70162ddda80e75a189ead434e3775595baf966619bcae
5
5
  SHA512:
6
- metadata.gz: fb2c176af326d5d03e7d2b650c5aa8d2bafd3de420e0a3514af9532a9a68619ec5bdc9888e718ebeec1f355061b5c931ae4663dd43310d7d8c3e8edf99fa121c
7
- data.tar.gz: 12c3b89f22ed8e9a9384e8928d7bd4c5f09122276f793cf49e418ded3293e4a741bdfa2fad9ca96d47c6016d97fed63db5aeb447cf46cb4cf59e9b3582641700
6
+ metadata.gz: 72aeb242e3c161487d91f07bc1b12aacd99283ab72107d49b36d0949f3151148e05b8f940dc116f4ef1b12853ca4a1552a539eb9a9471394d247ceeaf51c8249
7
+ data.tar.gz: a4f2684e8d886c1c4d4f803ed04317c9c54a4721871bfe3544248f07afcddebca201aee0f8f02fb74f2ae7d1cc4ad274e2de1b879a9b0514d3d40c4ecd8fecd8
data/CHANGES.md CHANGED
@@ -15,7 +15,17 @@ __Please update all installations of ruby-jss to at least v1.6.0.__
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
17
  --------
18
- ## \[UNRELEASED]
18
+ ## \[3.12.0] 2023-09-05
19
+
20
+ ### Added
21
+ - Several new attributes to Jamf::Computer instances:
22
+ - `#enrolled_via_ade?` Boolean
23
+ - `#mdm_capable?` Boolean
24
+ - `#supervised?` Boolean
25
+ - `#user_approved_enrollment?` Boolean
26
+ - `#user_approved_mdm?` Boolean
27
+ - `#mdm_profile_expiration` Time
28
+
19
29
 
20
30
  ### Changed
21
31
  - Improved handling of known API bug in Jamf::Scopable::Scope.
@@ -45,7 +55,8 @@ Many many thanks to actae0n of Blacksun Hackers Club for reporting this issue an
45
55
 
46
56
 
47
57
  ### Fixed
48
- - Jamf::DeviceEnrollment.device no longer uses String#upcase!, which fails on frozen strings. Instead just use String#casecmp?
58
+ - `Jamf::DeviceEnrollment.device` no longer uses String#upcase!, which fails on frozen strings. Instead just use String#casecmp?
59
+ - `Jamf::APIConnection::Token#account` now correctly returns an instance of `Jamf::OAPISchemas::AuthorizationV1`
49
60
 
50
61
  ## \[3.1.0] 2023-06-06
51
62
 
@@ -653,6 +653,12 @@ module Jamf
653
653
  # @return [Time] the last time this machine was enrolled
654
654
  attr_reader :last_enrolled
655
655
 
656
+ # @return [Boolean] was the last enrollment via ADE/DEP
657
+ attr_reader :enrolled_via_dep
658
+ alias enrolled_via_dep? enrolled_via_dep
659
+ alias enrolled_via_ade enrolled_via_dep
660
+ alias enrolled_via_ade? enrolled_via_dep
661
+
656
662
  # @return [String] the primary macaddress
657
663
  attr_reader :mac_address
658
664
 
@@ -664,6 +670,22 @@ module Jamf
664
670
 
665
671
  # @return [Boolean] doesit support MDM?
666
672
  attr_reader :mdm_capable
673
+ alias mdm_capable? mdm_capable
674
+
675
+ # @return [Boolean] Is it supervised?
676
+ attr_reader :supervised
677
+ alias supervised? supervised
678
+
679
+ # @return [Boolean] was enrollment user-approved
680
+ attr_reader :user_approved_enrollment
681
+ alias user_approved_enrollment? user_approved_enrollment
682
+
683
+ # @return [Boolean] was MDM user-approved (meaning the User authorized the MDM profile)
684
+ attr_reader :user_approved_mdm
685
+ alias user_approved_mdm? user_approved_mdm
686
+
687
+ # @return [Time] when does the mdm profile expire
688
+ attr_reader :mdm_profile_expiration
667
689
 
668
690
  # @return [Hash] some MDM status details in general
669
691
  attr_reader :management_status
@@ -901,13 +923,20 @@ module Jamf
901
923
  @distribution_point = @init_data[:general][:distribution_point]
902
924
  @initial_entry_date = JSS.epoch_to_time @init_data[:general][:initial_entry_date_epoch]
903
925
  @last_enrolled = JSS.epoch_to_time @init_data[:general][:last_enrolled_date_epoch]
926
+ @enrolled_via_dep = @init_data[:general][:management_status][:enrolled_via_dep]
904
927
  @ip_address = @init_data[:general][:ip_address]
905
928
  @reported_ip_address = @init_data[:general][:last_reported_ip]
906
929
  @itunes_store_account_is_active = @init_data[:general][:itunes_store_account_is_active]
907
930
  @jamf_version = @init_data[:general][:jamf_version]
908
931
  @last_contact_time = JSS.epoch_to_time @init_data[:general][:last_contact_time_epoch]
932
+
909
933
  @mdm_capable = @init_data[:general][:mdm_capable]
910
934
  @mdm_capable_users = @init_data[:general][:mdm_capable_users].values
935
+ @supervised = @init_data[:general][:supervised]
936
+ @user_approved_enrollment = @init_data[:general][:management_status][:user_approved_enrollment]
937
+ @user_approved_mdm = @init_data[:general][:management_status][:user_approved_mdm]
938
+ @mdm_profile_expiration = JSS.epoch_to_time @init_data[:general][:mdm_profile_expiration_epoch]
939
+
911
940
  @netboot_server = @init_data[:general][:netboot_server]
912
941
  @platform = @init_data[:general][:platform]
913
942
  @report_date = JSS.epoch_to_time @init_data[:general][:report_date_epoch]
@@ -1139,7 +1139,7 @@ module Jamf
1139
1139
  def self.create(**args)
1140
1140
  validate_not_metaclass(self)
1141
1141
  unless constants.include?(:CREATABLE)
1142
- raise Jamf::UnsupportedError, "Creating #{self.class::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows."
1142
+ raise Jamf::UnsupportedError, "Creating #{self::RSRC_LIST_KEY} isn't yet supported. Please use other Casper workflows."
1143
1143
  end
1144
1144
  raise ArgumentError, "Use '#{self.class}.fetch id: xx' to retrieve existing JSS objects" if args[:id]
1145
1145
 
@@ -306,7 +306,10 @@ module Jamf
306
306
  REFRESH_RESULTS[@last_refresh_result]
307
307
  end
308
308
 
309
- # the Jamf::Account object assciated with this token
309
+ # the Jamf account assciated with this token, which contains info about
310
+ # privileges and Jamf acct group memberships and Jamf Acct settings
311
+ #
312
+ # @return [Jamf::OAPISchemas::AuthorizationV1] the Authorization object
310
313
  #################################
311
314
  def account
312
315
  return @account if @account
@@ -314,7 +317,7 @@ module Jamf
314
317
  resp = token_connection(AUTH_RSRC, token: @token).get
315
318
  return unless resp.success?
316
319
 
317
- @account = Jamf::APIAccount.new resp.body
320
+ @account = Jamf::OAPISchemas::AuthorizationV1.new resp.body
318
321
  end
319
322
 
320
323
  # Use this token to get a fresh one. If a pw is provided
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 = '3.2.0b3'.freeze
30
+ VERSION = '3.2.0'.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: 3.2.0b3
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lasell
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-08-08 00:00:00.000000000 Z
13
+ date: 2023-09-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: CFPropertyList
@@ -882,9 +882,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
882
882
  version: 2.6.3
883
883
  required_rubygems_version: !ruby/object:Gem::Requirement
884
884
  requirements:
885
- - - ">"
885
+ - - ">="
886
886
  - !ruby/object:Gem::Version
887
- version: 1.3.1
887
+ version: '0'
888
888
  requirements: []
889
889
  rubygems_version: 3.0.3.1
890
890
  signing_key: