Skip to content

Commit e7acac7

Browse files
Merge pull request #173 from 1Password/sdk-core/2025-06-10-9ee25b14
Release v0.3.1
2 parents 6885d22 + ba5ddd4 commit e7acac7

File tree

11 files changed

+28
-69
lines changed

11 files changed

+28
-69
lines changed

example/example.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def main():
2727
# [developer-docs.sdk.python.list-vaults]-start
2828
vaults = await client.vaults.list()
2929
for vault in vaults:
30-
print(vault.title)
30+
print(vault)
3131
# [developer-docs.sdk.python.list-vaults]-end
3232

3333
# [developer-docs.sdk.python.list-items]-start
@@ -53,7 +53,7 @@ async def main():
5353
print(error)
5454
# [developer-docs.sdk.python.validate-secret-reference]-end
5555

56-
vault_id= os.getenv("OP_VAULT_ID")
56+
vault_id = os.getenv("OP_VAULT_ID")
5757
if vault_id is None:
5858
raise Exception("OP_VAULT_ID environment variable is not set")
5959

@@ -104,7 +104,9 @@ async def main():
104104

105105
# [developer-docs.sdk.python.resolve-secret]-start
106106
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
107-
value = await client.secrets.resolve(f"op://{created_item.vault_id}/{created_item.id}/username")
107+
value = await client.secrets.resolve(
108+
f"op://{created_item.vault_id}/{created_item.id}/username"
109+
)
108110
print(value)
109111
# [developer-docs.sdk.python.resolve-secret]-end
110112

src/onepassword/build_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SDK_BUILD_NUMBER = "0030001"
1+
SDK_BUILD_NUMBER = "0030101"
6.89 KB
Binary file not shown.
1.04 KB
Binary file not shown.
-8.69 KB
Binary file not shown.
10.3 KB
Binary file not shown.
9 KB
Binary file not shown.

src/onepassword/types.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,8 @@ class VaultOverview(BaseModel):
976976
Represents a decrypted 1Password vault.
977977
"""
978978

979+
model_config = ConfigDict(populate_by_name=True)
980+
979981
id: str
980982
"""
981983
The vault's ID
@@ -984,6 +986,22 @@ class VaultOverview(BaseModel):
984986
"""
985987
The vault's title
986988
"""
989+
created_at: Annotated[
990+
datetime,
991+
BeforeValidator(parse_rfc3339),
992+
PlainSerializer(serialize_datetime_data),
993+
] = Field(alias="createdAt")
994+
"""
995+
The time the vault was created at
996+
"""
997+
updated_at: Annotated[
998+
datetime,
999+
BeforeValidator(parse_rfc3339),
1000+
PlainSerializer(serialize_datetime_data),
1001+
] = Field(alias="updatedAt")
1002+
"""
1003+
The time the vault was updated at
1004+
"""
9871005

9881006

9891007
class ItemListFilterByStateInner(BaseModel):

src/release/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Before running this script, the user must make sure that they have the write per
44

55
Run this make command to install all dependencies required for the Python SDK release process.
66
```
7-
release/install-dependencies
7+
make release/install-dependencies
88
```
99

1010
Step 1. Make any changes to the SDK as required on a feature branch or main branch.

src/release/RELEASE-NOTES

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,5 @@
1-
# 1Password Python SDK v0.3.0
1+
# 1Password Python SDK v0.3.1
22

33
## NEW
44

5-
- **Support for item states**: You can now fetch an item's state using the SDK. `ItemOverview` exposes one of two states: `Active` or `Archived`.
6-
- `Active`: An item located inside a vault. (Default)
7-
- `Archived`: An item that has been moved to the Archive. 1Password doesn't include archived items in search results or suggest them when you fill in apps and browsers. You can keep archived items as long as you'd like.
8-
- **Filtering listed items by state**: You can now filter the results of the item list function by item state.
9-
10-
## FIXED
11-
12-
- **Deleting Archived Items:** The SDK now supports deleting items from the archive.
13-
14-
## ⚠️ BREAKING CHANGES ⚠️
15-
This release contains breaking changes for two functions in the Python SDK.
16-
17-
**Vault listing**
18-
19-
* The function name has changed from `list_all` to `list`. To use this in your code, replace:
20-
```python
21-
vaults = await client.vaults.list_all(vault_id)
22-
```
23-
with:
24-
```python
25-
vaults = await client.vaults.list(vault_id)
26-
```
27-
28-
* The return type of the vault listing function has changed from `SDKIterator[VaultOverview]` to `List[VaultOverview]`. To use this in your code, replace:
29-
30-
```python
31-
async for vault in vaults:
32-
# using vault overview
33-
```
34-
with:
35-
```python
36-
for vault in vaults:
37-
# using vault overview
38-
```
39-
**Item listing**
40-
41-
* The function name has changed from `ListAll` to `List`. To use this in your code, replace:
42-
```python
43-
overviews = await client.items.list_all(vault_id)
44-
```
45-
with:
46-
```python
47-
overviews = await client.items.list(vault_id, ItemListFilter(
48-
content=ItemListFilterByStateInner(
49-
active=True,
50-
archived=True,
51-
)
52-
))
53-
```
54-
55-
* The return type of the item listing function has changed from `SDKIterator[ItemOverview]` to `List[ItemOverview]`. To use this in your code, replace:
56-
```python
57-
async for overview in overviews:
58-
# using item overview
59-
```
60-
with:
61-
```python
62-
for overview in overviews:
63-
# using item overview
64-
```
65-
66-
This does not affect any code that's already deployed, and will not take effect in your codebase until you choose to update to version 0.3.0 or later of the 1Password Python SDK.
5+
- `VaultOverview` now includes `created_at` and `updated_at` fields that show when the vault was created and last updated.

0 commit comments

Comments
 (0)