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

Returning onepassword.MissingCredentials Error #72

Open
SaltireSequence opened this issue Jan 21, 2025 · 1 comment
Open

Returning onepassword.MissingCredentials Error #72

SaltireSequence opened this issue Jan 21, 2025 · 1 comment

Comments

@SaltireSequence
Copy link

Appreciating this is for bugs, and not StackOverflow...I am unsure if 'unofficial' Windows support was added in 01/06 release, so raising this as a 'potential' issue.

My function (fully functioning on Mac

from onepassword import OnePassword

def authenticate(base_endpoint, api_key, api_secret):
    op = OnePassword()
    # Getting vault list
    available_vaults = op.list_vaults()
   
    # Searching for Employee Vault
    employee_vault = next((vault for vault in available_vaults if vault["name"] == "Employee"), None)
    
    # Getting Employee Vault ID
    items = op.list_items(vault=employee_vault["id"])
    
    # Searching for Addepar API item in Employee vault
    addepar_item = next((item for item in items if item["title"] == "Addepar API"), None)
    
    # Getting Addepar API item details
    item_details = op.get_item(uuid=addepar_item["id"], fields=["username", "credential"])
    
    # Saving item credentials in variables for API usage
    api_key = item_details["username"]
    api_secret = item_details["credential"]

Getting the following on Windows (works fine on Mac) so unsure if a Windows or install issue (please close if so) -

Traceback

File "C:\Users\william\PyCharmProjects\CLIProject\.venv\lib\site-packages\onepassword.py, line 53, in __init__
raise MissingCredentials()
onepassword.MissingCredentials

Traceback Reference
This looks to be referencing the class OnePassword(object). Specifically:

class OnePassword(object):

    def __init__(self, secret=None, token=None, shorthand=None, bin_path=""):
        self.op = os.path.join(bin_path, "op")
        if secret is not None:
            self.shorthand = str(uuid4())
            self.session_token = self.get_access_token(secret, shorthand=self.shorthand)
        elif token is not None and shorthand is not None:
            self.shorthand = shorthand
            self.session_token = token
        else:
            raise MissingCredentials()

System Details
Windows 11 version 24H2
Python 3.12.8
1Password CLI 2.24.0
1Password 8.10.56

@dtpryce
Copy link
Collaborator

dtpryce commented Jan 21, 2025

We did not add full Windows support as you can see in the README there is no suggestion it works. However, I am sure in parts it does. We would need some help in implementing something within the frameworks we have already and did start trying on the v2-windows branch, like I said it just needs some love. So please do feel enabled to submit a PR and we can go from there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants