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

@blackbaud/auth-client

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blackbaud/auth-client - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

src/auth/auth-token-integration.spec.d.ts

189

bundles/auth-client.umd.js

@@ -76,3 +76,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ return __webpack_require__(__webpack_require__.s = 3);
/******/ })

@@ -86,2 +86,34 @@ /************************************************************************/

Object.defineProperty(exports, "__esModule", { value: true });
var HOST_ORIGIN = 'https://host.nxt.blackbaud.com';
var BBAuthInterop = (function () {
function BBAuthInterop() {
}
/* istanbul ignore next */
BBAuthInterop.navigate = function (url) {
location.href = url;
};
/* istanbul ignore next */
BBAuthInterop.postOmnibarMessage = function (iframeEl, message) {
message.source = 'auth-client';
iframeEl.contentWindow.postMessage(message, HOST_ORIGIN);
};
BBAuthInterop.messageIsFromOmnibar = function (event) {
if (event.origin === HOST_ORIGIN) {
var message = event.data;
return !!message && message.source === 'skyux-spa-omnibar';
}
return false;
};
return BBAuthInterop;
}());
exports.BBAuthInterop = BBAuthInterop;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function __export(m) {

@@ -91,7 +123,7 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];

Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(4));
__export(__webpack_require__(5));
/***/ }),
/* 1 */
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

@@ -105,10 +137,10 @@

Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(11));
__export(__webpack_require__(6));
__export(__webpack_require__(9));
__export(__webpack_require__(5));
__export(__webpack_require__(8));
__export(__webpack_require__(7));
/***/ }),
/* 2 */
/* 3 */
/***/ (function(module, exports, __webpack_require__) {

@@ -122,8 +154,8 @@

Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(0));
__export(__webpack_require__(1));
__export(__webpack_require__(2));
/***/ }),
/* 3 */
/* 4 */
/***/ (function(module, exports, __webpack_require__) {

@@ -134,2 +166,3 @@

Object.defineProperty(exports, "__esModule", { value: true });
var interop_1 = __webpack_require__(0);
var BBAuthTokenIntegration = (function () {

@@ -153,3 +186,3 @@ function BBAuthTokenIntegration(csrfUrl, tokenUrl, signInUrl) {

// Not logged in, so go back to Auth Svc.
location.href = _this.signInUrl + '?redirectUrl=' + encodeURIComponent(location.href);
interop_1.BBAuthInterop.navigate(_this.signInUrl + '?redirectUrl=' + encodeURIComponent(location.href));
});

@@ -174,5 +207,3 @@ });

if (xhr.readyState === 4 && xhr.status === 401) {
if (unuthCB) {
unuthCB();
}
unuthCB();
}

@@ -184,5 +215,3 @@ else if (xhr.readyState === 4 && xhr.status === 200) {

xhr.open('POST', url, true);
if (header) {
xhr.setRequestHeader(header.name, header.value);
}
xhr.setRequestHeader(header.name, header.value);
xhr.setRequestHeader('Accept', 'application/json');

@@ -198,3 +227,3 @@ xhr.withCredentials = true;

/***/ }),
/* 4 */
/* 5 */
/***/ (function(module, exports, __webpack_require__) {

@@ -205,3 +234,3 @@

Object.defineProperty(exports, "__esModule", { value: true });
var auth_token_integration_1 = __webpack_require__(3);
var auth_token_integration_1 = __webpack_require__(4);
var BBAuth = (function () {

@@ -211,2 +240,5 @@ function BBAuth() {

BBAuth.getToken = function () {
if (BBAuth.mock) {
return Promise.resolve('mock_access_token_auth-client@blackbaud.com');
}
var tokenInteraction = new auth_token_integration_1.BBAuthTokenIntegration('https://signin.blackbaud.com/api/v2/csrf', 'https://signin.blackbaud.com/api/v2/oauth/token', 'https://signin.blackbaud.com');

@@ -232,2 +264,3 @@ var now = new Date().valueOf();

}());
BBAuth.mock = false;
exports.BBAuth = BBAuth;

@@ -237,3 +270,3 @@

/***/ }),
/* 5 */
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

@@ -253,3 +286,3 @@

/***/ }),
/* 6 */
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

@@ -260,3 +293,3 @@

Object.defineProperty(exports, "__esModule", { value: true });
var interop_1 = __webpack_require__(10);
var interop_1 = __webpack_require__(0);
var CLS_EXPANDED = 'sky-omnibar-iframe-expanded';

@@ -388,3 +421,3 @@ var CLS_LOADING = 'sky-omnibar-loading';

/***/ }),
/* 7 */
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

@@ -404,3 +437,3 @@

