neosmart / SecureStore

A .NET implementation of the cross-platform SecureStore (symmetrically-encrypted secrets) protocol
MIT License
96 stars 15 forks source link

How to set Connection string with the CLI #14

Closed Camelxx closed 8 months ago

Camelxx commented 11 months ago

Trying to set a connection string with the cli but only getting this error back.

Expected a single "key=value" or "key" "value" to set!

SecureStore --store secrets.json set sonnectionString Server=localhost;Database=bleh -k secrets.key

Tried setting it like SecureStore --store secrets.json set sonnectionString 'connectiong string' -k secrets.key

SecureStore --store secrets.json set sonnectionString "connectiong string" -k secrets.key

The issue is the connection string contains = and think the cli don't like it

How to add it ?

mqudsi commented 11 months ago

Use the interactive mode, with SecureStore -k secrets.key set connectionString <ENTER>

mqudsi commented 11 months ago

I don't know what shell you are using, but usually the bigger issue is the ; and not the =

Camelxx commented 11 months ago

Thank you will try the inreractive mode , and using normal cmd

babskig commented 11 months ago

You need to use the other format (key=value) and quote the arguments to prevent the shell from interpreting the ; as a command separator.

I used: SecureStore --store secrets.json set 'sonnectionString=Server=localhost;Database=bleh' -k secrets.key

mqudsi commented 8 months ago

I did not properly understand this bug report at the time it was filed, but this is a duplicate of https://github.com/neosmart/SecureStore/issues/18 which has been fixed and will be in the next release.