macadmins / jamf-pro-sdk-python

A client library for the Jamf Pro APIs and webhooks.
https://macadmins.github.io/jamf-pro-sdk-python/
MIT License
41 stars 9 forks source link

[Bug] Can't call the ApiClientCredentialsProvider class on import #34

Open brendan-snyk opened 6 months ago

brendan-snyk commented 6 months ago

Simple script:

from jamf_pro_sdk import JamfProClient, ApiClientCredentialsProvider

url="https://test.jamfcloud.com"
client_id="<redacted>"
client_secret="<redacted>"

client = JamfProClient(
    server="snyk.jamfcloud.com",
    credentials=ApiClientCredentialsProvider(client_id, client_secret)
)

all_computers = client.pro_api.get_computer_inventory_v1()
print(all_computers)

This results in: cannot import name 'ApiClientCredentialsProvider' from 'jamf_pro_sdk' (/opt/homebrew/lib/python3.11/site-packages/jamf_pro_sdk/init.py)

Installed: jamf-pro-sdk 0.4a1

brendan-snyk commented 6 months ago

It's missing from here: https://github.com/macadmins/jamf-pro-sdk-python/blob/main/src/jamf_pro_sdk/__init__.py

brysontyrrell commented 6 months ago

The base client credentials provider will be added to the top-level imports in the next update.