Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brendan-snyk opened this issue Dec 12, 2023 · 4 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@brendan-snyk
Copy link

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 brendan-snyk added the bug Something isn't working label Dec 12, 2023
@brendan-snyk
Copy link
Author

@brysontyrrell brysontyrrell self-assigned this Dec 29, 2023
@brysontyrrell brysontyrrell added enhancement New feature or request and removed bug Something isn't working labels Dec 29, 2023
@brysontyrrell
Copy link
Collaborator

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

@mhrono
Copy link

mhrono commented Jul 23, 2024

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.

@brysontyrrell
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants