Skip to content
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

Update Bitwarden code to use env instead of secret manager if env is present #1592

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Jan 17, 2025

Important

Update Bitwarden credential retrieval to prioritize environment variables over AWS secrets in context_manager.py.

  • Behavior:
    • Update register_parameter_value in context_manager.py to use Bitwarden credentials from environment variables if available, otherwise fallback to AWS secrets.
  • Configuration:
    • Add BITWARDEN_CLIENT_ID, BITWARDEN_CLIENT_SECRET, and BITWARDEN_MASTER_PASSWORD to Settings in config.py.

This description was created by Ellipsis for 4f9c64a. It will automatically update as commits are pushed.

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Update Bitwarden integration to prioritize environment variables over AWS Secrets for credentials in `bitwarden_helper.py` and `context_manager.py`.
>
>   - **Behavior**:
>     - Update `generate_session_key()` in `bitwarden_helper.py` to use environment variables for Bitwarden credentials if available, otherwise fallback to AWS Secrets.
>     - Modify `register_parameter_value()` in `context_manager.py` to prioritize environment variables for Bitwarden credentials over AWS Secrets.
>   - **Configuration**:
>     - Add `BITWARDEN_CLIENT_ID`, `BITWARDEN_CLIENT_SECRET`, and `BITWARDEN_MASTER_PASSWORD` to `Settings` in `config.py`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for dc4c3c63a68c08dcac8fef3b01b6f0cbe7c6c2c1. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 4f9c64a in 11 seconds

More details
  • Looked at 93 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/context_manager.py:159
  • Draft comment:
    The code for fetching Bitwarden credentials is repeated multiple times. Consider refactoring this into a helper function to improve maintainability and reduce redundancy. This applies to lines 234 and 292 as well.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The current implementation of fetching Bitwarden credentials prioritizes environment variables over AWS secrets, which is correct as per the PR description. However, the repeated code for fetching credentials can be refactored to improve maintainability and reduce redundancy.

Workflow ID: wflow_U7dsFUqpmeO5t1OJ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 4f9c64a in 22 seconds

More details
  • Looked at 93 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/sdk/workflow/context_manager.py:162
  • Draft comment:
    The logic to fetch Bitwarden credentials is repeated multiple times. Consider refactoring this into a helper function to adhere to the DRY principle. This applies to lines 162-170, 237-245, and 295-303.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_KzJnSfUUnXdt9ec9


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@suchintan suchintan merged commit 7427180 into main Jan 17, 2025
7 checks passed
@suchintan suchintan deleted the suchintan.update-bitwarden-code-to-use-env branch January 17, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants