-
Notifications
You must be signed in to change notification settings - Fork 112
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
Bash variable name iteration #1443
Conversation
…nc with my local output
} | ||
|
||
hex_to_string() { |
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.
This can be removed if we can depend on xxd
. This is generally supported but not available everywhere, we could check if it is available and only add the octopus_parameters if it is.
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.
hexdump
seems generally available on Nix, but is not installed by default on mac
This is an alternative to #1441 If we can use the cli command
xxd
this is not an issue and simplifies the implementation significantly.This change adds the ability to iterate variable names in base. The implementation for this is based off of the PowerShell implementation of OctopusParameters
Decrypt-Variables
.For PowerShell we do the following in C#
$
delimiter between them. (This is to make sure all special characters are removed)These are then string replaced in the PowerShell bootstrap.ps1 script.
The PowerShell bootstrap script does the following:
This works well in Powershell ~3000 variables takes about 1 second in this process.
In base we use Openssl to decode base64 strings, this spins up a process and overall repeating this same process for ~3000 variables takes ~60 seconds.
To work around this I've settled on Hex encoding the variable names, unlike base64 hex encoded strings can be concatenated and decrypted all at once, this also doesn't depend on the openssl process being invoked. We have to handle the hex to string ourselves, we could use strtonum but it's not available everywhere.
Accessing keys