Skip to content

feat: Preview secrets#2

Merged
mikaeld merged 3 commits intomainfrom
feat/view-secrets
May 2, 2025
Merged

feat: Preview secrets#2
mikaeld merged 3 commits intomainfrom
feat/view-secrets

Conversation

@mikaeld
Copy link
Owner

@mikaeld mikaeld commented May 2, 2025

Description

Add ability to preview secrets by pression p. Secrets preview sanitizes all values.

image

image

@mikaeld mikaeld requested a review from Copilot May 2, 2025 17:55
@mikaeld mikaeld self-assigned this May 2, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a "Preview secrets" feature that allows users to preview secret values while ensuring these values are sanitized.

  • Updated get_secret_version_value API to accept a secret identifier string.
  • Added a new helper function, sanitize_secrets, to mask sensitive secret values.
  • Refactored secret loading and preview actions in the main application UI.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
tests/test_utils/test_gcp.py Updated test to pass a secret identifier string instead of an object.
secrets_manager/utils/helpers.py Added the sanitize_secrets function for masking secret values.
secrets_manager/utils/gcp.py Modified get_secret_version_value to accept a secret identifier.
app.py Refactored secret loading, listing, and preview modal integration.
Files not reviewed (1)
  • secrets_manager.tcss: Language not supported

return None
if isinstance(value, bool):
return value
if isinstance(value, int | float):
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

Using 'int | float' in isinstance() might cause unexpected behavior. Consider changing this to 'if isinstance(value, (int, float)):' to ensure proper type checking.

Suggested change
if isinstance(value, int | float):
if isinstance(value, (int, float)):

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

@mikaeld mikaeld May 2, 2025

Choose a reason for hiding this comment

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

wrong

@mikaeld
Copy link
Owner Author

mikaeld commented May 2, 2025

image

@mikaeld mikaeld merged commit 0869f03 into main May 2, 2025
2 checks passed
@mikaeld mikaeld deleted the feat/view-secrets branch May 2, 2025 17:57
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