-
Notifications
You must be signed in to change notification settings - Fork 20
CI Pipeline Runs example/example.py #151
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
Merged
+88
−22
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2a741f6
Added example README. Edited example.py to resolve secret reference w…
moward98 4f142ab
Fixed yaml syntax error in validate.yml
moward98 a56053b
added installation of current directory before running example/exampl…
moward98 1433c45
Enforcing only one matrix combination runs at a time to avoid 409 Err…
moward98 03e4e6e
Edited README to better reflect what is actually happening in the exa…
moward98 5b39ca9
removed successful strings being printed by pipeline.
moward98 17f2110
fixed typo in readme
moward98 bd4355e
Updated to only run example file on ubuntu OS instead of all OS
moward98 2c82e55
Merge branch 'main' into morgan/150/example-test
moward98 154b71d
Updated example/README.md to capture example changes after latest rel…
moward98 df7cc3e
added requirements file to install packages that the example code req…
moward98 beb6293
Removed hardcoded instances of vault_id and replaced with vault_id va…
moward98 50b1b84
Merge branch 'main' into morgan/150/example-test
moward98 98a4ed6
removed max-parallel
moward98 c5f892c
Both instances of Example Test only run on ubuntu-latest
moward98 9a95f61
remove requrieement.txt and add python 3.13 and install right into th…
MOmarMiraj ac3b0f4
Merge remote-tracking branch 'origin' into morgan/150/example-test
MOmarMiraj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Examples | ||
| This folder contains a code snippet demonstrating how to use the 1Password Python SDK for performing various operations on 1Password vaults and items. Specifically, the example showcases how to: | ||
|
|
||
| - Authenticate with the 1Password API using a service account token. | ||
| - List available vaults and items within those vaults. | ||
| - Retrieve a specific secret and resolve a one-time password (TOTP). | ||
| - Create a new item in a vault with multiple fields and tags. | ||
| - Update an existing item by modifying its fields and adding a new website. | ||
| - Generate different types of passwords (PIN, memorable, and random). | ||
| - Share an item with valid recipients and create a shareable link. | ||
| - Archive or delete items from the vault. | ||
| - Create and manage SSH key items. | ||
| - Create and manage document items, including replacing and reading documents. | ||
| - Create and manage file field items by attaching and deleting files. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. Clone the repository and follow the steps to [get started](https://github.com/1Password/onepassword-sdk-python/blob/main/README.md). | ||
| 2. Ensure that you have a valid service account token by exporting it as an environment variable: | ||
| ```bash | ||
| export OP_SERVICE_ACCOUNT_TOKEN="<your token>" | ||
| ``` | ||
| 3. Export the vault UUID you wish to interact with as an environment variable: | ||
| ```bash | ||
| export OP_VAULT_ID="<your vault uuid>" | ||
| ``` | ||
|
|
||
| ## How to Run | ||
|
|
||
| To run the example file, navigate to project root directory and run: | ||
| ```bash | ||
| python example/example.py | ||
| ``` | ||
|
|
||
| ## Terminal Output | ||
|
|
||
| When running the example, the terminal will display: | ||
|
|
||
| - A list of vaults and items. | ||
| - Retrieved secrets and TOTP codes. | ||
| - Details of newly created and updated items. | ||
| - Generated passwords (PIN, memorable, random). | ||
| - A shareable link for shared items. | ||
| - SSH key attributes like public key and fingerprint. | ||
| - Document content after replacing the file. | ||
| - A list of file field items and file deletions. | ||
|
|
||
| These outputs show the results of vault and item operations, password generation, item sharing, and management of SSH and document items. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.