-
Notifications
You must be signed in to change notification settings - Fork 4
Secret Renaming 2nd Parameter Does not Recognize Fully Qualified Paths #393
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
Comments
The reason behind this error is that the This issue would probably be fixed by the implementation of the |
Well it should support this too. It just doesn't work like how mv should work. |
We need
No need for all the options - just the default behaviour is good first. |
It works quite differently:
So you can see that Globbing in the future needs to smartly predict whether we are referring to within-vault globs or outside vault globbing. I remember that this was based on first... always assuming that we are talking about the local filesystem, and then only with explicit Actually confirm if this is true per our original specification for |
Describe the bug
The
polykey secrets rename
command fails when the second argument (<newSecretName>
) is provided as a fully qualified path (e.g.,VaultName:/NewSecretName
). It incorrectly interprets the source path in the underlying operation, leading to anENOENT: no such file or directory
error wrapped withinErrorEncryptedFSError
andErrorPolykeyRemote
. The command succeeds if<newSecretName>
is provided as just the base name (e.g.,NewSecretName
). The first argument (<secretPath>
) correctly requires the fully qualified path (VaultName:/SecretName
).To Reproduce
Steps to reproduce the behavior:
Ensure a vault and secret exist:
List secrets to confirm existence:
polykey secrets ls TestVault # Expected output should include OldSecret
Attempt rename using fully qualified path for the new name (This triggers the bug):
Observe the error: The command fails with an
ErrorPolykeyRemote
detailingErrorEncryptedFSError: ENOENT: no such file or directory
, referencing an incorrect source path like/OldSecret
and the targetTestVault:/NewSecret
. See the provided log in the Screenshots section for the exact error structure.Attempt rename using only the base name for the new name (This works correctly):
Observe success: The command completes without error.
List secrets to confirm rename:
polykey secrets ls TestVault # Expected output should now include NewSecret instead of OldSecret
Expected behavior
The
polykey secrets rename <secretPath> <newSecretName>
command should successfully rename the secret specified by<secretPath>
(which must be fully qualified asVault:/SecretName
) to the name specified by<newSecretName>
. The command should accept<newSecretName>
in either the fully qualified format (Vault:/NewSecretName
) or the base name format (NewSecretName
). Both formats for the second argument should result in the secret being renamed within the vault context implied by the first argument, without generating anENOENT
orErrorEncryptedFSError
. The underlying file system operation should correctly reference the source and destination paths within the encrypted vault structure.Screenshots
Platform
Additional context
ErrorEncryptedFSError
) indicates the issue occurs deep within the encrypted file system layer, specifically during arename
syscall attempt."ENOENT: no such file or directory, /ORCHESTRATOR_MAINNET_PGDATABASE -> Orchestrator:/ORCHESTRATOR_MAINNET_PGHOST"
is crucial. It shows that the source path (/ORCHESTRATOR_MAINNET_PGDATABASE
) is being incorrectly interpreted as an absolute path relative to the file system root (or an internal root) instead of being correctly resolved within the vault's context (Orchestrator:/ORCHESTRATOR_MAINNET_PGDATABASE
). The target path (Orchestrator:/ORCHESTRATOR_MAINNET_PGHOST
) appears correctly formed in the error message but the operation fails because the source is wrong.<newSecretName>
) of thesecrets rename
command when processed via the RPC call (vaultsSecretsRename
) executed by the Polykey agent/daemon.Notify maintainers
@aryanjassal @tegefaulkes
The text was updated successfully, but these errors were encountered: