Kerberos = function () { this._native_kerberos = new KerberosNative(); }
n/a
processes.MongoAuthProcess = function (host, port, service_name, options) { // Check what system we are on if(process.platform == 'win32') { this._processor = new Win32MongoProcessor(host, port, service_name, options); } else { this._processor = new UnixMongoProcessor(host, port, service_name, options); } }
n/a
Kerberos = function () { this._native_kerberos = new KerberosNative(); }
n/a
acquireAlternateCredentials = function (user_name, password, domain) { return this._native_kerberos.acquireAlternateCredentials(user_name, password, domain); }
...
// can spoof your KDC (see: https://github.com/qesuto/node-krb5/issues/13)
// callback receives error and boolean
Kerberos.prototype.authUserKrb5Password = function(username, password, service, callback) {
return this._native_kerberos.authUserKrb5Password(username, password, service, callback);
};
Kerberos.prototype.acquireAlternateCredentials = function(user_name, password, domain) {
return this._native_kerberos.acquireAlternateCredentials(user_name, password, domain
);
}
Kerberos.prototype.prepareOutboundPackage = function(principal, inputdata) {
return this._native_kerberos.prepareOutboundPackage(principal, inputdata);
}
Kerberos.prototype.decryptMessage = function(challenge) {
...
authGSSClientClean = function (context, callback) { return this._native_kerberos.authGSSClientClean(context, callback); }
...
return this._native_kerberos.authGSSClientWrap(context, challenge, user_name, callback);
}
// free memory used by a context created using authGSSClientInit.
// callback takes one argument, an error string if defined.
Kerberos.prototype.authGSSClientClean = function(context, callback) {
return this._native_kerberos.authGSSClientClean(context, callback);
}
// The server will obtain credentials using a keytab. To override the
// default location (probably /etc/krb5.keytab) set the KRB5_KTNAME
// environment variable.
// The service name should be in the form service, or service@host.name
// e.g. for HTTP, use "HTTP" or "HTTP@my.host.name". See gss_import_name
...
authGSSClientInit = function (uri, flags, credentialsCache, callback) { if (typeof(credentialsCache) == 'function') { callback = credentialsCache; credentialsCache = ''; } if (credentialsCache === undefined) { credentialsCache = ''; } return this._native_kerberos.authGSSClientInit(uri, flags, credentialsCache, callback); }
...
credentialsCache = '';
}
if (credentialsCache === undefined) {
credentialsCache = '';
}
return this._native_kerberos.authGSSClientInit(uri, flags, credentialsCache, callback
);
}
// This will obtain credentials using a credentials cache. To override the default
// location (posible /tmp/krb5cc_nnnnnn, where nnnn is your numeric uid) use
// the environment variable KRB5CNAME.
// The credentials (suitable for using in an 'Authenticate: ' header, when prefixed
// with 'Negotiate ') will be available as context.response inside the callback
...
authGSSClientStep = function (context, challenge, callback) { if(typeof challenge == 'function') { callback = challenge; challenge = ''; } return this._native_kerberos.authGSSClientStep(context, challenge, callback); }
...
// callback takes one argument, an error string if defined
Kerberos.prototype.authGSSClientStep = function(context, challenge, callback) {
if(typeof challenge == 'function') {
callback = challenge;
challenge = '';
}
return this._native_kerberos.authGSSClientStep(context, challenge, callback);
}
Kerberos.prototype.authGSSClientUnwrap = function(context, challenge, callback) {
if(typeof challenge == 'function') {
callback = challenge;
challenge = '';
}
...
authGSSClientUnwrap = function (context, challenge, callback) { if(typeof challenge == 'function') { callback = challenge; challenge = ''; } return this._native_kerberos.authGSSClientUnwrap(context, challenge, callback); }
...
Kerberos.prototype.authGSSClientUnwrap = function(context, challenge, callback) {
if(typeof challenge == 'function') {
callback = challenge;
challenge = '';
}
return this._native_kerberos.authGSSClientUnwrap(context, challenge, callback);
}
Kerberos.prototype.authGSSClientWrap = function(context, challenge, user_name, callback) {
if(typeof user_name == 'function') {
callback = user_name;
user_name = '';
}
...
authGSSClientWrap = function (context, challenge, user_name, callback) { if(typeof user_name == 'function') { callback = user_name; user_name = ''; } return this._native_kerberos.authGSSClientWrap(context, challenge, user_name, callback); }
...
Kerberos.prototype.authGSSClientWrap = function(context, challenge, user_name, callback) {
if(typeof user_name == 'function') {
callback = user_name;
user_name = '';
}
return this._native_kerberos.authGSSClientWrap(context, challenge, user_name, callback
);
}
// free memory used by a context created using authGSSClientInit.
// callback takes one argument, an error string if defined.
Kerberos.prototype.authGSSClientClean = function(context, callback) {
return this._native_kerberos.authGSSClientClean(context, callback);
}
...
authGSSServerClean = function (context, callback) { return this._native_kerberos.authGSSServerClean(context, callback); }
...
constrained_delegation = !!constrained_delegation;
return this._native_kerberos.authGSSServerInit(service, constrained_delegation, username, callback);
};
//callback takes one argument, an error string if defined.
Kerberos.prototype.authGSSServerClean = function(context, callback) {
return this._native_kerberos.authGSSServerClean(context, callback);
};
// authData should be the base64 encoded authentication data obtained
// from client, e.g., in the Authorization header (without the leading
// "Negotiate " string) during SPNEGO authentication. The authenticated user
// is available in context.username after successful authentication.
// callback takes one argument, an error string if defined.
...
authGSSServerInit = function (service, constrained_delegation, username, callback) { if(typeof(constrained_delegation) === 'function') { callback = constrained_delegation; constrained_delegation = false; username = null; } if (typeof(constrained_delegation) === 'string') { throw new Error("S4U2Self protocol transation is not possible without enabling constrained delegation"); } if (typeof(username) === 'function') { callback = username; username = null; } constrained_delegation = !!constrained_delegation; return this._native_kerberos.authGSSServerInit(service, constrained_delegation, username, callback); }
...
if (typeof(username) === 'function') {
callback = username;
username = null;
}
constrained_delegation = !!constrained_delegation;
return this._native_kerberos.authGSSServerInit(service, constrained_delegation, username
, callback);
};
//callback takes one argument, an error string if defined.
Kerberos.prototype.authGSSServerClean = function(context, callback) {
return this._native_kerberos.authGSSServerClean(context, callback);
};
...
authGSSServerStep = function (context, authData, callback) { return this._native_kerberos.authGSSServerStep(context, authData, callback); }
...
// is available in context.username after successful authentication.
// callback takes one argument, an error string if defined.
//
// Note: when S4U2Self protocol transition was requested in the authGSSServerInit
// no actual authentication will be performed and authData will be ignored.
//
Kerberos.prototype.authGSSServerStep = function(context, authData, callback) {
return this._native_kerberos.authGSSServerStep(context, authData, callback);
};
// authenticate the username and password against the KDC, and verify the KDC using a local
// service key stored in the keytab. See above for details on providing the keytab.
// The service should be the service principal name for a key available in the local keytab,
// e.g. HTTP/somehost.example.com. If service is an empty tring, KDC verification will
// be skipped. DON'T DO THIS - it's a possible security vulnerability if an attacker
...
authUserKrb5Password = function (username, password, service, callback) { return this._native_kerberos.authUserKrb5Password(username, password, service, callback); }
...
// service key stored in the keytab. See above for details on providing the keytab.
// The service should be the service principal name for a key available in the local keytab,
// e.g. HTTP/somehost.example.com. If service is an empty tring, KDC verification will
// be skipped. DON'T DO THIS - it's a possible security vulnerability if an attacker
// can spoof your KDC (see: https://github.com/qesuto/node-krb5/issues/13)
// callback receives error and boolean
Kerberos.prototype.authUserKrb5Password = function(username, password, service, callback) {
return this._native_kerberos.authUserKrb5Password(username, password, service, callback
);
};
Kerberos.prototype.acquireAlternateCredentials = function(user_name, password, domain) {
return this._native_kerberos.acquireAlternateCredentials(user_name, password, domain);
}
Kerberos.prototype.prepareOutboundPackage = function(principal, inputdata) {
...
decryptMessage = function (challenge) { return this._native_kerberos.decryptMessage(challenge); }
...
}
Kerberos.prototype.prepareOutboundPackage = function(principal, inputdata) {
return this._native_kerberos.prepareOutboundPackage(principal, inputdata);
}
Kerberos.prototype.decryptMessage = function(challenge) {
return this._native_kerberos.decryptMessage(challenge);
}
Kerberos.prototype.encryptMessage = function(challenge) {
return this._native_kerberos.encryptMessage(challenge);
}
Kerberos.prototype.queryContextAttribute = function(attribute) {
...
encryptMessage = function (challenge) { return this._native_kerberos.encryptMessage(challenge); }
...
}
Kerberos.prototype.decryptMessage = function(challenge) {
return this._native_kerberos.decryptMessage(challenge);
}
Kerberos.prototype.encryptMessage = function(challenge) {
return this._native_kerberos.encryptMessage(challenge);
}
Kerberos.prototype.queryContextAttribute = function(attribute) {
if(typeof attribute != 'number' && attribute != 0x00) throw new Error("Attribute not supported");
return this._native_kerberos.queryContextAttribute(attribute);
}
...
prepareOutboundPackage = function (principal, inputdata) { return this._native_kerberos.prepareOutboundPackage(principal, inputdata); }
...
};
Kerberos.prototype.acquireAlternateCredentials = function(user_name, password, domain) {
return this._native_kerberos.acquireAlternateCredentials(user_name, password, domain);
}
Kerberos.prototype.prepareOutboundPackage = function(principal, inputdata) {
return this._native_kerberos.prepareOutboundPackage(principal, inputdata);
}
Kerberos.prototype.decryptMessage = function(challenge) {
return this._native_kerberos.decryptMessage(challenge);
}
Kerberos.prototype.encryptMessage = function(challenge) {
...
queryContextAttribute = function (attribute) { if(typeof attribute != 'number' && attribute != 0x00) throw new Error("Attribute not supported"); return this._native_kerberos.queryContextAttribute(attribute); }
...
Kerberos.prototype.encryptMessage = function(challenge) {
return this._native_kerberos.encryptMessage(challenge);
}
Kerberos.prototype.queryContextAttribute = function(attribute) {
if(typeof attribute != 'number' && attribute != 0x00) throw new Error("Attribute not supported");
return this._native_kerberos.queryContextAttribute(attribute);
}
// Some useful result codes
Kerberos.AUTH_GSS_CONTINUE = 0;
Kerberos.AUTH_GSS_COMPLETE = 1;
// Some useful gss flags
...
Kerberos = function () { this._native_kerberos = new KerberosNative(); }
n/a
MongoAuthProcess = function (host, port, service_name, options) { // Check what system we are on if(process.platform == 'win32') { this._processor = new Win32MongoProcessor(host, port, service_name, options); } else { this._processor = new UnixMongoProcessor(host, port, service_name, options); } }
n/a
MongoAuthProcess = function (host, port, service_name, options) { // Check what system we are on if(process.platform == 'win32') { this._processor = new Win32MongoProcessor(host, port, service_name, options); } else { this._processor = new UnixMongoProcessor(host, port, service_name, options); } }
n/a
init = function (username, password, callback) { this._processor.init(username, password, callback); }
n/a
transition = function (payload, callback) { this._processor.transition(payload, callback); }
n/a