ruby-jss 2.0.0rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -10
- data/README-2.0.0.md +41 -0
- data/README.md +3 -1
- data/lib/jamf/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37c859eb265ff9298b8d49a8ded47c218d3355e270bf31cf3a276c7ac6db04b2
|
4
|
+
data.tar.gz: 83aac996b44f27830bcf24ee03f8ea70d4758b4e9418dfdbb8e4b2232c62c2f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c48ed5cafc7f2b24aba6a3eec0d83ecc8fd0a065372ef22b5d0db63c5ac8415d5033952f2a7d10d37eb29876c63bbd9775990cb9146fbd5d744dc0993955b5f2
|
7
|
+
data.tar.gz: 0cc3a608b9458e1abaf2aa04d32f34858ac892889ae384ee0ac0583c683a43d2d6be7b9dbd763d59738647dc7a1dad423cdfc22441b552df71674f7736597c05
|
data/CHANGES.md
CHANGED
@@ -4,29 +4,31 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
##
|
7
|
+
## _IMPORTANT_: Known Security Issue in v1.5.3 and below
|
8
8
|
|
9
|
-
Versions of ruby-jss prior to 1.6.0 contain a known security issue due to
|
9
|
+
Versions of ruby-jss prior to 1.6.0 contain a known security issue due to how we were using the 'plist' gem.
|
10
10
|
|
11
11
|
This has been resolved in 1.6.0, which now uses the CFProperlyList gem.
|
12
12
|
|
13
|
-
|
13
|
+
__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
|
+
|
17
18
|
## \[2.0.0] - Unreleased
|
18
19
|
|
19
20
|
Version 2.0.0 is a major refactoring of ruby-jss. While attempting to provide as much backward compatibility as possible, there are some significant changes and v2.0.0 is not fully backward compatible. **PLEASE TEST YOUR CODE EXTENSIVELY**
|
20
21
|
|
21
|
-
Here are the high-level changes and there are many many others. For more details, see [CHANGES-2.0.0](CHANGES-2.0.0.md)
|
22
|
+
Here are the high-level changes and there are many many others. For more details, see [CHANGES-2.0.0.md](CHANGES-2.0.0.md)
|
22
23
|
|
23
|
-
- Combined access to both APIs.
|
24
|
-
- The Classic and Jamf Pro APIs are no longer separated into the JSS and Jamf modules. There is only the `Jamf` module, and `JSS` is merely an alias of it, so all your code refering to the JSS module should still work.
|
25
|
-
- Auto-generated classes for the Jamf Pro API
|
26
|
-
- Base classes for JamfPro API objects are automatically generated from the OAPI3 Schema available at https://your.jamf.server/api/schema. This make it much simpler for ruby-jss to implement and update new and changed objects and endpoints in the Jamf Pro API.
|
27
|
-
- Code is auto-loaded from disk
|
28
|
-
- Because the auto-generated classes add hundreds of files to the gem, ruby-jss now uses [Zeitwerk](https://github.com/fxn/zeitwerk) to auto-load only the files it needs when they are needed.
|
29
24
|
- Support for Ruby 3.x
|
25
|
+
- tested in 3.0 and 3.1
|
26
|
+
- Combined access to both the Classic and Jamf Pro APIs
|
27
|
+
- A single namespace module
|
28
|
+
- Connection objects talk to both APIs & automatically handle details like bearer tokens
|
29
|
+
- Auto-generated code for Jamf Pro API objects
|
30
|
+
- Autoloading of code using [Zeitwerk](https://github.com/fxn/zeitwerk)
|
31
|
+
|
30
32
|
|
31
33
|
|
32
34
|
## \[1.6.7] - 2022-02-22
|
data/README-2.0.0.md
CHANGED
@@ -31,6 +31,7 @@ These changes have been in mind for some time, but the requirement in late 2022
|
|
31
31
|
- [No Attribute aliases for Jamf Pro API objects](#no-attribute-aliases-for-jamf-pro-api-objects)
|
32
32
|
- [Class/Mixin hierarchy for Jamf Pro API objects](#classmixin-hierarchy-for-jamf-pro-api-objects)
|
33
33
|
- [Support for 'Sticky Sessions' in Jamf Cloud](#support-for-sticky-sessions-in-jamf-cloud)
|
34
|
+
- [The valid_id method for Classic API collection classes](#the-valid_id-method-for-classic-api-collection-classes)
|
34
35
|
- [Planned deprecations](#planned-deprecations)
|
35
36
|
- [Use of the term 'api'](#use-of-the-term-api)
|
36
37
|
- [.map_all_ids_to method for Classic API collection classes](#map_all_ids_to-method-for-classic-api-collection-classes)
|
@@ -156,6 +157,9 @@ So far we've only uncovered a few areas where our ruby-jss 1.x code didn't work
|
|
156
157
|
- Subclassing ruby-jss classes in your own code.
|
157
158
|
- Those classes, and methods called on them, may need to be updated to match the new ruby-jss classes, in order to maintain _their_ backward compatibility.
|
158
159
|
|
160
|
+
- If you make calls to Classic API's `.valid_id` class method for collection classes, and you pass in an integer as a String, e.g. '1234', expecting to get the valid id of the object with the _name_ or _serial_number_ '1234' you will now get back the id 1234 if there is an object with that id. That may not be the id of the object you were looking for.
|
161
|
+
- See [The valid_id method for Classic API collection classes](#the-valid_id-method-for-classic-api-collection-classes) below for details and how to do such a validation now.
|
162
|
+
|
159
163
|
## Notable changes from ruby-jss 1.x
|
160
164
|
|
161
165
|
### Paged queries to the Jamf Pro API
|
@@ -213,6 +217,43 @@ For details about Sticky Sessions see [Sticky Sessions for Jamf Cloud](https://d
|
|
213
217
|
|
214
218
|
**WARNING:** Jamf recommends NOT using sticky sessions unless they are needed. Using them inappropriately may negatively impact performance, especially for large automated processes.
|
215
219
|
|
220
|
+
### The `valid_id` method for Classic API collection classes
|
221
|
+
|
222
|
+
In the Classic API, object ids are Integers, but in the Jamf Pro API, they are Strings containing integers.
|
223
|
+
|
224
|
+
In previous versions of ruby-jss, the `valid_id` class method for the Jamf Pro API will accept Integers and convert them to Strings to search for the valid id. In order to provide the same flexibility, `valid_id` now works the same way for regardless of which API is used.
|
225
|
+
|
226
|
+
Previously, the Classic API collection classes would return nil (no match) if you passed in an id as a string, unless you had an object with a name or other identifier with that numeric string value.
|
227
|
+
|
228
|
+
So for example, assuming you wanted to find out if the id 1234 was valid, you could do
|
229
|
+
|
230
|
+
```ruby
|
231
|
+
ok_id = JSS::Computer.valid_id 1234
|
232
|
+
# => 1234, or nil if 1234 is not a valid id
|
233
|
+
```
|
234
|
+
|
235
|
+
But if you did
|
236
|
+
|
237
|
+
```ruby
|
238
|
+
ok_id = JSS::Computer.valid_id '1234'
|
239
|
+
# => nil, or the id of a computer _named_ '1234'
|
240
|
+
# (no computer would have '1234' as a serialnumber, udid, or macaddress)
|
241
|
+
```
|
242
|
+
you would likely not get the integer id 1234 back.
|
243
|
+
|
244
|
+
In ruby-jss 2.0.0, the valid_id method has changed so that the second example above will return the integer id 1234, if it exists as an id. If not, it will look at other identifiers with the string value, and return the id of any match, or nil if there's no match.
|
245
|
+
|
246
|
+
The downside of this is: what if you really _are_ looking for the id of the object with the name '1234'?
|
247
|
+
|
248
|
+
To deal with that situation, the valid_id method for the Classic API now behaves like the one for the Jamf Pro API: it can accept an arbitrary key: value pair, limiting the search to the indentifier used as the key.
|
249
|
+
|
250
|
+
So you can use this to get what you're looking for
|
251
|
+
|
252
|
+
```ruby
|
253
|
+
ok_id = JSS::Computer.valid_id name: '1234'
|
254
|
+
# => nil, or the id of a computer named '1234'
|
255
|
+
```
|
256
|
+
|
216
257
|
## Planned deprecations
|
217
258
|
|
218
259
|
Even though it was publically released in 2014, ruby-jss's origins are from 2009, so it's been around for a while. We've learned a lot since then, and lots of the old lingering code is terribly out of date.
|
data/README.md
CHANGED
@@ -3,8 +3,10 @@
|
|
3
3
|
|
4
4
|
## Version 2.0.0 has been released
|
5
5
|
|
6
|
-
Version 2.0.0 has major changes! While we've strived for backward
|
6
|
+
Version 2.0.0 has major changes! While we've strived for _mostly_ being backward compatible, and have done lots of testing, YMMV. Please report any issues.
|
7
7
|
|
8
|
+
_NOTE_: ruby-jss 2.0 is not completely backward compatible, please see [README-2.0.0.md](README-2.0.0.md) for more info
|
9
|
+
|
8
10
|
### Highlights
|
9
11
|
|
10
12
|
- Support for Ruby 3.x
|
data/lib/jamf/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: 2.0.
|
4
|
+
version: 2.0.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: 2022-09-
|
13
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: CFPropertyList
|
@@ -822,9 +822,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
822
822
|
version: 2.6.3
|
823
823
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
824
824
|
requirements:
|
825
|
-
- - "
|
825
|
+
- - ">="
|
826
826
|
- !ruby/object:Gem::Version
|
827
|
-
version:
|
827
|
+
version: '0'
|
828
828
|
requirements: []
|
829
829
|
rubygems_version: 3.1.4
|
830
830
|
signing_key:
|