Fizcko / Azure_DevOps_Vault_Interaction

Azure DevOps extension to interact with HashiCorp Vault.
MIT License
10 stars 13 forks source link

Multiline secret support #7

Closed buddhamangler-cbre closed 4 years ago

buddhamangler-cbre commented 4 years ago

Hi!

Is it possible to add support for multiline secrets by substituting \n with a custom delimiter? We could then handle the decoding in our pipeline. A lot of our secrets are multiline json or certs and we would like to use this extension, but the multiline limitation of Azure DevOps variables prevents us from doing so.

Thanks

##[error]Error when exporting values. Error when exporting values. Error: Secrets cannot contain multiple lines
(node:118196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Error when exporting values. Error when exporting values. Error: Secrets cannot contain multiple lines
Fizcko commented 4 years ago

Hello @buddhamangler-cbre

Thanks for using this extension.

I will publish a new version with this improvement on monday in the Azure DevOps marketplace.

Regards

buddhamangler-cbre commented 4 years ago

@Fizcko that’s great to hear, some thoughts for you. We considered requesting a base64 encoding option for secrets detected as multiline, but there could be ambiguity of when or when not to apply a decode if a secret may or may not be multiline. So in the end we believe a delimiter is the best option as it can be decoded universally. If you have other better thoughts then all the better.

Thanks for the quick response!

Fizcko commented 4 years ago

@buddhamangler-cbre the new version 2.3.0 as been released on the marketplace.

buddhamangler-cbre commented 4 years ago

Hey I appreciate the new update, just a heads up it appears your regex replace will inject two delimiters in the case of DOS style line endings of \r\n where it should probably include only 1. It happens to not affect us, and could be dealt with locally with some more post processing, but just thought I would mention it in case you want to make that additional adjustment.

Fizcko commented 4 years ago

@buddhamangler-cbre you are right i forget this case.

I've just push a fix version 2.3.1 on the marketplace.