npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alicloud/sso-cli

v1.3.2

Published

Alibaba Cloud SSO command line interface

Downloads

192

Readme

Alibaba Cloud SSO CLI

NPM version Node.js CI codecov npm download

English version

You may check the full English version here.

Installation

Requires node v16 or higher for ES module support. The latest stable Node.js is recommended.

npm i @alicloud/sso-cli -g

Have a test:

$ acs-sso
Alibaba Cloud SSO CLI v1.0.0

   help              print help information
   version           print version
   completion        auto completion
   login             login with SSO account
   configure         configure signin url
   profile           list or delete profiles

Usage

Configure

acs-sso configure

跟着提示输入即可。例如:

$ acs-sso configure
? please input 'signinUrl': https://signin-******.alibabacloudsso.com/***/login
configuration done!

上面的 signinUrl 可以在云 SSO 控制台首页上获取,每个目录的链接各不相同。

Login

acs-sso login

如果你的身份下,有多个账号或多个访问配置,将会提示您选择账号和配置。登录成功后,profile 会绑定这份账号和配置。

下次登录将会使用登录成功后的缓存 STS 信息。

强制重新登录

登录后会自动缓存 STS 信息,所以提供了 --force 来提供强制刷新 STS 信息:

acs-sso login --force

支持切换 Profile

默认情况下,使用的 profile 为 default。您可以使用 --profile 来支持不同的 profile 名字:

acs-sso login --profile user1

未输入 --profile 的情况下,默认为上次成功登录的身份。

指定账号和配置名

如果您有多个账号或多个配置,可以使用 --account_id--access_config 来指定:

acs-sso login --account_id 1234567890123456 --access_config admin

输出控制

默认情况,输出的结果为一个 JSON 格式的数据:

{
  "mode": "StsToken",
  "access_key_id": "STS.NUyPeEoab****",
  "access_key_secret": "GBubpmh****",
  "sts_token": "CAIS****"
}

您可以使用 --env 这个 flag 来控制输出为环境变量的模式:

export ALIBABA_CLOUD_ACCESS_KEY_ID=STS.NUyPeEoab****
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=GBubpmh****
export ALIBABA_CLOUD_SECURITY_TOKEN=CAIS****

上述环境变量可以与阿里云的相关工具进行配合。

Profile

用于查看或删除已配置的 profile。

$ acs-sso profile
┌───────────┬──────────────────┬─────────────────────────┬───────────┐
│ Profile   │ Access ID        │ Access Configuration ID │ Status    │
├───────────┼──────────────────┼─────────────────────────┼───────────┤
│ default * │ 182837359590**** │ ac-00v3wh59ifjdxd4u**** │ Available │
└───────────┴──────────────────┴─────────────────────────┴───────────┘

第一列展示的是 profile 名称,带星号,表明为当前默认的 profile。

$ acs-sso profile --delete --profile default
Delete the profile 'default' successful.

你可以通过 acs-sso help profile 查看完整的操作及选项。

配合阿里云 CLI

$ `acs-sso login --profile user1 --env`   # 将 Credentials 信息设置进环境变量
$ export ALIBABA_CLOUD_IGNORE_PROFILE=TRUE # 如果本地配置过 aliyun,通过此环境变量禁用配置,避免干扰
$ aliyun sts GetCallerIdentity            # 直接使用环境变量中的 Credentials 信息
{
  "AccountId": "182837359590****",
  "Arn": "acs:ram::182837359590****:assume***/aliyunreserved***/ye***@ye***.onmicrosoft.com",
  "IdentityType": "AssumedRoleUser",
  "PrincipalId": "36410118165466****:ye***@ye***.onmicrosoft.com",
  "RequestId": "8AAAC6D1-F749-5B15-B428-D6EEB2E8****",
  "RoleId": "36410118165466****"
}

License

The Apache License 2.0

Copyright (c) 2009-present, Alibaba Cloud All rights reserved.