-
Notifications
You must be signed in to change notification settings - Fork 0
Update syntax for argument to unlock
#14
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ef8e9f7 to
a8ececb
Compare
iangmaia
reviewed
Dec 11, 2025
| echo "c3VwcG9zZWRseS15b3VyLWJpbmFyeS1zZWNyZXRrZXk=" | base64 -d | git-conceal unlock - | ||
| # Option 1: Provide the Base64-encoded key directly as command line argument. | ||
| # Only use locally, as on CI this could leak the key in logs. | ||
| # Tip: start your command with a space to avoid it (and thus the key) being added to your shell's history |
Contributor
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.
👍
iangmaia
approved these changes
Dec 11, 2025
Contributor
iangmaia
left a comment
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've tested lock / unlock in PCAndroid, with both a file < redirection and the base64 string 👍
Contributor
Author
- Remove the syntax that was allowing to provide the key from a file. - Make the default syntax be for passing the key as base64 directly as argument (without requiring the `base64:` prefix for that case anymore. Rationale: It was never a good idea to provide a built-in way to read the binary key from a file IMHO, because that would suggest that having the key laying around in a random file on disk was a good idea to begin with (which can be OK… as long as the key file is properly protected). For example, we wouldn't want to incite people to write the key in a file just to be able to `git-conceal unlock` with it… and then accidentally commit that key file. Reading from a file is still possible using `-` as the argument to read from `stdin`, then using shell redirection syntax `<file` to feed the content of the file as stdin. So even in the unlikely case that someone would want to provide the key via a file, they can still do that. And since having the base64 key directly will be the most common use case for `unlock` on local machines (when developers get the key from the secret store and copy/paste it to the `unlock` command), that feels more fitting for this to be the default command / most basic syntax (i.e. without requiring a `base64:` prefix for it)
6a782ae to
bf95874
Compare
0d569f0 to
e309a6a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This PR builds on top of #12
What
README.mdabout starting the command with a space to not have the key leak in the user's shell historybase64:…arg forunlock#10 (comment)unlock:base64:prefix (introduced in Add support forbase64:…arg forunlock#10) is no longer needed to provide the base64-encoded key duringunlock <base64key>, which makes more sense since that's the use case that local developers will use the most (copying the Base64-encoded key from the Secret Store to unlock their local working copy with it)unlockargument. Reading from a file is still possible via<shell redirection anyway.Testing
cargo build --releasefrom this PR's head branch, and add<thisrepo>/target/release/to your$PATHgit-concealin this repo woocommerce/woocommerce-android#14979 or [AINFRA-1539] [Internal] Migrate fromconfigure_applytogit-concealpocket-casts-android#4841, so you have a repo on which to test that command ongit-concealin the Secret Store and copy the base64 decryption key in the clipboard