File tree Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 0.9.3
4+
5+ - AWS S3: added ` credentials ` for custom credential provider
6+
37## 0.9.2
48
59- AWS S3: added ` pathStyleEndpoint ` to allow the use of https://www.minio.io/ as storage service
Original file line number Diff line number Diff line change @@ -58,18 +58,24 @@ class AwsS3Filesystem extends Filesystem
5858 * @var string
5959 */
6060 public $ endpoint ;
61+ /**
62+ * @var array|\Aws\CacheInterface|\Aws\Credentials\CredentialsInterface|bool|callable
63+ */
64+ public $ credentials ;
6165
6266 /**
6367 * @inheritdoc
6468 */
6569 public function init ()
6670 {
67- if ($ this ->key === null ) {
68- throw new InvalidConfigException ('The "key" property must be set. ' );
69- }
71+ if ($ this ->credentials === null ) {
72+ if ($ this ->key === null ) {
73+ throw new InvalidConfigException ('The "key" property must be set. ' );
74+ }
7075
71- if ($ this ->secret === null ) {
72- throw new InvalidConfigException ('The "secret" property must be set. ' );
76+ if ($ this ->secret === null ) {
77+ throw new InvalidConfigException ('The "secret" property must be set. ' );
78+ }
7379 }
7480
7581 if ($ this ->bucket === null ) {
@@ -84,12 +90,14 @@ public function init()
8490 */
8591 protected function prepareAdapter ()
8692 {
87- $ config = [
88- 'credentials ' => [
89- 'key ' => $ this ->key ,
90- 'secret ' => $ this ->secret
91- ]
92- ];
93+ $ config = [];
94+
95+ if ($ this ->credentials === null ) {
96+ $ config ['credentials ' ] = ['key ' => $ this ->key , 'secret ' => $ this ->secret ];
97+ } else {
98+ $ config ['credentials ' ] = $ this ->credentials ;
99+ }
100+
93101
94102 if ($ this ->pathStyleEndpoint === true ) {
95103 $ config ['use_path_style_endpoint ' ] = true ;
You can’t perform that action at this time.
0 commit comments