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

Shows the secret information for a brief moment before hiding it. #50

Open
olafurw opened this issue Sep 7, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@olafurw
Copy link

olafurw commented Sep 7, 2024

When I open my .env file, for a very brief moment the secret is visible.

Making the plugin not usable for it's main purpose.
I'm using Windows 11, WSL 22.04 and I installed the plugin and I'm using the default settings.

(don't worry, there is no actual secret here)

2024-09-07.20-31-10.mp4
@1nVitr0
Copy link
Owner

1nVitr0 commented Sep 8, 2024

To my knowledge there is not much that can be done here. VS Code loads the file and then passes it on to extensions to provide additional syntax support, code actions or in the case of this extension code decorations. As far as I am aware there is nothing that can be done to hide a file's content until the decorations have been loaded in. Aside from making the extension as efficient as possible to minimize the delay.

This was originally intended for streaming, but is more of a coworker protection, so that you don't display your credential to the entire internet cafe.

I will do some research into possible API extension, but I don't expect much changes there. There might be a possibility to get rid of the delay when switching between already open files like in your example above. If I don't get back to you by the end of next week, fell free to annoy me here.

@1nVitr0
Copy link
Owner

1nVitr0 commented Sep 9, 2024

Yeah, there hasn't been any update to the API. Unfortunately VSCode always detaches the decorations when changing editors. Feel free to upvote microsoft/vscode#136241 for a persistent property that can be used by extension authors. Even wih a persistent property, there won't be a fix for the delay when initially opening a file, there will always be a gap between VSCode displaying the text and decorations being applied.

I did spot an error in my code though, that may delay censoring in some cases. Won't be noticable in most cases, but can't hurt to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants