jamf-pro-sdk-python
jamf-pro-sdk-python copied to clipboard
[Bug] Can't call the ApiClientCredentialsProvider class on import
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
It's missing from here: https://github.com/macadmins/jamf-pro-sdk-python/blob/main/src/jamf_pro_sdk/init.py
The base client credentials provider will be added to the top-level imports in the next update.
Howdy @brysontyrrell, any update on when this issue might be resolved? Unless there's a workaround available, this is a pretty big blocker for me using the sdk.
The ApiClientCredentialsProvider is available as an import using this code:
from jamf_pro_sdk.clients.auth import ApiClientCredentialsProvider
I am planning an overhaul to the credentials providers. Please see #47 for details and to provide feedback.