I am building a web app that will automatically download some data from Amazon's S3 cloud, unzip and load the unzipped data into a PostGRE SQL database.
I have all the scripts developed and working. However, I'd like to create a front-end where a user would put their username and password for a proxy server. This is necessary as users are required to change those every month.
I'm using boto to connect to S3. Up until now, since I was executing the scripts myself from the command line, I was just typing in my password as it was. I'd like to change that and use jQuery to pass username and encrypted password to a Python script that will then do all the above mentioned actions. I'd like to avoid sending this through the list of parameters in web browser's address line.
I know how to do the hashing (I think). However, when I'm trying to pass hashed password to boto I get an error 407 (Proxy Authentication Required)
.
Does anyone know a workaround this? I'm happy to use a module other than Boto as long as I can pass encrypted password. Unless I can 'unhash' the password in the script and then pass it to Boto.S3Connection.
Here's the script that I'm using to connect to S3.
import boto
import sys, os
from boto.s3.key import Key
import boto.s3.connection as s3
import argparse
AWS_ACCESS_KEY_ID = 'XXXXXXXXXXXXXXXXXXXXXXX'
AWS_SECRET_ACCESS_KEY = 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
parser = argparse.ArgumentParser(description='Do something')
parser.add_argument('user', metavar='user', nargs='+', help='user login to access proxy')
parser.add_argument('passwd', metavar='passwd', nargs='+', help='user password')
args = parser.parse_args()
bucket_name = 'xxxx.xxx.xxx'
# connect to the bucket
conn = s3.S3Connection(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,
proxy='999.999.99.99',
proxy_port='8080',
proxy_user=args.user[0],
proxy_pass=args.passwd[0])
# do whatever is necessary below ...
Thanks in advance for your help!