hexo/node_modules/ali-oss/lib/common/bucket/getBucketEncryption.js

22 lines
628 B
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
const { checkBucketName: _checkBucketName } = require('../utils/checkBucketName');
const proto = exports;
/**
* getBucketEncryption
* @param {String} bucketName - bucket name
*/
proto.getBucketEncryption = async function getBucketEncryption(bucketName) {
_checkBucketName(bucketName);
const params = this._bucketRequestParams('GET', bucketName, 'encryption');
params.successStatuses = [200];
params.xmlResponse = true;
const result = await this.request(params);
const encryption = result.data.ApplyServerSideEncryptionByDefault;
return {
encryption,
status: result.status,
res: result.res
};
};