Extract shared OnePasswordClient into fides.common.onepassword#7698
Draft
Extract shared OnePasswordClient into fides.common.onepassword#7698
Conversation
Move the duplicated 1Password SDK integration from test helpers into a shared, instance-based client class. Each consumer (SaaS test secrets, seed profile resolution) can instantiate its own client with different tokens and vault IDs. The existing test helper module-level API is preserved as thin wrappers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description Of Changes
Extract the duplicated 1Password SDK integration from test helpers into a shared, instance-based
OnePasswordClientclass infides.common.onepassword. This enables multiple consumers (SaaS test secrets, seed profile resolution in fidesplus) to each instantiate their own client with different service account tokens and vault IDs.The existing test helper module-level API (
get_secrets,get_item_by_title,list_available_items) is preserved as thin wrappers so no callers need to change.Code Changes
src/fides/common/onepassword/__init__.py- New package, exportsOnePasswordClientsrc/fides/common/onepassword/client.py- New instance-based client with lazy init,get_item(),get_secrets(),get_item_notes(),get_item_notes_json(),list_items(), plus sync wrapperstests/ops/test_helpers/onepassword_client.py- Refactored to thin wrappers aroundOnePasswordClientSteps to Confirm
from fides.common.onepassword import OnePasswordClientimports cleanlyonepassword_client.get_secrets()still work (the module-level API is preserved)OnePasswordClientcan be instantiated with different tokens/vault IDs for independent consumersPre-Merge Checklist
CHANGELOG.mdupdated🤖 Generated with Claude Code