github.com/artpar/rclone@v1.67.3/bin/test_proxy.py (about)

     1  #!/usr/bin/env python3
     2  """
     3  A demo proxy for rclone serve sftp/webdav/ftp, etc.
     4  
     5  This takes the incoming user/pass and converts it into an sftp backend
     6  running on localhost.
     7  """
     8  
     9  import sys
    10  import json
    11  
    12  def main():
    13      i = json.load(sys.stdin)
    14      o = {
    15          "type": "sftp",              # type of backend
    16          "_root": "",                 # root of the fs
    17          "_obscure": "pass",          # comma sep list of fields to obscure
    18          "user": i["user"],
    19          "pass": i["pass"],
    20          "host": "127.0.0.1",
    21      }
    22      json.dump(o, sys.stdout, indent="\t")
    23  
    24  if __name__ == "__main__":
    25      main()