Skip to content

Commit 181059c

Browse files
Update core to version 1710cc48
1 parent 54456db commit 181059c

12 files changed

Lines changed: 1014 additions & 21 deletions

example/desktop_app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ async def showcase_vault_operations(client: Client):
103103
# [developer-docs.sdk.python.list-vault]-end
104104

105105

106-
async def showcase_group_permission_operations(client: Client, vault_id: str, group_id: str):
106+
async def showcase_group_permission_operations(
107+
client: Client, vault_id: str, group_id: str
108+
):
107109

108110
# [developer-docs.sdk.python.grant-group-permissions]-start
109111
# Grant Group Permissions
@@ -199,8 +201,7 @@ async def showcase_batch_item_operations(client: Client, vault_id: str):
199201
item_ids = []
200202
for res in batchCreateResponse.individual_responses:
201203
if res.content is not None:
202-
print('Created item "{}" ({})'.format(
203-
res.content.title, res.content.id))
204+
print('Created item "{}" ({})'.format(res.content.title, res.content.id))
204205
item_ids.append(res.content.id)
205206
elif res.error is not None:
206207
print("[Batch create] Something went wrong: {}".format(res.error))
@@ -211,8 +212,7 @@ async def showcase_batch_item_operations(client: Client, vault_id: str):
211212
batchGetReponse = await client.items.get_all(vault_id, item_ids)
212213
for res in batchGetReponse.individual_responses:
213214
if res.content is not None:
214-
print('Obtained item "{}" ({})'.format(
215-
res.content.title, res.content.id))
215+
print('Obtained item "{}" ({})'.format(res.content.title, res.content.id))
216216
elif res.error is not None:
217217
print("[Batch get] Something went wrong: {}".format(res.error))
218218
# [developer-docs.sdk.python.batch-get-items]-end
@@ -227,5 +227,6 @@ async def showcase_batch_item_operations(client: Client, vault_id: str):
227227
print("Deleted item {}".format(id))
228228
# [developer-docs.sdk.python.batch-delete-items]-end
229229

230+
230231
if __name__ == "__main__":
231232
asyncio.run(main())

example/example.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ async def showcase_batch_item_operations(client: Client, vault_id: str):
313313
item_ids = []
314314
for res in batchCreateResponse.individual_responses:
315315
if res.content is not None:
316-
print('Created item "{}" ({})'.format(
317-
res.content.title, res.content.id))
316+
print('Created item "{}" ({})'.format(res.content.title, res.content.id))
318317
item_ids.append(res.content.id)
319318
elif res.error is not None:
320319
print("[Batch create] Something went wrong: {}".format(res.error))
@@ -325,8 +324,7 @@ async def showcase_batch_item_operations(client: Client, vault_id: str):
325324
batchGetReponse = await client.items.get_all(vault_id, item_ids)
326325
for res in batchGetReponse.individual_responses:
327326
if res.content is not None:
328-
print('Obtained item "{}" ({})'.format(
329-
res.content.title, res.content.id))
327+
print('Obtained item "{}" ({})'.format(res.content.title, res.content.id))
330328
elif res.error is not None:
331329
print("[Batch get] Something went wrong: {}".format(res.error))
332330
# [developer-docs.sdk.python.batch-get-items]-end

src/onepassword/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class InnerClient:
2323
core: DesktopCore | UniffiCore
2424
config: dict[str, Any]
2525

26-
def __init__(self, client_id: int, core: "DesktopCore | UniffiCore", config: dict[str, any]):
26+
def __init__(
27+
self, client_id: int, core: "DesktopCore | UniffiCore", config: dict[str, any]
28+
):
2729
self.client_id = client_id
2830
self.core = core
2931
self.config = config

src/onepassword/defaults.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DEFAULT_REQUEST_LIBRARY_VERSION = "0.11.24"
1010
DEFAULT_OS_VERSION = "0.0.0"
1111

12+
1213
class DesktopAuth:
1314
def __init__(self, account_name: str):
1415
"""
@@ -19,6 +20,7 @@ def __init__(self, account_name: str):
1920
"""
2021
self.account_name = account_name
2122

23+
2224
# Generates a configuration dictionary with the user's parameters
2325
def new_default_config(auth: DesktopAuth | str, integration_name, integration_version):
2426
client_config_dict = {

src/onepassword/desktop_core.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@ def find_1password_lib_path():
1616
if os_name == "Darwin": # macOS
1717
locations = [
1818
"/Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib",
19-
str(Path.home() / "Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib"),
19+
str(
20+
Path.home()
21+
/ "Applications/1Password.app/Contents/Frameworks/libop_sdk_ipc_client.dylib"
22+
),
2023
]
2124
elif os_name == "Linux":
2225
locations = [
2326
"/usr/bin/1password/libop_sdk_ipc_client.so",
24-
"/opt/1Password/libop_sdk_ipc_client.so",
25-
"/snap/bin/1password/libop_sdk_ipc_client.so",
27+
"/opt/1Password/libop_sdk_ipc_client.so",
28+
"/snap/bin/1password/libop_sdk_ipc_client.so",
2629
]
2730
elif os_name == "Windows":
2831
locations = [
2932
str(Path.home() / r"AppData\Local\1Password\op_sdk_ipc_client.dll"),
3033
r"C:\Program Files\1Password\app\8\op_sdk_ipc_client.dll",
31-
r"C:\Program Files (x86)\1Password\app\8\op_sdk_ipc_client.dll",
34+
r"C:\Program Files (x86)\1Password\app\8\op_sdk_ipc_client.dll",
3235
str(Path.home() / r"AppData\Local\1Password\app\8\op_sdk_ipc_client.dll"),
3336
]
3437
else:
@@ -40,6 +43,7 @@ def find_1password_lib_path():
4043

4144
raise FileNotFoundError("1Password desktop application not found")
4245

46+
4347
class DesktopCore:
4448
def __init__(self, account_name: str):
4549
# Determine the path to the desktop app.
@@ -51,11 +55,11 @@ def __init__(self, account_name: str):
5155
# Bind the Rust-exported functions
5256
self.send_message = self.lib.op_sdk_ipc_send_message
5357
self.send_message.argtypes = [
54-
POINTER(c_uint8), # msg_ptr
55-
c_size_t, # msg_len
56-
POINTER(POINTER(c_uint8)), # out_buf
57-
POINTER(c_size_t), # out_len
58-
POINTER(c_size_t), # out_cap
58+
POINTER(c_uint8), # msg_ptr
59+
c_size_t, # msg_len
60+
POINTER(POINTER(c_uint8)), # out_buf
61+
POINTER(c_size_t), # out_len
62+
POINTER(c_size_t), # out_cap
5963
]
6064
self.send_message.restype = c_int32
6165

@@ -123,6 +127,7 @@ def release_client(self, client_id: int):
123127
except Exception as e:
124128
print(f"failed to release client: {e}")
125129

130+
126131
ERR_CHANNEL_CLOSED = (
127132
"desktop app connection channel is closed. "
128133
"Make sure Settings > Developer > Integrate with other apps is enabled, "

src/onepassword/lib/aarch64/libop_uniffi_core.dylib

100755100644
4.69 MB
Binary file not shown.
17.8 MB
Binary file not shown.
19 MB
Binary file not shown.

0 commit comments

Comments
 (0)