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

alks-node

v0.12.1

Published

Node client for ALKS

Downloads

2,921

Readme

ALKS Node Client

NPM

Build Status

About

Node client for interfacting with ALKS services.

Usage

var alks = require('alks-node');

Utilities

getDurations()

Returns array of valid session durations.

alks.getDurations();

Methods

createKey(account, password, duration, options, callback)

Creates a new session key with the provided information. Returns a JSON document.

var data = {
    alksAccount: 'alksAccount',
    alksRole: 'alksRole',
    sessionTime: 2,
    server: 'endpoint',
    userid: 'my-network-id',
    password: 'my-network-password'
};

alks.createKey(data, 'password', 2, {}, function(err, key){
    if(err) console.error(err);
    else console.log(JSON.stringify(key));
});

getAccounts(server, userid, password, options, callback)

Returns a collection of accounts.

alks.getAccounts('server', 'username', 'password', {}, function(err, accounts){
    if(err) console.error(err);
    else console.log(JSON.stringify(accounts));
});

generateConsoleUrl(key, options, callback)

Returns a AWS console URL for a given key. The URL is good for 15 minutes.

alks.generateConsoleUrl(alksKey, {}, function(err, url){
    if(err) console.error(err);
    else console.log('The console URL is: %s', url);
});

getIamRoleTypes(server, userid, password, options, callback)

Returns a list of current IAM role types.

createIamKey(account, password, options, callback)

Generates a new session for use in creating IAM roles and console sessions.

createIamRole(account, password, roleName, roleType, includeDefaultPolicies, options, callback)

Creates a new IAM role, provided account must contain valid ALKS IAM session.

createIamTrustRole(account, password, roleName, roleType, trustArn, options, callback)

Creates a new IAM trust role, provided account must contain valid ALKS IAM session.

deleteIamRole(account, password, roleName, options, callback)

Deletes a previously created IAM role, provided account must contain valid ALKS IAM session.

createLongTermKey(account, password, iamUserName, options, callback)

Creates a new longterm access key with the provided information. Returns a JSON document.

var data = {
    alksAccount: 'alksAccount',
    alksRole: 'alksRole',
    server: 'endpoint',
    userid: 'my-network-id',
    password: 'my-network-password'
};

alks.createLongTermKey(data, 'password', 'iamUser', {}, function(err, ltk){
    if(err) console.error(err);
    else console.log(JSON.stringify(ltk));
});

deleteLongTermKey(account, password, iamUserName, options, callback)

Deletes a previously created longterm key role, provided account must contain valid ALKS IAM session.

var data = {
    alksAccount: 'alksAccount',
    alksRole: 'alksRole',
    server: 'endpoint',
    userid: 'my-network-id',
    password: 'my-network-password'
};

alks.deleteLongTermKey(data, 'password', 'iamUser', {}, function(err, ltk){
    if(err) console.error(err);
    else console.log(JSON.stringify(ltk));
});

refreshTokenToAccessToken(token, options, callback)

Exchanges a 2FA refresh token for an access token.

var data = {
    alksAccount: 'alksAccount',
    server: 'endpoint'
};

alks.refreshTokenToAccessToken('bLGjhD2HVh5x4TZfWoXF5aGxDRD3afnlONBxsjN7g8U', data, {}, function(err, ltk){
    if(err) console.error(err);
    else console.log(JSON.stringify(ltk));
});