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

Update core to version 48363fb1 #126

Merged
merged 7 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
20 changes: 18 additions & 2 deletions example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ async def main():
ItemSection(id="", title=""),
ItemSection(id="totpsection", title=""),
],
tags=["test tag 1", "test tag 2"]
tags=["test tag 1", "test tag 2"],
websites=[
Website(
label="my custom website",
url="https://example.com",
autofill_behavior="AnywhereOnWebsite"
)
],
)
created_item = await client.items.create(to_create)
# [developer-docs.sdk.python.create-item]-end
Expand All @@ -78,7 +85,9 @@ async def main():

# [developer-docs.sdk.python.resolve-totp-code]-start
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
code = await client.secrets.resolve(f"op://{created_item.vault_id}/{created_item.id}/TOTP_onetimepassword?attribute=totp")
code = await client.secrets.resolve(
f"op://{created_item.vault_id}/{created_item.id}/TOTP_onetimepassword?attribute=totp"
)
print(code)
# [developer-docs.sdk.python.resolve-totp-code]-end

Expand All @@ -102,6 +111,13 @@ async def main():
# [developer-docs.sdk.python.update-item]-start
# Update a field in your item
item.fields[0].value = "new_value"
item.websites.append(
Website(
label="my custom website 2",
url="https://example2.com",
autofill_behavior="Never"
),
)
updated_item = await client.items.put(item)
# [developer-docs.sdk.python.update-item]-end

Expand Down
2 changes: 1 addition & 1 deletion src/onepassword/defaults.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import platform

SDK_LANGUAGE = "Python"
SDK_VERSION = "0010200"
SDK_VERSION = "0010301"
DEFAULT_INTEGRATION_NAME = "Unknown"
DEFAULT_INTEGRATION_VERSION = "Unknown"
DEFAULT_REQUEST_LIBRARY = "reqwest"
Expand Down
Binary file modified src/onepassword/lib/aarch64/libop_uniffi_core.dylib
Binary file not shown.
Binary file modified src/onepassword/lib/aarch64/libop_uniffi_core.so
Binary file not shown.
Binary file modified src/onepassword/lib/x86_64/libop_uniffi_core.dylib
Binary file not shown.
Binary file modified src/onepassword/lib/x86_64/libop_uniffi_core.so
Binary file not shown.
Binary file modified src/onepassword/lib/x86_64/op_uniffi_core.dll
Binary file not shown.
32 changes: 32 additions & 0 deletions src/onepassword/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ class ItemSection(BaseModel):
"""


AutofillBehavior = Literal["AnywhereOnWebsite", "ExactDomain", "Never"]


class Website(BaseModel):
url: str
"""
The website URL
"""
label: str
"""
The label of the website, e.g. 'website', 'sign-in address'
"""
autofill_behavior: AutofillBehavior
"""
The auto-fill behavior of the website

For more information, visit https://support.1password.com/autofill-behavior/
"""


class Item(BaseModel):
"""
Represents a 1Password item.
Expand Down Expand Up @@ -134,6 +154,10 @@ class Item(BaseModel):
"""
The item's tags
"""
websites: List[Website]
"""
The websites used for autofilling for items of the Login and Password categories.
"""
version: int
"""
The item's version
Expand Down Expand Up @@ -167,6 +191,10 @@ class ItemCreateParams(BaseModel):
"""
The item's tags
"""
websites: Optional[List[Website]] = None
"""
The websites used for autofilling for items of the Login and Password categories.
"""


class ItemOverview(BaseModel):
Expand All @@ -192,6 +220,10 @@ class ItemOverview(BaseModel):
"""
The ID of the vault where the item is saved
"""
websites: List[Website]
"""
The websites used for autofilling for items of the Login and Password categories.
"""


class OtpFieldDetails(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# TODO: Refactor so SDK_BUILD_NUMBER can be inside and not hardcoded in defaults.py
SDK_VERSION = "0.1.2"
SDK_VERSION = "0.1.3"
Loading