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

introduce pyotp and support generating totp within skyvern #1176

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Nov 12, 2024

Important

Introduce pyotp for TOTP generation, replacing Bitwarden CLI TOTP retrieval in Skyvern.

  • Behavior:
    • Introduce pyotp library in pyproject.toml for TOTP generation.
    • Replace Bitwarden CLI TOTP retrieval with pyotp.TOTP in handler.py.
  • Code Changes:
    • Remove BitwardenTOTPError and related TOTP command logic in bitwarden.py.
    • Add totp_secret_value_key() in context_manager.py to manage TOTP secret keys.
    • Update get_actual_value_of_parameter_if_secret() in handler.py to use pyotp for TOTP generation.
  • Misc:
    • Minor refactoring and cleanup in bitwarden.py and context_manager.py.

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

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 1d0997f in 58 seconds

More details
  • Looked at 114 lines of code in 4 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/webeye/actions/handler.py:1085
  • Draft comment:
    The logic here seems incorrect. secret_value is being compared to BitwardenConstants.TOTP, which is a constant string, not a secret ID. This will always evaluate to False unless the secret ID is exactly the string BW_TOTP. The logic should be checking if parameter is a TOTP secret ID instead.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_ZjxuaSfRsBNDeNE0


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! Incremental review on 2474aa2 in 17 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/webeye/actions/handler.py:1086
  • Draft comment:
    Ensure that totp_secret_value_key(parameter) is correct and consistent with the intended logic for TOTP generation. The change from secret_value to parameter seems correct based on the context, but verify the logic for correctness.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The change from secret_value to parameter in the totp_secret_value_key function call is correct based on the context provided. However, the logic for handling TOTP generation should be verified for correctness.

Workflow ID: wflow_DXbXpmPOn1yc7vTp


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

@wintonzheng wintonzheng merged commit efdf4b5 into main Nov 12, 2024
2 checks passed
@wintonzheng wintonzheng deleted the shu/loca_totp_generation branch November 12, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant