Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions src/onepassword/desktop_core.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
import ctypes
import json
import os
import platform
import base64
from pathlib import Path
from ctypes import c_uint8, c_size_t, c_int32, POINTER, byref, c_void_p

Check failure on line 7 in src/onepassword/desktop_core.py

View workflow job for this annotation

GitHub Actions / Lint

Ruff (F401)

src/onepassword/desktop_core.py:7:64: F401 `ctypes.c_void_p` imported but unused

Check failure on line 7 in src/onepassword/desktop_core.py

View workflow job for this annotation

GitHub Actions / Lint

Ruff (F401)

src/onepassword/desktop_core.py:7:64: F401 `ctypes.c_void_p` imported but unused
from .core import UniffiCore

Check failure on line 8 in src/onepassword/desktop_core.py

View workflow job for this annotation

GitHub Actions / Lint

Ruff (F401)

src/onepassword/desktop_core.py:8:19: F401 `.core.UniffiCore` imported but unused

Check failure on line 8 in src/onepassword/desktop_core.py

View workflow job for this annotation

GitHub Actions / Lint

Ruff (F401)

src/onepassword/desktop_core.py:8:19: F401 `.core.UniffiCore` imported but unused
from onepassword.errors import raise_typed_exception


def find_1password_lib_path():
locations = [
"/Users/andititu/core/target/debug/libop_sdk_ipc_client.dylib"
]
os_name = platform.system()

# Define paths based on OS
if os_name == "Darwin": # macOS
locations = [
"/Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib",
str(Path.home() / "Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib"),
]
elif os_name == "Linux":
locations = [
"/usr/bin/1password/libop_sdk_ipc_client.so",
"/opt/1password/libop_sdk_ipc_client.so",
"/snap/bin/1password/libop_sdk_ipc_client.so",
]
elif os_name == "Windows":
locations = [
r"C:\Program Files\1Password\op_sdk_ipc_client.dll",
r"C:\Program Files (x86)\1Password\op_sdk_ipc_client.dll",
str(Path.home() / r"AppData\Local\1Password\op_sdk_ipc_client.dll"),
]
else:
raise OSError(f"Unsupported operating system: {os_name}")

for lib_path in locations:
if os.path.exists(lib_path):
Expand Down
Loading