/***/ }),
/* 8 */
/* 9 */
/***/ (function(module, exports, __webpack_require__) {

@@ -420,3 +453,3 @@

/***/ }),
/* 9 */
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

@@ -427,3 +460,61 @@

Object.defineProperty(exports, "__esModule", { value: true });
var omnibar_experimental_1 = __webpack_require__(6);
var BBOmnibarScriptLoader = (function () {
function BBOmnibarScriptLoader() {
}
BBOmnibarScriptLoader.registerScript = function (url) {
return new Promise(function (resolve, reject) {
var scriptEl = document.createElement('script');
scriptEl.onload = resolve;
scriptEl.onerror = reject;
scriptEl.src = url;
document.body.appendChild(scriptEl);
});
};
BBOmnibarScriptLoader.smartRegisterScript = function (url, minVersion, currentVersion) {
if (currentVersion && BBOmnibarScriptLoader.isVersionMet(minVersion, currentVersion)) {
return new Promise(function (resolve, reject) {
resolve();
});
}
return BBOmnibarScriptLoader.registerScript(url);
};
BBOmnibarScriptLoader.isVersionMet = function (min, cur) {
var minVersion = BBOmnibarScriptLoader.parseVersionString(min);
var currentVersion = BBOmnibarScriptLoader.parseVersionString(cur);
for (var idx = 0; idx < minVersion.length; idx++) {
if (idx < currentVersion.length) {
if (currentVersion[idx] > minVersion[idx]) {
return true;
}
else if (currentVersion[idx] < minVersion[idx]) {
return false;
}
}
}
return true;
};
BBOmnibarScriptLoader.parseVersionString = function (str) {
var splitVersion = str.split('.');
var parsedVersion = [];
for (var _i = 0, splitVersion_1 = splitVersion; _i < splitVersion_1.length; _i++) {
var num = splitVersion_1[_i];
var versionNum = parseInt(num, 10) || 0;
parsedVersion.push(versionNum);
}
return parsedVersion;
};
return BBOmnibarScriptLoader;
}());
exports.BBOmnibarScriptLoader = BBOmnibarScriptLoader;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var omnibar_experimental_1 = __webpack_require__(7);
var omnibar_script_loader_1 = __webpack_require__(10);
var BBOmnibar = (function () {

@@ -437,17 +528,10 @@ function BBOmnibar() {

return new Promise(function (resolve, reject) {
function registerScript(url) {
return new Promise(function (resolveInner, rejectInner) {
var scriptEl = document.createElement('script');
scriptEl.onload = resolveInner;
scriptEl.onerror = rejectInner;
scriptEl.src = url;
document.body.appendChild(scriptEl);
});
}
registerScript('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js')
var jquery = window.jQuery;
var jqueryVersion = jquery && jquery.fn && jquery.fn.jquery;
omnibar_script_loader_1.BBOmnibarScriptLoader.smartRegisterScript('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js', '2.1.0', jqueryVersion)
.then(function () {
return registerScript('https://cdnjs.cloudflare.com/ajax/libs/easyXDM/2.4.17.1/easyXDM.min.js');
return omnibar_script_loader_1.BBOmnibarScriptLoader.registerScript('https://cdnjs.cloudflare.com/ajax/libs/easyXDM/2.4.17.1/easyXDM.min.js');
})
.then(function () {
return registerScript('https://signin.blackbaud.com/Omnibar.min.js');
return omnibar_script_loader_1.BBOmnibarScriptLoader.registerScript('https://signin.blackbaud.com/Omnibar.min.js');
})

@@ -457,2 +541,3 @@ .then(function () {

var omnibarEl = document.createElement('div');
omnibarEl.setAttribute('data-omnibar-el', '');
document.body.appendChild(omnibarEl);

@@ -471,36 +556,4 @@ config = config || {};

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var HOST_ORIGIN = 'https://host.nxt.blackbaud.com';
var BBAuthInterop = (function () {
function BBAuthInterop() {
}
/* istanbul ignore next */
BBAuthInterop.navigate = function (url) {
location.href = url;
};
/* istanbul ignore next */
BBAuthInterop.postOmnibarMessage = function (iframeEl, message) {
message.source = 'auth-client';
iframeEl.contentWindow.postMessage(message, HOST_ORIGIN);
};
BBAuthInterop.messageIsFromOmnibar = function (event) {
if (event.origin === HOST_ORIGIN) {
var message = event.data;
return !!message && message.source === 'skyux-spa-omnibar';
}
return false;
};
return BBAuthInterop;
}());
exports.BBAuthInterop = BBAuthInterop;
/***/ })
/******/ ]);
});

@@ -0,3 +1,8 @@

# 1.1.0 (2017-04-17)
- Updated logic for loading jQuery so that a newer version of jQuery already loaded onto the page does not get overwritten with an older version required by omnibar. (#8) (Thanks @Blackbaud-RoseWhipple!)
- Added ability to retrieve a mock token for consumers testing non-production code. (#9)
# 1.0.0 (2017-04-11)
- Version 1.0
{
"name": "@blackbaud/auth-client",
"version": "1.0.0",
"version": "1.1.0",
"description": "Provides methods for obtaining an authentication token from the Blackbaud authentication service.",

@@ -30,2 +30,3 @@ "main": "dist/bundles/auth-client.umd.js",

"@types/jasmine": "2.5.47",
"@types/jasmine-ajax": "3.1.35",
"@types/webpack": "2.2.14",

@@ -36,2 +37,3 @@ "core-js": "2.4.1",

"jasmine": "2.5.3",
"jasmine-ajax": "3.3.1",
"karma": "1.5.0",

@@ -38,0 +40,0 @@ "karma-browserstack-launcher": "1.2.0",

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var interop_1 = require("../shared/interop");
var BBAuthTokenIntegration = (function () {

@@ -21,3 +22,3 @@ function BBAuthTokenIntegration(csrfUrl, tokenUrl, signInUrl) {

// Not logged in, so go back to Auth Svc.
location.href = _this.signInUrl + '?redirectUrl=' + encodeURIComponent(location.href);
interop_1.BBAuthInterop.navigate(_this.signInUrl + '?redirectUrl=' + encodeURIComponent(location.href));
});

@@ -42,5 +43,3 @@ });

if (xhr.readyState === 4 && xhr.status === 401) {
if (unuthCB) {
unuthCB();
}
unuthCB();
}

@@ -52,5 +51,3 @@ else if (xhr.readyState === 4 && xhr.status === 200) {

xhr.open('POST', url, true);
if (header) {
xhr.setRequestHeader(header.name, header.value);
}
xhr.setRequestHeader(header.name, header.value);
xhr.setRequestHeader('Accept', 'application/json');

@@ -57,0 +54,0 @@ xhr.withCredentials = true;

export declare class BBAuth {
static mock: boolean;
private static lastToken;

@@ -3,0 +4,0 @@ private static expirationTime;

@@ -8,2 +8,5 @@ "use strict";

BBAuth.getToken = function () {
if (BBAuth.mock) {
return Promise.resolve('mock_access_token_auth-client@blackbaud.com');
}
var tokenInteraction = new auth_token_integration_1.BBAuthTokenIntegration('https://signin.blackbaud.com/api/v2/csrf', 'https://signin.blackbaud.com/api/v2/oauth/token', 'https://signin.blackbaud.com');

@@ -29,3 +32,4 @@ var now = new Date().valueOf();

}());
BBAuth.mock = false;
exports.BBAuth = BBAuth;
//# sourceMappingURL=auth.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var omnibar_experimental_1 = require("./omnibar-experimental");
var omnibar_script_loader_1 = require("./omnibar-script-loader");
var BBOmnibar = (function () {

@@ -12,17 +13,10 @@ function BBOmnibar() {

return new Promise(function (resolve, reject) {
function registerScript(url) {
return new Promise(function (resolveInner, rejectInner) {
var scriptEl = document.createElement('script');
scriptEl.onload = resolveInner;
scriptEl.onerror = rejectInner;
scriptEl.src = url;
document.body.appendChild(scriptEl);
});
}
registerScript('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js')
var jquery = window.jQuery;
var jqueryVersion = jquery && jquery.fn && jquery.fn.jquery;
omnibar_script_loader_1.BBOmnibarScriptLoader.smartRegisterScript('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js', '2.1.0', jqueryVersion)
.then(function () {
return registerScript('https://cdnjs.cloudflare.com/ajax/libs/easyXDM/2.4.17.1/easyXDM.min.js');
return omnibar_script_loader_1.BBOmnibarScriptLoader.registerScript('https://cdnjs.cloudflare.com/ajax/libs/easyXDM/2.4.17.1/easyXDM.min.js');
})
.then(function () {
return registerScript('https://signin.blackbaud.com/Omnibar.min.js');
return omnibar_script_loader_1.BBOmnibarScriptLoader.registerScript('https://signin.blackbaud.com/Omnibar.min.js');
})

@@ -32,2 +26,3 @@ .then(function () {

var omnibarEl = document.createElement('div');
omnibarEl.setAttribute('data-omnibar-el', '');
document.body.appendChild(omnibarEl);

@@ -34,0 +29,0 @@ config = config || {};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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