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

@everlution/aws-credentials-keychain

v1.1.1

Published

Store your AWS credentials securely.

Downloads

10

Readme

AWS Credentials Keychain

Store your AWS credentials securely.

Supports MFA devices.

  • On macOS, tool uses build-in keychain to store the credentials.
  • On Linux, it uses AES256 encrypted file as keychain to store the credentials.

Tool uses zero dependencies to make you feel a little bit safer.

Requirements

  • volta.sh - preferred way of managing Node versions
  • aws cli v2 - we recommend to use brew to install aws cli v2 which works on both macOS and Linux platforms
  • NodeJS v18
# install volta
curl https://get.volta.sh | bash
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install awscli
brew install awscli
# install node 18
volta install node@18

Installation

You can install the package globally any NodeJS package manager. Preferred way is installing it through volta.

volta install @everlution/aws-credentials-keychain

# and/or

yarn global add @everlution/aws-credentials-keychain

Usage

Set credentials

aws-login --set <aws-profile>

Refresh credentials

aws-login <aws-profile> [ttl-in-hours]

Example:

aws-login default 4

Remove credentials

aws-login --remove <aws-profile>

List credentials (Linux only)

aws-login --list

On macOS, please use build-in Keychain application to see the available credentials.

Change keychain password (Linux only)

aws-login --change-password

On macOS, please use build-in Keychain application to change the keychain password.

Recommended AWS IAM Policy

The following policy denies access to almost all AWS resources when no MFA is used. The only exception are actions, which are necessary during the first sign-in.

⚠️ User needs to sign-in again after the MFA device is registered.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyNonMfaAccess",
      "Effect": "Deny",
      "NotAction": [
        "iam:GetUser",
        "iam:ListMFADevices",
        "iam:ListVirtualMFADevices",
        "iam:EnableMFADevice",
        "iam:CreateVirtualMFADevice",
        "iam:ChangePassword"
      ],
      "Resource": ["*"],
      "Condition": {
        "BoolIfExists": {
          "aws:MultiFactorAuthPresent": "false"
        }
      }
    }
  ]
}

Using AWS login for authentication with private CodeArtifact npm repository

You can also use the aws-login tool to automatically log in to the private NPM package hosted at AWS CloudArtifact. Only thing you need to do is provide config JSON file located at ~/.aws/artifact.json.

Example configuration:

[
  {
    "domain": "{your domain name}",
    "repository": "{your repository name}",
    "region": "{aws region where the CodeArtifact is hosted}",
    "domainOwner": "{aws account number}",
    "profile": "{profile which should be used}",
    "namespace": "{private npm namespace}"
  },
  {
    "domain": "npm",
    "repository": "npm",
    "region": "eu-west-1",
    "domainOwner": "1234567890",
    "profile": "default",
    "namespace": "@my-company"
  }
]

As you can see from the above configuration file, you can have multiple CodeArtifact instances which aws-login will log you in automatically upon the credentials refreshment. Maximum duration of CodeArtifact session is limited to 12 hours.

Publish new version

Run the following code in order to publish the new version in public NPM registry:

npm publish . --access public --@everlutionsk:registry=https://registry.npmjs.org