FileWallet ( API)

Overview - Common API - Client API - Admin API - Runtime API

FileWallet

Class implementing a wallet (a container of credentials) that stores the credentials on the file system.

Details

  • Module

See also

Method Summary

Name Returns Description
add Promise Add a new credential to the wallet.
constructor void Constructor.
contains Promise Check to see if the named credentials are in the wallet.
get Promise Get the named credentials from the wallet.
getHomeDirectory string Get the current home directory.
list Promise List all of the credentials in the wallet.
remove Promise Remove existing credentials from the wallet.
update Promise Update existing credentials in the wallet.

Method Details

getHomeDirectory

string getHomeDirectory( )

Get the current home directory.

Returns

string - The current home directory.

Parameters

No parameters

new FileWallet()

Constructor.

Parameters

Name Type Optional Description
options Object true The options to use.
fs Object true The file system implementation to use.

Sub-options

Name Type Optional Description
options.directory string true The directory to store credentials in.

list

Promise list( )

List all of the credentials in the wallet.

Returns

Promise - A promise that is resolved with an array of credential names, or rejected with an error.

Parameters

No parameters

contains

Promise contains( string name )

Check to see if the named credentials are in the wallet.

Returns

Promise - A promise that is resolved with a boolean; true if the named credentials are in the wallet, false otherwise.

Parameters

Name Type Optional Description
name string false The name of the credentials.

get

Promise get( string name )

Get the named credentials from the wallet.

Returns

Promise - A promise that is resolved with the named credentials, or rejected with an error.

Parameters

Name Type Optional Description
name string false The name of the credentials.

add

Promise add( string name, string value )

Add a new credential to the wallet.

Returns

Promise - A promise that is resolved when complete, or rejected with an error.

Parameters

Name Type Optional Description
name string false The name of the credentials.
value string false The credentials.

update

Promise update( string name, string value )

Update existing credentials in the wallet.

Returns

Promise - A promise that is resolved when complete, or rejected with an error.

Parameters

Name Type Optional Description
name string false The name of the credentials.
value string false The credentials.

remove

Promise remove( string name )

Remove existing credentials from the wallet.

Returns

Promise - A promise that is resolved when complete, or rejected with an error.

Parameters

Name Type Optional Description
name string false The name of the credentials.