Coder Social home page Coder Social logo

univ-of-utah-marriott-library-apple / python-jamf Goto Github PK

View Code? Open in Web Editor NEW
56.0 10.0 17.0 528 KB

`python-jamf` is a library for connecting to a Jamf Server. It maps Jamf Pro records to a Record class. It is the basis for the `jctl` tool to automate patch management & packages and many other items.

License: MIT License

Python 99.70% Dockerfile 0.30%
python macos automation patch jamf jamf-pro jamf-pro-api installer-packages autopkg

python-jamf's People

Contributors

0xmachos avatar dependabot[bot] avatar homebysix avatar honestpuck avatar magnusviri avatar oryanhampton avatar pythoninthegrass avatar tophernad avatar uurazzle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-jamf's Issues

Add Support for Detecting Jamf Pro Version & Bearer Token Authentication

Hi:

Jamf will deprecate support for Basic Authentication in Jamf Pro v10.35.0 or later. python-jamf will need to add support for Bearer Token authentication by implementing a version check of Jamf Pro, your application can determine whether Bearer Token authentication is supported (v10.35.0 or later) or if use of Basic authentication is required (v10.34.0 and earlier).

The jamf-pro-version endpoint within the Jamf Pro API returns the version of the Jamf Pro Server, to help your application determine authentication compatibility with a given Jamf Pro Server. Jamf recommends including a preference to allow users to select the authentication schema based on their environment configuration or dynamically determining which authentication mechanism to use based on the Jamf Pro Server version.

In addition to the recommendations provided above, Jamf has updated the Classic API Postman Collection to now default to the use of Bearer Token authentication. Older versions of the collection will continue to be available for interaction with environments not yet upgraded to 10.35.0 or later, however the new collection will default to using Bearer Token authentication.

Additional details regarding the changes, including best practices are detailed on the Jamf Developer Portal.

JamfRecordNotFound class missing attribute

Hello, it looks like the JamfRecordNotFound Error class is missing the attribute response. This causes it to not be properly returned when a record is not found, producing a type error instead.

raise exceptions.JamfRecordNotFound(response, "Not Found")
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: Error.init() takes from 1 to 2 positional arguments but 3 were given

Update Documentation With New Package Name

Running one of my existing Jupyter notebooks I got the following error

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 2
      1 # Imports
----> 2 import jamf
      3 import datetime
      4 from dateutil.relativedelta import relativedelta, FR

ModuleNotFoundError: No module named 'jamf'

It appears that in 220f88e you renamed the package from jamf to python_jamf. This change has appeared in version 0.9.0 which was published on pypi on December 11th.

All I had to do to get my code running again was:

  • import jamf > import python_jamf
  • api = jamf.Api() > api = python_jamf.Api()

I'd be happy to make a PR if the change in documentation is as simple as my experience above?

object has no attribute 'classic'

Trying to build a script to gather information about objects such as Packages or Policies, I get errors like AttributeError: 'Packages' object has no attribute 'classic' after running any command such as allpackages.recordWithId(500) or Packages().find(141)

docker-compose doesn't create network automatically

Issue

Testing the stable docker version of python-jamf and the build process is failing at network creation.

Steps to reproduce

Have only tried with python-jamf-github, but suspect it's the same for python-jamf-dev.

$ cd python-jamf/python-jamf-docker
$ docker-compose run --rm python-jamf-github
network jamfpro_jamfnet declared as external, but could not be found

Workaround

Create the jamfpro_jamfnet docker network manually.

$ docker network create -d bridge jamfpro_jamfnet
4576<snip>
$ docker-compose run --rm python-jamf-github
[+] Building 106.1s (6/8)
 => [internal] load build definition from Dockerfile                                                                                                                            0.0s

test_package - problem with path

test_package has six tests failing. All appear to be failing because the path passed to tar in a call to get package information points to the actual package and not the the expanded package so tar barfs on it.

Turn README into wiki

Not really an issue. Just a point I wanted to raise for discussion. The README is now getting to a length and if I add documentation for my work it will get longer.

So how do you feel about me taking the existing README and my documentation and turning it onto a shorter README and a wiki? I was thinking of just a top page and only one layer of sub pages corresponding with the current headlines.

I also have no idea if I can PR the wiki but I'm guessing I can.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.