xiongxu / s3fs

Automatically exported from code.google.com/p/s3fs
GNU General Public License v2.0
0 stars 0 forks source link

Allow standard AWS format for .passwd_s3fs files #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Detailed description of support request:

The current passwd_s3fs file format is:
<accessKeyId>:<secretAccessKey>

The standard Amazon cli tools format is:
AWSAccessKeyId=<accessKeyId>
AWSSecretKey=<secretAccessKey>

It would be nice to be able to either ln -s my existing amazon password file to 
the passwd_s3fs file OR to use the command line to set -o 
passwd_file=~/.aws_credentials.txt OR read the AWS_CREDENTIAL_FILE environment 
variable

Thanks!

===================================================================
The following information is very important in order to help us to help you.  
Omission of the following details may delay your support request or receive no 
attention at all.
===================================================================
Version of s3fs being used (s3fs --version):
Amazon Simple Storage Service File System 1.35

Version of fuse being used (pkg-config --modversion fuse):
2.8.4

System information (uname -a):
Linux xxxxx 2.6.35-25-virtual #44-Ubuntu SMP xxxxxx x86_64 GNU/Linux

Distro (cat /etc/issue):
ubuntu maverick

s3fs syslog messages (grep s3fs /var/log/syslog):
Feb 10 19:55:16 ip-10-244-49-222 s3fs: init $Rev: 304 $

Original issue reported on code.google.com by cris.fl...@gmail.com on 10 Feb 2011 at 8:05

GoogleCodeExporter commented 9 years ago
Please provide a reference (URL, link) to this file format standard is 
described. Thank you. 

Original comment by dmoore4...@gmail.com on 10 Feb 2011 at 8:26

GoogleCodeExporter commented 9 years ago
http://docs.amazonwebservices.com/IAM/latest/GettingStartedGuide/
Section heading "Setting Up the Credentials File"

Original comment by cris.fl...@gmail.com on 10 Feb 2011 at 8:44

GoogleCodeExporter commented 9 years ago
This certainly looks like something that can be supported and worked in. 
However, the existing method must be retained for legacy reasons.  Probably the 
toughest part will be heuristically figuring out which method takes precedence.

Original comment by dmoore4...@gmail.com on 10 Feb 2011 at 10:00

GoogleCodeExporter commented 9 years ago
Cris (sp?),

The above link shows the format of this file to be the following:

AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE
AWSSecretKey=wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY

Can I assume that this file will contain two and only two lines?  ...are 
comments allowed in this file? ...if so, what is the format?  ...what about 
blank lines? ...are they allowed?

The more restrictive that I can make this, the better.  I'm thinking if the 
file contains "AWSAccessKeyId=" and "AWSSecretKey=" on the beginning of two 
lines, then it must be the IAM-style file and process it accordingly.

Original comment by dmoore4...@gmail.com on 9 Mar 2011 at 4:55

GoogleCodeExporter commented 9 years ago
Original reporter,

Please provide the answers to the questions posed.  Without a response, it will 
be assumed that you no longer care about this issue. Thanks.

Original comment by dmoore4...@gmail.com on 21 Mar 2011 at 5:02

GoogleCodeExporter commented 9 years ago
I've reviewed the documentation provided and can find no mention of different 
line structures and comments.  I will try some variations and see if I can 
determine the grammar.

Cris (+sp)

Original comment by cris.fl...@gmail.com on 23 Mar 2011 at 2:24

GoogleCodeExporter commented 9 years ago
I think that I have fix for this, are you ready to give it a try.  It'll come 
as a patch file.

Original comment by dmoore4...@gmail.com on 1 Apr 2011 at 3:55

GoogleCodeExporter commented 9 years ago
Sure!  I will be back in the office on Wednesday.
Cris

Original comment by cris.fl...@gmail.com on 3 Apr 2011 at 11:46

GoogleCodeExporter commented 9 years ago
OK, here's the patch.  What it does is it looks at the credentials file first 
to see if it is in AWS format. If so, then it just uses it.  Additionally, s3fs 
will now recognize the AWS_CREDENTIAL_FILE environment variable.

There's a little bit of error checking on the file, but it's not bullet proof. 
Empty lines and lines beginning with # are ignored.  If the standard format as 
described above is used, then it should just work.

Please report back as to whether this meets your needs or not. Thanks.

Original comment by dmoore4...@gmail.com on 4 Apr 2011 at 3:16

Attachments:

GoogleCodeExporter commented 9 years ago
Looks good!  I saw no issues.
Cris

Original comment by cris.fl...@gmail.com on 5 Apr 2011 at 11:09

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r340.

Original comment by dmoore4...@gmail.com on 6 Apr 2011 at 3:06