Skip to content

Commit 0e75965

Browse files
MOmarMiraj1PasswordSDKBothculea
authored
Release 0.1.5 (#135)
* Update core to version 8c6e711a * Release v0.1.5 * add release notes and password example * pretty format release notes * Update example and release notes * update readme * fix setup.py missing comma --------- Co-authored-by: 1PasswordSDKBot <it-github-sdk-bot@agilebits.com> Co-authored-by: Horia Culea <horia.culea@agilebits.com>
1 parent 1256a90 commit 0e75965

13 files changed

Lines changed: 170 additions & 6 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Operations:
8989
- [x] [Delete items](https://developer.1password.com/docs/sdks/manage-items#delete-an-item)
9090
- [x] [List items](https://developer.1password.com/docs/sdks/list-vaults-items/)
9191
- [x] Add & update tags on items
92+
- [x] Generate PIN, random and memorable passwords
9293

9394
Field types:
9495
- [x] API Keys
@@ -103,6 +104,7 @@ Field types:
103104
- [x] Websites (used to suggest and autofill logins)
104105
- [x] Phone numbers
105106
- [x] Credit card types
107+
- [x] Credit card numbers
106108
- [ ] Files attachments and Document items
107109

108110
### Vault management

example/example.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,41 @@ async def main():
130130
# [developer-docs.sdk.python.update-item]-end
131131

132132
print(dict(updated_item))
133+
134+
# [developer-docs.sdk.python.generate-pin-password]-start
135+
pin_password = Secrets.generate_password(
136+
PasswordRecipePin(parameters=PasswordRecipePinInner(length=8))
137+
)
138+
print(pin_password)
139+
# [developer-docs.sdk.python.generate-pin-password]-end
140+
141+
# [developer-docs.sdk.python.generate-memorable-password]-start
142+
memorable_password = Secrets.generate_password(
143+
PasswordRecipeMemorable(
144+
parameters=PasswordRecipeMemorableInner(
145+
separatorType=SeparatorType.UNDERSCORES,
146+
wordListType=WordListType.SYLLABLES,
147+
capitalize=False,
148+
wordCount=3,
149+
)
150+
),
151+
)
152+
print(memorable_password)
153+
# [developer-docs.sdk.python.generate-memorable-password]-end
154+
155+
# [developer-docs.sdk.python.generate-random-password]-start
156+
random_password = Secrets.generate_password(
157+
PasswordRecipeRandom(
158+
parameters=PasswordRecipeRandomInner(
159+
length=10,
160+
includeDigits=False,
161+
includeSymbols=False,
162+
)
163+
),
164+
)
165+
print(random_password)
166+
# [developer-docs.sdk.python.generate-random-password]-end
167+
133168
# [developer-docs.sdk.python.delete-item]-start
134169
# Delete a item from your vault.
135170
await client.items.delete(created_item.vault_id, updated_item.id)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def get_shared_library_data_to_include():
6969
"Programming Language :: Python :: 3.10",
7070
"Programming Language :: Python :: 3.11",
7171
"Programming Language :: Python :: 3.12",
72-
"Programming Language :: Python :: 3.13"
72+
"Programming Language :: Python :: 3.13",
7373
"License :: OSI Approved :: MIT License",
7474
],
7575
cmdclass={"bdist_wheel": bdist_wheel},

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 = "0010401"
1+
SDK_BUILD_NUMBER = "0010501"
1.56 MB
Binary file not shown.
1.6 MB
Binary file not shown.
1.54 MB
Binary file not shown.
1.63 MB
Binary file not shown.
1.4 MB
Binary file not shown.

src/onepassword/secrets.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from .core import _invoke, _invoke_sync
44
from json import loads
55
from .iterator import SDKIterator
6+
from .types import GeneratePasswordResponse
67

78

89
class Secrets:
@@ -46,3 +47,17 @@ def validate_secret_reference(secret_reference):
4647
}
4748
}
4849
)
50+
51+
@staticmethod
52+
def generate_password(recipe):
53+
response = _invoke_sync(
54+
{
55+
"invocation": {
56+
"parameters": {
57+
"name": "GeneratePassword",
58+
"parameters": {"recipe": recipe.model_dump(by_alias=True)},
59+
}
60+
}
61+
}
62+
)
63+
return GeneratePasswordResponse.model_validate_json(response)

0 commit comments

Comments
 (0)