-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
feat(platform): Ability to reveal value of secret #825
base: develop
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can manage the revealed state in a useState
instead of useAtom
. You can make the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, i belive that you would need somthing like a Map<Secret['slug'], boolean> type to store the state of revealing.
@@ -155,24 +166,59 @@ export default function SecretCard({ | |||
{value.environment.name} | |||
</TableCell> | |||
<TableCell className="h-full text-base"> | |||
{isDecrypted | |||
{isDecrypted && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

If this slider is not turned on, then everything will come as encrypted and isDecrypted=false
would be sent to the backend. We then would like to show the eye icons. Also, when we "reveal" a secret using this eye icon, we would like to decrypt it on the frontend. There are 3 cases for this:
- the project stores the private key in db: you can check if
storePrivateKey
ofselectedProject
is set to true. If yes, you can useselectedProject.privateKey
to decrypt the secret - the project stores the key in browser: if
selectedProject.storePrivateKey
is false, and you can find the key in the store (localstore.get('project_name_pk')), then you can decrypt using this private key - the key isnt stored: if none of the above cases are satisfied, you would need to show the "can not decrypt" tooltip
Copy the decrypt.ts
file from apps/cli
into apps/platform/src/lib
to perform the decryption operations
User description
Description
Previously
decryptValue=true
automatically decrypted the values if the private key is present, but now to reveal a secret must use reveal icon to see the secret valueFixes #773
Screenshots of relevant screens
Add screenshots of relevant screens
Developer's checklist
If changes are made in the code:
PR Type
Enhancement
Description
Added functionality to reveal or hide secret values conditionally.
Integrated new icons (
EyeOpen
,EyeSlash
,InfoSVG
) for UI enhancements.Updated tooltip component to include an arrow for better UX.
Introduced a new atom state (
revealSecretOpenAtom
) for managing secret reveal state.Changes walkthrough 📝
index.ts
Added new SVG icons for secret reveal functionality
apps/platform/public/svg/shared/index.ts
EyeOpen
,EyeSlash
, andInfoSVG
.index.tsx
Enhanced secret card component with reveal functionality
apps/platform/src/components/dashboard/secret/secretCard/index.tsx
tooltip.tsx
Enhanced tooltip component with arrow support
apps/platform/src/components/ui/tooltip.tsx
TooltipArrow
component for improved tooltip design.index.ts
Added new atom for secret reveal state management
apps/platform/src/store/index.ts
revealSecretOpenAtom
to manage the state of secret revealfunctionality.