layout
default
menu_item
api
title
Cred
description
Version 0.26.1
return_to
API Documentation Index
/api/
sections
defaultNew
sshKeyFromAgent
sshKeyMemoryNew
sshKeyNew
usernameNew
userpassPlaintextNew
#hasUsername
TYPE
Instance Variables
#defaultNew
#sshKeyFromAgent
#sshKeyMemoryNew
#sshKeyNew
#usernameNew
#userpassPlaintextNew
#hasUsername
#TYPE
#ivars
var cred = Cred . defaultNew ( ) ;
Cred. sshKeyFromAgent Sync
var cred = Cred . sshKeyFromAgent ( username ) ;
Parameters
Type
username
String
username to use to authenticate
Returns
Cred
The newly created credential object.
Cred. sshKeyMemoryNew Async
Cred . sshKeyMemoryNew ( username , publickey , privatekey , passphrase ) . then ( function ( cred ) {
// Use cred
} ) ;
Parameters
Type
username
String
username to use to authenticate.
publickey
String
The public key of the credential.
privatekey
String
The private key of the credential.
passphrase
String
The passphrase of the credential.
Returns
Cred
The newly created credential object.
var cred = Cred . sshKeyNew ( username , publickey , privatekey , passphrase ) ;
Parameters
Type
username
String
username to use to authenticate
publickey
String
The path to the public key of the credential.
privatekey
String
The path to the private key of the credential.
passphrase
String
The passphrase of the credential.
Returns
Cred
The newly created credential object.
Cred . usernameNew ( username ) . then ( function ( cred ) {
// Use cred
} ) ;
Parameters
Type
username
String
Cred. userpassPlaintextNew Sync
var cred = Cred . userpassPlaintextNew ( username , password ) ;
Parameters
Type
username
String
The username of the credential.
password
String
The password of the credential.
Returns
Cred
The newly created credential object.
var result = cred . hasUsername ( ) ;
Returns
Number
1 if the credential object has non-NULL username, 0 otherwise
| Flag | Value |
| --- | --- | --- |
| Cred.TYPE. USERPASS_PLAINTEXT | 1 |
| Cred.TYPE. SSH_KEY | 2 |
| Cred.TYPE. SSH_CUSTOM | 4 |
| Cred.TYPE. DEFAULT | 8 |
| Cred.TYPE. SSH_INTERACTIVE | 16 |
| Cred.TYPE. USERNAME | 32 |
| Cred.TYPE. SSH_MEMORY | 64 |
Variable
Type
Description
credtype
Number