You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/06/05 12:31:21 UTC

[whimsy] branch master updated: Support password-from-stdin

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new f5924b8  Support password-from-stdin
f5924b8 is described below

commit f5924b8118c63b65226305e9009481af2b024b48
Author: Sebb <se...@apache.org>
AuthorDate: Fri Jun 5 13:30:58 2020 +0100

    Support password-from-stdin
---
 lib/whimsy/asf/svn.rb | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/svn.rb b/lib/whimsy/asf/svn.rb
index 5d3ec31..93e0218 100644
--- a/lib/whimsy/asf/svn.rb
+++ b/lib/whimsy/asf/svn.rb
@@ -296,16 +296,23 @@ module ASF
         end
       end
 
+      open_opts = {}
       # password was supplied, add credentials
       password = options[:password]
       if password
-        cmd += ['--username', options[:user], '--password', password, '--no-auth-cache']
+        cmd += ['--username', options[:user], '--no-auth-cache']
+        if ASF::Config[:password_from_stdin] # TODO: better way to check this?
+          open_opts[:stdin_data] = password
+          cmd << '--password-from-stdin'
+        else
+          cmd += ['--password', password]
+        end
       end
 
       p cmd if options[:verbose]
 
       # issue svn command
-      out, err, status = Open3.capture3(*cmd)
+      out, err, status = Open3.capture3(*cmd, open_opts)
       if status.success?
         return out
       else


Re: [whimsy] branch master updated: Support password-from-stdin

Posted by sebb <se...@gmail.com>.
On Fri, 5 Jun 2020 at 14:09, Sam Ruby <ru...@intertwingly.net> wrote:
>
> On Fri, Jun 5, 2020 at 8:31 AM <se...@apache.org> wrote:
> >
> > +        if ASF::Config[:password_from_stdin] # TODO: better way to check this?
>
> https://github.com/rubys/whimsy-board-agenda-nodejs/blob/48c1cec0caa5e5c60d0816ba56aeabbe3105a006/src/server/svn.js#L30

Thanks!

> - Sam Ruby

Re: [whimsy] branch master updated: Support password-from-stdin

Posted by Sam Ruby <ru...@intertwingly.net>.
On Fri, Jun 5, 2020 at 8:31 AM <se...@apache.org> wrote:
>
> +        if ASF::Config[:password_from_stdin] # TODO: better way to check this?

https://github.com/rubys/whimsy-board-agenda-nodejs/blob/48c1cec0caa5e5c60d0816ba56aeabbe3105a006/src/server/svn.js#L30

- Sam Ruby