Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@axway/amplify-cli-utils

Package Overview
Dependencies
Maintainers
13
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axway/amplify-cli-utils

Common utils for AMPLIFY CLI packages

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-24.9%
Maintainers
13
Weekly downloads
 
Created
Source

AMPLIFY CLI Utils

A common utils library for AMPLIFY CLI and related packages.

Installation

npm i -g @axway/amplify-cli-utils

Authentication Helper

A simple helper that loads the config file and attempts to find the account tokens by auth params or by id.

Find account by login parameters

import { auth } from '@axway/amplify-cli-utils';

(async () => {
	const params = {
		baseUrl:      '',
		clientId:     '',
		clientSecret: '',
		env:          '',
		password:     '',
		realm:        '',
		secretFile:   '',
		username:     ''
	};

	const { account, client, config } = await auth.getAccount(params);

	if (account && !account.expired) {
		console.log('Found a valid access token!');
		console.log(account);
		return;
	}

	console.error('No valid authentication token found. Please login in again by running:');
	console.error('  amplify auth login');
	process.exit(1);
}());

Find account by id

import { auth } from '@axway/amplify-cli-utils';

(async () => {
	const id = 'ID GOES HERE';

	const { account, client, config } = await auth.getAccount(id);

	if (account && !account.expired) {
		console.log('Found a valid access token!');
		console.log(account);
		return;
	}

	console.error('No valid authentication token found. Please login in again by running:');
	console.error('  amplify auth login');
	process.exit(1);
}());

Get all credentialed accounts

import { auth } from '@axway/amplify-cli-utils';

(async () => {
	const accounts = await auth.list();
	console.log(accounts);
}());

This project is open source under the Apache Public License v2 and is developed by Axway, Inc and the community. Please read the LICENSE file included in this distribution for more information.

Keywords

FAQs

Package last updated on 24 Jun 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc