1.0.5 • Published 7 years ago

egg-aliyun-auth-helper v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

egg-aliyun-auth-helper

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-aliyun-auth-helper --save

Usage

// {app_root}/config/plugin.js
exports.aliyunAuthHelper = {
    enable: true,
    package: 'egg-aliyun-auth-helper'
};

Configuration

// {app_root}/config/config.default.js
exports.aliyunAuthHelper = {
    accessKeyId: 'zxc',
    accessKeySecret: 'zxc',
    endpoint: 'https://aaaaa.aliyunc.com',
    apiVersion: '2015-04-01',
    bucket: 'kjashdkjas'
};

see config/config.default.js for more detail.

Example

async getAuthForAliyun() {
    const { ctx, app } = this;
    const roleSession = 'BrowserSingleUpload';
    const roleAction = '"oss:PutObject"';
    const data = {
        roleSession,
        roleAction
    };
    const result = await app.authHelper.getAuthForAliyun(data);
    return result;
}

Questions & Suggestions

Please open an issue here.

License

MIT

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago