kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.53k stars 92 forks source link

support using var calls in connect strings to hide passwords. #180

Open walkabout21 opened 1 year ago

walkabout21 commented 1 year ago

An oracle connect string format is user/password@host . With dadbod you can set a connection to be something like user/$password/host so the password can be kept in a password manager loaded into a var to be consumed at runtime for login. Currently setting up a connect string in dadbod ui for oracle does not appear to support adding a /password to the connect string instead of manually adding a password at connect time.

SergioShz commented 1 year ago

hey, I experienced some similar Issue, you can actually use some password manager for that case, I'm using pass and I have defined the connections as something like this:

let g:myconn = trim(system('pass myconn | head -n1'))
let g:dbs = [
\ { 'name': 'myconn'    , 'url': myconn },
\ ]

A different story is that you can still retrieve the plain password in the dbs variable (or whatever you define) but I'm guessing is only inside the vim instance that you are running (?). I guess that obfuscate the passwords or drop them somehow after the connection is successful would be a better option but probably requires a PR (and I don't know that much about vim scripting 😅 )

This one is working fine for me, hope it helps!

walkabout21 commented 1 year ago

@SergioShz have you tested using pass with the ui when creating a new connection? I've set up the connections with dadbod in my init before, but I wanted to be able to set a password to a var or pass call when creating the connection via the ui.

SergioShz commented 1 year ago

nop, I didn't. It seems a bit more complicated than just calling pass from the init script 😞

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.