File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ module.exports = function (OssClient) {
52
52
'get' ,
53
53
'getStream' ,
54
54
'list' ,
55
+ 'getACL' ,
55
56
] ;
56
57
57
58
const PUT_METHODS = [
@@ -61,6 +62,7 @@ module.exports = function (OssClient) {
61
62
'deleteMulti' ,
62
63
'copy' ,
63
64
'putMeta' ,
65
+ 'putACL' ,
64
66
] ;
65
67
66
68
GET_METHODS . forEach ( ( method ) => {
Original file line number Diff line number Diff line change @@ -107,6 +107,24 @@ describe('test/cluster.test.js', () => {
107
107
} ) ;
108
108
} ) ;
109
109
110
+ describe ( 'putACL() and getACL()' , ( ) => {
111
+ it ( 'should add object with local file path' , function * ( ) {
112
+ const name = `${ prefix } ali-sdk/oss/put-localfile.js` ;
113
+ const object = yield this . store . put ( name , __filename ) ;
114
+ assert . equal ( typeof object . res . headers [ 'x-oss-request-id' ] , 'string' ) ;
115
+ assert . equal ( typeof object . res . rt , 'number' ) ;
116
+ assert . equal ( object . res . size , 0 ) ;
117
+ assert ( object . name , name ) ;
118
+
119
+ let res = yield this . store . getACL ( name ) ;
120
+ assert . equal ( res . acl , 'default' ) ;
121
+
122
+ yield this . store . putACL ( name , 'public-read' ) ;
123
+ res = yield this . store . getACL ( name ) ;
124
+ assert . equal ( res . acl , 'public-read' ) ;
125
+ } ) ;
126
+ } ) ;
127
+
110
128
describe ( 'get()' , ( ) => {
111
129
before ( function * ( ) {
112
130
this . name = `${ prefix } ali-sdk/oss/get-meta.js` ;
You can’t perform that action at this time.
0 commit comments