Socket
Socket
Sign inDemoInstall

@blueshit/aliyun-sts

Package Overview
Dependencies
0
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @blueshit/aliyun-sts

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


Version published
Maintainers
2
Install size
10.1 kB
Created

Readme

Source

@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

Keywords

FAQs

Last updated on 18 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc