1.0.3 • Published 6 years ago

@blueshit/aliyun-sts v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@blueshit/aliyun-sts

轻量级阿里云STS客户端,不依赖任何第三方库,体验飞一般的感觉

安装

npm i @blueshit/aliyun-sts -S

使用

import { STS } from "@blueshit/aliyun-sts";

const sts = new STS({
  accessKeyId: ENV_ACCESS_KEY_ID,
  accessKeySecret: ENV_ACCESS_KEY_SECRET,
});
const policy = {
  Statement: [
    {
      Effect: "Allow",
      Action: ["oss:GetObject", "oss:PutObject"],
      Resource: [`acs:oss:*:*:${ENV_BUCKET}/*`],
    },
  ],
  Version: "1",
};

const credentials = await sts.assumeRole(ENV_ACS_RAM, policy, 15 * 60, "RoleSessionName");
console.log(credentials);

授权协议

The MIT License

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago