ruby-jss 0.10.0a1 → 0.10.0a2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3796577e296c595860954645bc0a2596f14245ff
4
- data.tar.gz: 1ef961ef3629054e53f04415999bb02525c6973a
3
+ metadata.gz: a2892a2ea5b017ea5910757fdd189075d3bcf11e
4
+ data.tar.gz: cb6b7b72e2478b542baa162425b9aa7cdb174800
5
5
  SHA512:
6
- metadata.gz: 449baa374a0229a15335eb9d96e5815fac87537176d7d9abad9cc9e3be39538b11cc575ff2a6651ba5e820e6f9724339fb2e32720f4fa48b431440cc3e32c873
7
- data.tar.gz: 9c1f058392f666a6bc812beadb9d36891ab6e49df7f4c47e3ecce7faa896e35108ed2a97c32bfdffa5da367f88ff7832f94c01f4ca59bfc4152f0e6b5345f3d0
6
+ metadata.gz: 9b3e243d66dac01bedd7c24b1829418a53d44a88ac9b5767a0db3736a2e3a0ff8758b2974a56c97b973f2dfce2826a22778b467c9442fe08941814328ab6585d
7
+ data.tar.gz: 91191643a00dd3479cfee176d6aa49d63047877510a84aea46f8d7590e17477be92ded1311748d3d09ae593df62e4c11b0ab70f43bac17e06c37783be247cfb4
data/CHANGES.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Change History
2
2
 
3
+ ## v0.10.0a2 2017-08-17 (pre release)
4
+
5
+ - Fix: require 'English', rather than require 'english'. Thanks to HIMANSHU-ELIGIBLE @ github for catching & fixing this one.
6
+
7
+ ## v0.10.0a1 2017-08-15 (pre release)
8
+
9
+ - Improvement: Working with multiple APIConnections is now far more flexible!
10
+
11
+ There are three ways to work with multiple simultaneous APIConnection instances:
12
+ 1. Making a connection 'active', after which API calls go thru it (introduced in 0.9.0)
13
+ 2. Passing an APIConnection instance to methods that use the API
14
+ 3. Using an APIConnection instance itself to make API calls.
15
+
16
+ The default/active connection continues to work as always, so your existing code will be fine.
17
+ See the [documentation for the JSS::APIConnection class](http://www.rubydoc.info/gems/ruby-jss/JSS/APIConnection) for details.
18
+ - Fix: Specifying port 443, as well as 8443, when connecting an APIConnection will default to using SSL. To force such a connection to NOT use SSL, provide the parameter `use_ssl: false`
19
+
3
20
  ## v0.9.3 2017-08-08
4
21
 
5
22
  - Add: JSS::Computer instance now allow you to modify mac_address, alt_mac_address, udid, and serial_number.
data/bin/netseg-update CHANGED
@@ -42,7 +42,7 @@
42
42
  ##############################
43
43
  require 'ruby-jss'
44
44
  require 'getoptlong'
45
- require 'english'
45
+ require 'English'
46
46
 
47
47
  # The app object
48
48
  ##############################
@@ -295,9 +295,15 @@ module JSS
295
295
  # The Default port
296
296
  HTTP_PORT = 9006
297
297
 
298
- # The SSL port
298
+ # The Jamf default SSL port
299
299
  SSL_PORT = 8443
300
300
 
301
+ # The https default SSL port
302
+ HTTPS_SSL_PORT = 443
303
+
304
+ # if either of these is specified, we'll default to SSL
305
+ SSL_PORTS = [SSL_PORT, HTTPS_SSL_PORT].freeze
306
+
301
307
  # The top line of an XML doc for submitting data via API
302
308
  XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.freeze
303
309
 
@@ -412,14 +418,17 @@ module JSS
412
418
  #
413
419
  def connect(args = {})
414
420
  args = apply_connection_defaults args
421
+
422
+ # confirm we know basics
415
423
  verify_basic_args args
424
+
425
+ # parse our ssl situation
426
+ verify_ssl args
427
+
416
428
  @jss_user = args[:user]
417
429
 
418
430
  @rest_url = build_rest_url args
419
431
 
420
- # figure out :verify_ssl from :verify_cert
421
- args[:verify_ssl] = verify_ssl args
422
-
423
432
  # figure out :password from :pw
424
433
  args[:password] = acquire_password args
425
434
 
@@ -1038,8 +1047,17 @@ module JSS
1038
1047
  # @return [Type] description_of_returned_object
1039
1048
  #
1040
1049
  def verify_ssl(args)
1050
+ # use SSL for those ports unless specifically told not to
1051
+ if SSL_PORTS.include? args[:port]
1052
+ args[:use_ssl] = true if args[:use_ssl].nil?
1053
+ end
1041
1054
  # if verify_cert is anything but false, we will verify
1042
- args[:verify_cert] == false ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER
1055
+ args[:verify_ssl] =
1056
+ if args[:verify_cert] == false
1057
+ OpenSSL::SSL::VERIFY_NONE
1058
+ else
1059
+ OpenSSL::SSL::VERIFY_PEER
1060
+ end
1043
1061
  end
1044
1062
 
1045
1063
  # Parses the HTTP body of a RestClient::Conflict (409 conflict)
data/lib/jss/version.rb CHANGED
@@ -27,6 +27,6 @@
27
27
  module JSS
28
28
 
29
29
  ### The version of the JSS ruby gem
30
- VERSION = '0.10.0a1'.freeze
30
+ VERSION = '0.10.0a2'.freeze
31
31
 
32
32
  end # module
data/lib/jss.rb CHANGED
@@ -52,7 +52,7 @@ module JSS
52
52
  require 'digest'
53
53
  require 'yaml'
54
54
  require 'open3'
55
- require 'english'
55
+ require 'English'
56
56
 
57
57
  ###################
58
58
  ### Gems
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: 0.10.0a1
4
+ version: 0.10.0a2
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: 2017-08-15 00:00:00.000000000 Z
12
+ date: 2017-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: plist