2017-01-11 23:27:41 -05:00
|
|
|
/* eslint-disable space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-expressions, no-return-assign, no-param-reassign, max-len */
|
|
|
|
|
2016-07-24 16:45:11 -04:00
|
|
|
(function() {
|
2017-01-11 23:27:41 -05:00
|
|
|
var bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; };
|
2016-07-24 16:45:11 -04:00
|
|
|
|
|
|
|
this.MockU2FDevice = (function() {
|
|
|
|
function MockU2FDevice() {
|
|
|
|
this.respondToAuthenticateRequest = bind(this.respondToAuthenticateRequest, this);
|
|
|
|
this.respondToRegisterRequest = bind(this.respondToRegisterRequest, this);
|
|
|
|
window.u2f || (window.u2f = {});
|
|
|
|
window.u2f.register = (function(_this) {
|
|
|
|
return function(appId, registerRequests, signRequests, callback) {
|
|
|
|
return _this.registerCallback = callback;
|
|
|
|
};
|
|
|
|
})(this);
|
|
|
|
window.u2f.sign = (function(_this) {
|
|
|
|
return function(appId, challenges, signRequests, callback) {
|
|
|
|
return _this.authenticateCallback = callback;
|
|
|
|
};
|
|
|
|
})(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
MockU2FDevice.prototype.respondToRegisterRequest = function(params) {
|
|
|
|
return this.registerCallback(params);
|
|
|
|
};
|
|
|
|
|
|
|
|
MockU2FDevice.prototype.respondToAuthenticateRequest = function(params) {
|
|
|
|
return this.authenticateCallback(params);
|
|
|
|
};
|
|
|
|
|
|
|
|
return MockU2FDevice;
|
|
|
|
})();
|
2017-02-10 02:29:41 -05:00
|
|
|
}).call(window);
|