ATM you can define credentials for S3 in 3 different places
- in the env variables/system properties (LUCEE_S3_ACCESSKEYID="…";…)
- in the Application.cfc (this.s3.accessKeyId = “…”;… )
- in the path directly (s3://ACCESSKEYID:SECRETKEY@/bucketName)
But ATM you can only use the last option in case you wanna use multiple different credentials (endpoints).
so you have to do something like
dump(directoryList("s3://#shopAKI#:#shopSK#@/bucketName"));
dump(directoryList("s3://#adminAKI#:#adminSK#@/bucketName"));
But i would prefer to work with mappings, so you simply can do
dump(directoryList("s3://shop@/bucketName"));
dump(directoryList("s3://admin@/bucketName"));
and in the Application.cfc you have
component {
this.s3.shop.accessKeyId = "...";
this.s3.shop.awsSecretKey = "...";
this.s3.admin.accessKeyId = "...";
this.s3.admin.awsSecretKey = "...";
}
and as an env var you can set
LUCEE_S3_SHOP_ACCESSKEYID="...";LUCEE_S3_SHOP_SECRETKEY="...";
The same way you can define datasources.
What do you think?
BTW we can support exactly the same also for other virtual file systems like “http”
Application.cfc
component {
this.http.lucee.username = "susi";
this.http.lucee.password = "foehn";
this.http.lucee.authtype = "basic";
}
then in the code
dump(directoryList("http://lucee@lucee.org/whatever/"));