Skip to content

Commit d84fc5b

Browse files
authored
Merge pull request #213 from 1Password/lucy/readme-2-19
Update README to reflect latest release
2 parents 88fd880 + 708e6ec commit d84fc5b

1 file changed

Lines changed: 80 additions & 15 deletions

File tree

README.md

Lines changed: 80 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</p>
66

77
<p align="center">
8-
<h4 align="center">Build integrations that programmatically access your secrets in 1Password.</h4>
8+
<h4 align="center">Build integrations that programmatically interact with 1Password.</h4>
99
</p>
1010

1111
<p align="center">
@@ -26,7 +26,55 @@ If you're running a Linux distribution that still uses `libssl` version 1.1.1, s
2626

2727
## 🚀 Get started
2828

29-
To use the 1Password Python SDK in your project:
29+
You can choose between two [authentication methods](https://developer.1password.com/docs/sdks/concepts#authentication) for the 1Password Python SDK: local authorization prompts from the [1Password desktop app](#option-1-1password-desktop-app) or automated authentication with a [1Password Service Account](#option-2-1password-service-account).
30+
31+
### Option 1: 1Password desktop app
32+
33+
[1Password desktop app authentication](https://developer.1password.com/docs/sdks/concepts#1password-desktop-app) is best for local integrations that require minimal setup from end users and sensitive workflows that require human-in-the-loop approval. To set up the SDK to authenticate with the 1Password app:
34+
35+
1. Install the [1Password desktop app](https://1password.com/downloads/) and sign in to your account in the app.
36+
2. Select your account or collection at the top of the sidebar, then navigate to **Settings** > **Developer**.
37+
3. Under Integrate with the 1Password SDKs, select **Integrate with other apps**.
38+
4. If you want to authenticate with biometrics, navigate to **Settings** > **Security**, then turn on the option to unlock using [Touch ID](https://support.1password.com/touch-id-mac/), [Windows Hello](https://support.1password.com/windows-hello/), or [system authentication](https://support.1password.com/system-authentication-linux/).
39+
5. Install the 1Password Python SDK in your project:
40+
41+
```bash
42+
pip install onepassword-sdk
43+
```
44+
45+
6. To use the Python SDK in your project, replace `your-account-name` in the code below with the name of your 1Password account as it appears at the top left sidebar of the 1Password desktop app.
46+
47+
```python
48+
import asyncio
49+
import os
50+
from onepassword.client import Client, DesktopAuth
51+
52+
async def main():
53+
# Connects to 1Password. Fill in your own integration name and version.
54+
client = await Client.authenticate(
55+
auth=DesktopAuth(
56+
# TODO: Set to your 1Password account name.
57+
account_name="your-account-name"
58+
),
59+
# TODO: Set to your own integration name and version.
60+
integration_name="My 1Password Integration",
61+
integration_version="v1.0.0",
62+
)
63+
64+
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
65+
value = await client.secrets.resolve("op://vault/item/field")
66+
# use value here
67+
68+
if __name__ == '__main__':
69+
asyncio.run(main())
70+
71+
```
72+
73+
Make sure to use [secret reference URIs](https://developer.1password.com/docs/cli/secret-reference-syntax/) with the syntax `op://vault/item/field` to securely load secrets from 1Password into your code.
74+
75+
### Option 2: 1Password Service Account
76+
77+
[Service account authentication](https://developer.1password.com/docs/sdks/concepts/#1password-service-account) is best for automated access and limiting your integration to least privilege access. To set up the SDK to authenticate with a service account token:
3078

3179
1. [Create a service account](https://my.1password.com/developer-tools/infrastructure-secrets/serviceaccount/?source=github-sdk) and give it the appropriate permissions in the vaults where the items you want to use with the SDK are saved.
3280
2. Provision your service account token. We recommend provisioning your token from the environment. For example, to export your token to the `OP_SERVICE_ACCOUNT_TOKEN` environment variable:
@@ -80,7 +128,7 @@ Make sure to use [secret reference URIs](https://developer.1password.com/docs/cl
80128

81129
### Item management
82130

83-
Operations:
131+
**Operations:**
84132

85133
- [x] [Retrieve secrets](https://developer.1password.com/docs/sdks/load-secrets)
86134
- [x] [Retrieve items](https://developer.1password.com/docs/sdks/manage-items#get-an-item)
@@ -92,7 +140,8 @@ Operations:
92140
- [x] [Share items](https://developer.1password.com/docs/sdks/share-items)
93141
- [x] [Generate PIN, random and memorable passwords](https://developer.1password.com/docs/sdks/manage-items#generate-a-password)
94142

95-
Field types:
143+
**Field types:**
144+
96145
- [x] API Keys
97146
- [x] Passwords
98147
- [x] Concealed fields
@@ -115,35 +164,51 @@ Field types:
115164
- [ ] Passkeys
116165

117166
### Vault management
118-
- [ ] Retrieve vaults
119-
- [ ] Create vaults ([#36](https://github.com/1Password/onepassword-sdk-python/issues/36))
120-
- [ ] Update vaults
121-
- [ ] Delete vaults
122-
- [x] [List vaults](https://developer.1password.com/docs/sdks/list-vaults-items/)
167+
168+
- [x] [Retrieve vaults](https://developer.1password.com/docs/sdks/vaults#get-a-vault-overview)
169+
- [x] [Create vaults](https://developer.1password.com/docs/sdks/vaults#create-a-vault)
170+
- [x] [Update vaults](https://developer.1password.com/docs/sdks/vaults#update-a-vault)
171+
- [x] [Delete vaults](https://developer.1password.com/docs/sdks/vaults#delete-a-vault)
172+
- [x] [List vaults](https://developer.1password.com/docs/sdks/list-vaults-items#list-vaults)
173+
- [x] [Manage group vault permissions](https://developer.1password.com/docs/sdks/vault-permissions)
174+
- [ ] Manage user vault permissions
123175

124176
### User & access management
177+
125178
- [ ] Provision users
126179
- [ ] Retrieve users
127180
- [ ] List users
128181
- [ ] Suspend users
182+
- [x] [Retrieve groups](https://developer.1password.com/docs/sdks/groups/)
183+
- [ ] List groups
129184
- [ ] Create groups
130185
- [ ] Update group membership
131-
- [ ] Update vault access & permissions
186+
187+
## Environments management
188+
189+
- [x] [Read 1Password Environments](https://developer.1password.com/docs/sdks/environments) (beta)
132190

133191
### Compliance & reporting
192+
134193
- [ ] Watchtower insights
135194
- [ ] Travel mode
136195
- [ ] Events. For now, use [1Password Events Reporting API](https://developer.1password.com/docs/events-api/) directly.
137196

138197
### Authentication
139198

140-
- [x] [1Password Service Accounts](https://developer.1password.com/docs/service-accounts/get-started/)
141-
- [ ] User authentication
199+
- [x] [1Password Service Accounts](https://developer.1password.com/docs/sdks/concepts#1password-service-account)
200+
- [x] [User authentication](https://developer.1password.com/docs/sdks/concepts#1password-desktop-app)
142201
- [ ] 1Password Connect. For now, use [1Password/connect-sdk-python](https://github.com/1Password/connect-sdk-python).
143202

144203
## 📖 Learn more
145204

146-
- [Load secrets with 1Password SDKs](https://developer.1password.com/docs/sdks/load-secrets)
147-
- [Manage items with 1Password SDKs](https://developer.1password.com/docs/sdks/manage-items)
148-
- [List vaults and items with 1Password SDKs](https://developer.1password.com/docs/sdks/list-vaults-items)
205+
- [Load secrets](https://developer.1password.com/docs/sdks/load-secrets)
206+
- [Read 1Password Environments (beta)](https://developer.1password.com/docs/sdks/environments)
207+
- [Manage items](https://developer.1password.com/docs/sdks/manage-items)
208+
- [Manage files](https://developer.1password.com/docs/sdks/files)
209+
- [Share items](https://developer.1password.com/docs/sdks/share-items)
210+
- [List vaults and items](https://developer.1password.com/docs/sdks/list-vaults-items)
211+
- [Manage vaults](https://developer.1password.com/docs/sdks/vaults)
212+
- [Manage vault permissions](https://developer.1password.com/docs/sdks/vault-permissions)
213+
- [Manage groups](https://developer.1password.com/docs/sdks/groups)
149214
- [1Password SDK concepts](https://developer.1password.com/docs/sdks/concepts)

0 commit comments

Comments
 (0)