Skip to content

Fix: TIPCommon - Refactor extract_script_param to correct vault settings usage#528

Open
adarshtwy wants to merge 9 commits intomainfrom
vault_settings_extraction
Open

Fix: TIPCommon - Refactor extract_script_param to correct vault settings usage#528
adarshtwy wants to merge 9 commits intomainfrom
vault_settings_extraction

Conversation

@adarshtwy
Copy link

@adarshtwy adarshtwy commented Feb 5, 2026

This PR refactors the extract_script_param function in TIPCommon/extraction.py to improve code quality, maintainability, and robustness when handling vault settings.

Changes

Refactored Vault Settings Extraction

  • Extracted vault settings retrieval logic into a dedicated helper function _get_vault_settings() that:
  • Tries siemplify.context.vault_settings first
  • Falls back to siemplify.vault_settings if context is not available
  • Returns None gracefully if neither is present
  • Created _extract_param_value() helper function that:
  • Handles vault parameter extraction when vault settings are available
  • Returns the raw parameter value when vault settings are not configured
  • Provides a clean separation of concerns

This change ensures that vault configurations are reliably integrated into the parameter extraction process.

@adarshtwy adarshtwy requested a review from a team as a code owner February 5, 2026 15:59
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @adarshtwy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the parameter extraction logic to ensure that vault settings are consistently and correctly applied. By explicitly passing the vault configuration during parameter retrieval, the change enhances the reliability and security of how sensitive parameters are handled within the system, preventing potential misconfigurations or data exposure.

Highlights

  • Version Bump: The TIPCommon package version has been updated from 2.3.0 to 2.3.1 in pyproject.toml.
  • Vault Settings Integration: The extract_script_param function now explicitly passes siemplify.context.vault_settings to SiemplifyVaultUtils.extract_vault_param when retrieving parameter values. This ensures that vault configurations are correctly applied during parameter extraction.
  • Dependency Import: The SiemplifyVaultUtils module has been imported into extraction.py to support the new vault parameter extraction logic.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/tipcommon/TIPCommon/pyproject.toml
    • Updated package version from 2.3.0 to 2.3.1.
  • packages/tipcommon/TIPCommon/src/TIPCommon/extraction.py
    • Added import for SiemplifyVaultUtils.
    • Modified extract_script_param to use SiemplifyVaultUtils.extract_vault_param with siemplify.context.vault_settings for parameter retrieval.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly refactors extract_script_param to use SiemplifyVaultUtils.extract_vault_param, ensuring that vault settings are properly used to resolve secrets. This is a good improvement for reliability.

However, my review has identified a significant security concern. The change inadvertently increases the risk of logging sensitive information. When a vault parameter is resolved, its actual secret value is now passed to a logging statement later in the function if print_value is enabled. This violates the repository's style guide on secret sanitization. I have added a high-severity comment with details on the issue and a recommendation for a fix.

Please address the security comment to prevent potential secret leakage.

Comment on lines +62 to +65
value = SiemplifyVaultUtils.extract_vault_param(
input_dictionary.get(param_name),
siemplify.context.vault_settings
)
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

This change correctly uses extract_vault_param to resolve vault secrets. However, it introduces a significant security risk. Later in this function (line 77), if print_value is True, the resolved secret value will be logged. This could lead to sensitive data exposure.

To mitigate this, I recommend modifying the logging logic on line 77 to avoid printing the resolved secret. For example, you could check if the value was modified by extract_vault_param and if so, print a placeholder like <SECRET> instead of the actual value.

Since the logging logic is outside the changed lines of this pull request, I cannot provide a direct code suggestion, but addressing this is important for security.

References
  1. The style guide (lines 23-24, 60) strictly prohibits logging secrets, API keys, tokens, or any Personally Identifiable Information (PII). The current change could cause resolved secrets to be logged. (link)

@adarshtwy adarshtwy changed the title Fix: Refactor extract_script_param to correct vault settings usage Fix: TIPCommon - Refactor extract_script_param to correct vault settings usage Feb 9, 2026
Copy link
Member

@TalShafir1 TalShafir1 left a comment

Choose a reason for hiding this comment

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

Please add the correlating integrations_testing package whl

Copy link
Contributor

@KrishnaSharma06 KrishnaSharma06 left a comment

Choose a reason for hiding this comment

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

Please close this PR.

@github-actions github-actions bot added the Stale label Mar 11, 2026
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.

3 participants