-
Notifications
You must be signed in to change notification settings - Fork 5
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: pk secrets env
command
#505
Conversation
👇 Click on the image for a new way to code review
Legend |
I was looking at the The regex used here doesn't seem to be well thought out. I traced what actually is the limitation of EFS has no limitations with the string. It does some things like:
But that's it, so that means the EFS strings are more flexible than even Linux FS path strings since they only restrict null characters (technically we could even have null characters). However in our PK usecase allowing such arbitrary strings are a bad idea. The reason is when we are loading such files back on to the OS's FS, we will eventually hit problems with converting to to OS FS paths. So it's better to focus on the lowest common denominator with respect to This means we combine the limitations of linux paths, windows paths and darwin paths together and create a regex in turn to match those kinds of paths. Then the In the future this could be made closer to URI. In fact it makes more sense to just think of the vault name as just another component path. That is But we should still call it So even the vault name itself is subject to the same requirements, however I think the vault name may have other limitations. I forgot if there was some reason we had to use a specialised vault ID, or if the vault name is just a string we put into the DB. Thoughts @tegefaulkes? |
Here's a comparison of all the limitations: https://en.wikipedia.org/wiki/Filename#Comparison_of_filename_limitations. If we keep it simple right now, this allows us So we can then change our regex to capture the first vault name group with the above, then everything subsequently afterwards. |
I've been thinking of the vault path like it's a
You could even go crazy and reference secrets in a remote vault |
This can no longer be implemented here, it would need to be done as part of Polykey-CLI. Closing this PR, but the issue MatrixAI/Polykey-CLI#31 is still relevant. |
Description
This introduces a prototype
pk secrets env
command to inject secrets into a command.Right now we're going to do something simple as the kexec library is not ready (MatrixAI/Polykey-CLI#31), and plus we would probably need to make it ourselves to ensure cross platform behaviour.
For demo purposes (#504) it's sufficient to just do a subprocess.
Some differences from #265...
Instead of doing
vault:secretpath:name
we can doname=vault:secretpath
.This makes it closer to the behaviour of the
env
command.We can add in flag
-i|--ignore-environment
and-C|--chdir
like theenv
command too. Not sure if this fits our flag styles, since we would normally do-ie
and-cd
.Issues Fixed
pk secrets env
command for meeting Development Environment Usecase Polykey-CLI#31Tasks
pk secrets env
command for meeting Development Environment Usecase Polykey-CLI#31Final checklist