Comparing version 2.8.7 to 2.8.8
@@ -13,3 +13,3 @@ "use strict"; | ||
if (typeof params.validate !== 'function') { | ||
throw new Error('validate must be a callback function having one arguemnt as xml input'); | ||
throw new Error('validate must be a callback function having one argument as xml input'); | ||
} | ||
@@ -16,0 +16,0 @@ // assign the validate function to the context |
@@ -303,3 +303,3 @@ "use strict"; | ||
}; | ||
if (requestInfo && requestInfo.extract && requestInfo.extract.logoutRequest) { | ||
if (requestInfo && requestInfo.extract && requestInfo.extract.request) { | ||
tvalue.InResponseTo = requestInfo.extract.request.id; | ||
@@ -306,0 +306,0 @@ } |
@@ -99,3 +99,3 @@ "use strict"; | ||
* @private | ||
* @desc Refractored part of simple signature generation for login/logout request | ||
* @desc Refactored part of simple signature generation for login/logout request | ||
* @param {string} type | ||
@@ -102,0 +102,0 @@ * @param {string} rawSamlRequest |
@@ -83,3 +83,3 @@ "use strict"; | ||
/** | ||
* Identity prvider can be configured using either metadata importing or idpSetting | ||
* Identity provider can be configured using either metadata importing or idpSetting | ||
*/ | ||
@@ -91,3 +91,3 @@ function default_1(props) { | ||
/** | ||
* Identity prvider can be configured using either metadata importing or idpSetting | ||
* Identity provider can be configured using either metadata importing or idpSetting | ||
*/ | ||
@@ -94,0 +94,0 @@ var IdentityProvider = /** @class */ (function (_super) { |
@@ -169,2 +169,7 @@ "use strict"; | ||
{ | ||
key: 'sessionIndex', | ||
localPath: ['LogoutRequest', 'SessionIndex'], | ||
attributes: [] | ||
}, | ||
{ | ||
key: 'signature', | ||
@@ -171,0 +176,0 @@ localPath: ['LogoutRequest', 'Signature'], |
@@ -210,3 +210,3 @@ "use strict"; | ||
_d.sent(); | ||
// verify the signatures (the repsonse is encrypted then signed, then verify first then decrypt) | ||
// verify the signatures (the response is encrypted then signed, then verify first then decrypt) | ||
if (checkSignature && | ||
@@ -230,3 +230,3 @@ from.entitySetting.messageSigningOrder === urn_1.MessageSignatureOrder.ETS) { | ||
case 4: | ||
// verify the signatures (the repsonse is signed then encrypted, then decrypt first then verify) | ||
// verify the signatures (the response is signed then encrypted, then decrypt first then verify) | ||
if (checkSignature && | ||
@@ -233,0 +233,0 @@ from.entitySetting.messageSigningOrder === urn_1.MessageSignatureOrder.STE) { |
@@ -143,4 +143,4 @@ "use strict"; | ||
additionalTemplates: { | ||
"attributeStatementTemplate": defaultAttributeStatementTemplate, | ||
"attributeTemplate": defaultAttributeTemplate | ||
'attributeStatementTemplate': defaultAttributeStatementTemplate, | ||
'attributeTemplate': defaultAttributeTemplate | ||
} | ||
@@ -217,3 +217,3 @@ }; | ||
/** | ||
* @desc Repalce the tag (e.g. {tag}) inside the raw XML | ||
* @desc Replace the tag (e.g. {tag}) inside the raw XML | ||
* @param {string} rawXML raw XML string used to do keyword replacement | ||
@@ -232,4 +232,4 @@ * @param {array} tagValues tag values | ||
* @param {LoginResponseAttribute} attributes an array of attribute configuration | ||
* @param {AttributeTemplate} attributeTemplate the attribut tag template to be used | ||
* @param {AttributeStatementTemplate} attributeStatementTemplate the attributStatement tag template to be used | ||
* @param {AttributeTemplate} attributeTemplate the attribute tag template to be used | ||
* @param {AttributeStatementTemplate} attributeStatementTemplate the attributeStatement tag template to be used | ||
* @return {string} | ||
@@ -295,3 +295,2 @@ */ | ||
* @param {string} xml xml | ||
* @param {signature} signature context of XML signature | ||
* @param {SignatureVerifierOptions} opts cert declares the X509 certificate | ||
@@ -544,3 +543,3 @@ * @return {boolean} verification result | ||
else { | ||
return resolve(utility_1.default.base64Encode(xml)); // No need to do encrpytion | ||
return resolve(utility_1.default.base64Encode(xml)); // No need to do encryption | ||
} | ||
@@ -547,0 +546,0 @@ }); |
@@ -17,2 +17,13 @@ "use strict"; | ||
})(); | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -41,2 +52,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var IdpMetadata = /** @class */ (function (_super) { | ||
var e_1, _a, e_2, _b; | ||
__extends(IdpMetadata, _super); | ||
@@ -53,13 +65,27 @@ function IdpMetadata(meta) { | ||
}]; | ||
if (signingCert) { | ||
IDPSSODescriptor_1.push(libsaml_1.default.createKeySection('signing', signingCert)); | ||
try { | ||
for (var _f = __values((0, utility_1.castArrayOpt)(signingCert)), _g = _f.next(); !_g.done; _g = _f.next()) { | ||
var cert = _g.value; | ||
IDPSSODescriptor_1.push(libsaml_1.default.createKeySection('signing', cert)); | ||
} | ||
} | ||
else { | ||
//console.warn('Construct identity provider - missing signing certificate'); | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_g && !_g.done && (_a = _f.return)) _a.call(_f); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
if (encryptCert) { | ||
IDPSSODescriptor_1.push(libsaml_1.default.createKeySection('encryption', encryptCert)); | ||
try { | ||
for (var _h = __values((0, utility_1.castArrayOpt)(encryptCert)), _j = _h.next(); !_j.done; _j = _h.next()) { | ||
var cert = _j.value; | ||
IDPSSODescriptor_1.push(libsaml_1.default.createKeySection('encryption', cert)); | ||
} | ||
} | ||
else { | ||
//console.warn('Construct identity provider - missing encrypt certificate'); | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (_j && !_j.done && (_b = _h.return)) _b.call(_h); | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
@@ -66,0 +92,0 @@ if ((0, utility_1.isNonEmptyArray)(nameIDFormat)) { |
@@ -17,2 +17,13 @@ "use strict"; | ||
})(); | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -44,5 +55,6 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var SpMetadata = /** @class */ (function (_super) { | ||
var e_1, _a, e_2, _b; | ||
__extends(SpMetadata, _super); | ||
/** | ||
* @param {object/string} meta (either xml string or configuation in object) | ||
* @param {object/string} meta (either xml string or configuration in object) | ||
* @return {object} prototypes including public functions | ||
@@ -52,3 +64,3 @@ */ | ||
var isFile = (0, utility_1.isString)(meta) || meta instanceof Buffer; | ||
// use object configuation instead of importing metadata file directly | ||
// use object configuration instead of importing metadata file directly | ||
if (!isFile) { | ||
@@ -73,13 +85,27 @@ var _a = meta, _b = _a.elementsOrder, elementsOrder = _b === void 0 ? urn_1.elementsOrder.default : _b, entityID = _a.entityID, signingCert = _a.signingCert, encryptCert = _a.encryptCert, _c = _a.authnRequestsSigned, authnRequestsSigned = _c === void 0 ? false : _c, _d = _a.wantAssertionsSigned, wantAssertionsSigned = _d === void 0 ? false : _d, _e = _a.wantMessageSigned, wantMessageSigned = _e === void 0 ? false : _e, signatureConfig = _a.signatureConfig, _f = _a.nameIDFormat, nameIDFormat = _f === void 0 ? [] : _f, _g = _a.singleLogoutService, singleLogoutService = _g === void 0 ? [] : _g, _h = _a.assertionConsumerService, assertionConsumerService = _h === void 0 ? [] : _h; | ||
} | ||
if (signingCert) { | ||
descriptors_1.KeyDescriptor.push(libsaml_1.default.createKeySection('signing', signingCert).KeyDescriptor); | ||
try { | ||
for (var _j = __values((0, utility_1.castArrayOpt)(signingCert)), _k = _j.next(); !_k.done; _k = _j.next()) { | ||
var cert = _k.value; | ||
descriptors_1.KeyDescriptor.push(libsaml_1.default.createKeySection('signing', cert).KeyDescriptor); | ||
} | ||
} | ||
else { | ||
//console.warn('Construct service provider - missing signing certificate'); | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_k && !_k.done && (_a = _j.return)) _a.call(_j); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
if (encryptCert) { | ||
descriptors_1.KeyDescriptor.push(libsaml_1.default.createKeySection('encryption', encryptCert).KeyDescriptor); | ||
try { | ||
for (var _l = __values((0, utility_1.castArrayOpt)(encryptCert)), _m = _l.next(); !_m.done; _m = _l.next()) { | ||
var cert = _m.value; | ||
descriptors_1.KeyDescriptor.push(libsaml_1.default.createKeySection('encryption', cert).KeyDescriptor); | ||
} | ||
} | ||
else { | ||
//console.warn('Construct service provider - missing encrypt certificate'); | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (_m && !_m.done && (_b = _l.return)) _b.call(_l); | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
@@ -86,0 +112,0 @@ if ((0, utility_1.isNonEmptyArray)(nameIDFormat)) { |
@@ -37,3 +37,3 @@ "use strict"; | ||
/** | ||
* @param {string | Buffer} metadata xml | ||
* @param {string | Buffer} xml | ||
* @param {object} extraParse for custom metadata extractor | ||
@@ -40,0 +40,0 @@ */ |
@@ -28,3 +28,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.notEmpty = exports.isNonEmptyArray = exports.readPrivateKey = exports.inflateString = exports.base64Decode = exports.isString = exports.get = exports.uniq = exports.last = exports.flattenDeep = exports.zipObject = void 0; | ||
exports.notEmpty = exports.castArrayOpt = exports.isNonEmptyArray = exports.readPrivateKey = exports.inflateString = exports.base64Decode = exports.isString = exports.get = exports.uniq = exports.last = exports.flattenDeep = exports.zipObject = void 0; | ||
/** | ||
@@ -217,3 +217,3 @@ * @file utility.ts | ||
* @desc Read private key from pem-formatted string | ||
* @param {string | Buffer} keyString pem-formattted string | ||
* @param {string | Buffer} keyString pem-formatted string | ||
* @param {string} protected passphrase of the key | ||
@@ -240,2 +240,8 @@ * @return {string} string in pem format | ||
exports.isNonEmptyArray = isNonEmptyArray; | ||
function castArrayOpt(a) { | ||
if (a === undefined) | ||
return []; | ||
return Array.isArray(a) ? a : [a]; | ||
} | ||
exports.castArrayOpt = castArrayOpt; | ||
function notEmpty(value) { | ||
@@ -242,0 +248,0 @@ return value !== null && value !== undefined; |
{ | ||
"name": "samlify", | ||
"version": "2.8.7", | ||
"version": "2.8.8", | ||
"description": "High-level API for Single Sign On (SAML 2.0)", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -19,3 +19,3 @@ // global module configuration | ||
if (typeof params.validate !== 'function') { | ||
throw new Error('validate must be a callback function having one arguemnt as xml input'); | ||
throw new Error('validate must be a callback function having one argument as xml input'); | ||
} | ||
@@ -26,2 +26,2 @@ | ||
} | ||
} |
@@ -11,3 +11,2 @@ /** | ||
import utility, { get } from './utility'; | ||
import { LogoutResponseTemplate } from './libsaml'; | ||
@@ -149,3 +148,3 @@ const binding = wording.binding; | ||
transformationAlgorithms: spSetting.transformationAlgorithms, | ||
referenceTagXPath: "/*[local-name(.)='Response']/*[local-name(.)='Assertion']", | ||
referenceTagXPath: "/*[local-name(.)='Response']/*[local-name(.)='Assertion']", | ||
signatureConfig: { | ||
@@ -320,3 +319,3 @@ prefix: 'ds', | ||
} | ||
} | ||
} | ||
}), | ||
@@ -323,0 +322,0 @@ }; |
@@ -304,3 +304,3 @@ /** | ||
}; | ||
if (requestInfo && requestInfo.extract && requestInfo.extract.logoutRequest) { | ||
if (requestInfo && requestInfo.extract && requestInfo.extract.request) { | ||
tvalue.InResponseTo = requestInfo.extract.request.id; | ||
@@ -307,0 +307,0 @@ } |
@@ -42,3 +42,3 @@ /** | ||
* @private | ||
* @desc Refractored part of simple signature generation for login/logout request | ||
* @desc Refactored part of simple signature generation for login/logout request | ||
* @param {string} type | ||
@@ -65,6 +65,6 @@ * @param {string} rawSamlRequest | ||
return libsaml.constructMessageSignature( | ||
queryParam + '=' + octetString, | ||
entitySetting.privateKey, | ||
entitySetting.privateKeyPass, | ||
undefined, | ||
queryParam + '=' + octetString, | ||
entitySetting.privateKey, | ||
entitySetting.privateKeyPass, | ||
undefined, | ||
entitySetting.requestSignatureAlgorithm | ||
@@ -71,0 +71,0 @@ ).toString(); |
@@ -23,3 +23,3 @@ /** | ||
/** | ||
* Identity prvider can be configured using either metadata importing or idpSetting | ||
* Identity provider can be configured using either metadata importing or idpSetting | ||
*/ | ||
@@ -31,3 +31,3 @@ export default function(props: IdentityProviderSettings) { | ||
/** | ||
* Identity prvider can be configured using either metadata importing or idpSetting | ||
* Identity provider can be configured using either metadata importing or idpSetting | ||
*/ | ||
@@ -34,0 +34,0 @@ export class IdentityProvider extends Entity { |
@@ -169,2 +169,7 @@ import { DOMParser } from '@xmldom/xmldom'; | ||
{ | ||
key: 'sessionIndex', | ||
localPath: ['LogoutRequest', 'SessionIndex'], | ||
attributes: [] | ||
}, | ||
{ | ||
key: 'signature', | ||
@@ -171,0 +176,0 @@ localPath: ['LogoutRequest', 'Signature'], |
@@ -1,2 +0,2 @@ | ||
import { inflateString, base64Decode, isNonEmptyArray } from './utility'; | ||
import { inflateString, base64Decode } from './utility'; | ||
import { verifyTime } from './validator'; | ||
@@ -22,3 +22,2 @@ import libsaml from './libsaml'; | ||
} from './urn'; | ||
import simpleSignBinding from './binding-simplesign'; | ||
@@ -114,3 +113,3 @@ const bindDict = wording.binding; | ||
// put the below two assignemnts into verifyMessageSignature function | ||
// put the below two assignments into verifyMessageSignature function | ||
const base64Signature = Buffer.from(decodeURIComponent(signature), 'base64'); | ||
@@ -130,3 +129,3 @@ const decodeSigAlg = decodeURIComponent(sigAlg); | ||
/** | ||
* Validation part: validate the context of response after signature is verified and decrpyted (optional) | ||
* Validation part: validate the context of response after signature is verified and decrypted (optional) | ||
*/ | ||
@@ -213,3 +212,3 @@ const issuer = targetEntityMetadata.getEntityID(); | ||
// verify the signatures (the repsonse is encrypted then signed, then verify first then decrypt) | ||
// verify the signatures (the response is encrypted then signed, then verify first then decrypt) | ||
if ( | ||
@@ -234,3 +233,3 @@ checkSignature && | ||
// verify the signatures (the repsonse is signed then encrypted, then decrypt first then verify) | ||
// verify the signatures (the response is signed then encrypted, then decrypt first then verify) | ||
if ( | ||
@@ -254,3 +253,3 @@ checkSignature && | ||
/** | ||
* Validation part: validate the context of response after signature is verified and decrpyted (optional) | ||
* Validation part: validate the context of response after signature is verified and decrypted (optional) | ||
*/ | ||
@@ -364,3 +363,3 @@ const targetEntityMetadata = from.entityMeta; | ||
// put the below two assignemnts into verifyMessageSignature function | ||
// put the below two assignments into verifyMessageSignature function | ||
const base64Signature = Buffer.from(signature, 'base64'); | ||
@@ -379,3 +378,3 @@ | ||
/** | ||
* Validation part: validate the context of response after signature is verified and decrpyted (optional) | ||
* Validation part: validate the context of response after signature is verified and decrypted (optional) | ||
*/ | ||
@@ -382,0 +381,0 @@ const issuer = targetEntityMetadata.getEntityID(); |
@@ -178,4 +178,4 @@ /** | ||
additionalTemplates: { | ||
"attributeStatementTemplate": defaultAttributeStatementTemplate, | ||
"attributeTemplate": defaultAttributeTemplate | ||
'attributeStatementTemplate': defaultAttributeStatementTemplate, | ||
'attributeTemplate': defaultAttributeTemplate | ||
} | ||
@@ -256,3 +256,3 @@ }; | ||
/** | ||
* @desc Repalce the tag (e.g. {tag}) inside the raw XML | ||
* @desc Replace the tag (e.g. {tag}) inside the raw XML | ||
* @param {string} rawXML raw XML string used to do keyword replacement | ||
@@ -271,4 +271,4 @@ * @param {array} tagValues tag values | ||
* @param {LoginResponseAttribute} attributes an array of attribute configuration | ||
* @param {AttributeTemplate} attributeTemplate the attribut tag template to be used | ||
* @param {AttributeStatementTemplate} attributeStatementTemplate the attributStatement tag template to be used | ||
* @param {AttributeTemplate} attributeTemplate the attribute tag template to be used | ||
* @param {AttributeStatementTemplate} attributeStatementTemplate the attributeStatement tag template to be used | ||
* @return {string} | ||
@@ -357,3 +357,2 @@ */ | ||
* @param {string} xml xml | ||
* @param {signature} signature context of XML signature | ||
* @param {SignatureVerifierOptions} opts cert declares the X509 certificate | ||
@@ -646,3 +645,3 @@ * @return {boolean} verification result | ||
} else { | ||
return resolve(utility.base64Encode(xml)); // No need to do encrpytion | ||
return resolve(utility.base64Encode(xml)); // No need to do encryption | ||
} | ||
@@ -649,0 +648,0 @@ }); |
@@ -10,3 +10,3 @@ /** | ||
import libsaml from './libsaml'; | ||
import { isNonEmptyArray, isString } from './utility'; | ||
import { castArrayOpt, isNonEmptyArray, isString } from './utility'; | ||
import xml from 'xml'; | ||
@@ -50,12 +50,8 @@ | ||
if (signingCert) { | ||
IDPSSODescriptor.push(libsaml.createKeySection('signing', signingCert)); | ||
} else { | ||
//console.warn('Construct identity provider - missing signing certificate'); | ||
for(const cert of castArrayOpt(signingCert)) { | ||
IDPSSODescriptor.push(libsaml.createKeySection('signing', cert)); | ||
} | ||
if (encryptCert) { | ||
IDPSSODescriptor.push(libsaml.createKeySection('encryption', encryptCert)); | ||
} else { | ||
//console.warn('Construct identity provider - missing encrypt certificate'); | ||
for(const cert of castArrayOpt(encryptCert)) { | ||
IDPSSODescriptor.push(libsaml.createKeySection('encryption', cert)); | ||
} | ||
@@ -62,0 +58,0 @@ |
@@ -10,3 +10,3 @@ /** | ||
import libsaml from './libsaml'; | ||
import { isNonEmptyArray, isString } from './utility'; | ||
import { castArrayOpt, isNonEmptyArray, isString } from './utility'; | ||
import xml from 'xml'; | ||
@@ -40,3 +40,3 @@ | ||
/** | ||
* @param {object/string} meta (either xml string or configuation in object) | ||
* @param {object/string} meta (either xml string or configuration in object) | ||
* @return {object} prototypes including public functions | ||
@@ -48,3 +48,3 @@ */ | ||
// use object configuation instead of importing metadata file directly | ||
// use object configuration instead of importing metadata file directly | ||
if (!isFile) { | ||
@@ -86,12 +86,8 @@ | ||
if (signingCert) { | ||
descriptors.KeyDescriptor!.push(libsaml.createKeySection('signing', signingCert).KeyDescriptor); | ||
} else { | ||
//console.warn('Construct service provider - missing signing certificate'); | ||
for(const cert of castArrayOpt(signingCert)) { | ||
descriptors.KeyDescriptor!.push(libsaml.createKeySection('signing', cert).KeyDescriptor); | ||
} | ||
if (encryptCert) { | ||
descriptors.KeyDescriptor!.push(libsaml.createKeySection('encryption', encryptCert).KeyDescriptor); | ||
} else { | ||
//console.warn('Construct service provider - missing encrypt certificate'); | ||
for(const cert of castArrayOpt(encryptCert)) { | ||
descriptors.KeyDescriptor!.push(libsaml.createKeySection('encryption', cert).KeyDescriptor); | ||
} | ||
@@ -98,0 +94,0 @@ |
@@ -28,3 +28,3 @@ /** | ||
/** | ||
* @param {string | Buffer} metadata xml | ||
* @param {string | Buffer} xml | ||
* @param {object} extraParse for custom metadata extractor | ||
@@ -144,3 +144,3 @@ */ | ||
} | ||
const service = singleLogoutService.find(obj => obj.binding === bindType); | ||
const service = singleLogoutService.find(obj => obj.binding === bindType); | ||
if (service) { | ||
@@ -147,0 +147,0 @@ return service.location; |
@@ -19,4 +19,4 @@ import { LoginResponseTemplate } from './libsaml'; | ||
entityID?: string; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
wantAuthnRequestsSigned?: boolean; | ||
@@ -35,4 +35,4 @@ nameIDFormat?: string[]; | ||
entityID?: string; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
authnRequestsSigned?: boolean; | ||
@@ -86,4 +86,4 @@ wantAssertionsSigned?: boolean; | ||
logoutRequestTemplate?: SAMLDocumentTemplate; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
transformationAlgorithms?: string[]; | ||
@@ -116,4 +116,4 @@ nameIDFormat?: string[]; | ||
privateKeyPass?: string; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; /** todo */ | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
nameIDFormat?: string[]; | ||
@@ -120,0 +120,0 @@ singleSignOnService?: SSOService[]; |
@@ -18,3 +18,3 @@ /** | ||
return arr1.reduce((res, l, i) => { | ||
if (skipDuplicated) { | ||
@@ -65,7 +65,7 @@ res[l] = arr2[i]; | ||
/** | ||
* @desc Alternative to lodash.get | ||
* @desc Alternative to lodash.get | ||
* @reference https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get | ||
* @param obj | ||
* @param path | ||
* @param defaultValue | ||
* @param obj | ||
* @param path | ||
* @param defaultValue | ||
*/ | ||
@@ -77,4 +77,4 @@ export function get(obj, path, defaultValue) { | ||
/** | ||
* @desc Check if the input is string | ||
* @param {any} input | ||
* @desc Check if the input is string | ||
* @param {any} input | ||
*/ | ||
@@ -186,3 +186,3 @@ export function isString(input: any) { | ||
* @desc Read private key from pem-formatted string | ||
* @param {string | Buffer} keyString pem-formattted string | ||
* @param {string | Buffer} keyString pem-formatted string | ||
* @param {string} protected passphrase of the key | ||
@@ -208,2 +208,7 @@ * @return {string} string in pem format | ||
export function castArrayOpt<T>(a?: T | T[]): T[] { | ||
if (a === undefined) return [] | ||
return Array.isArray(a) ? a : [a] | ||
} | ||
export function notEmpty<TValue>(value: TValue | null | undefined): value is TValue { | ||
@@ -210,0 +215,0 @@ return value !== null && value !== undefined; |
@@ -11,7 +11,7 @@ /** | ||
/** | ||
* Identity prvider can be configured using either metadata importing or idpSetting | ||
* Identity provider can be configured using either metadata importing or idpSetting | ||
*/ | ||
export default function (props: IdentityProviderSettings): IdentityProvider; | ||
/** | ||
* Identity prvider can be configured using either metadata importing or idpSetting | ||
* Identity provider can be configured using either metadata importing or idpSetting | ||
*/ | ||
@@ -18,0 +18,0 @@ export declare class IdentityProvider extends Entity { |
@@ -119,3 +119,3 @@ /** | ||
/** | ||
* @desc Repalce the tag (e.g. {tag}) inside the raw XML | ||
* @desc Replace the tag (e.g. {tag}) inside the raw XML | ||
* @param {string} rawXML raw XML string used to do keyword replacement | ||
@@ -129,4 +129,4 @@ * @param {array} tagValues tag values | ||
* @param {LoginResponseAttribute} attributes an array of attribute configuration | ||
* @param {AttributeTemplate} attributeTemplate the attribut tag template to be used | ||
* @param {AttributeStatementTemplate} attributeStatementTemplate the attributStatement tag template to be used | ||
* @param {AttributeTemplate} attributeTemplate the attribute tag template to be used | ||
* @param {AttributeStatementTemplate} attributeStatementTemplate the attributeStatement tag template to be used | ||
* @return {string} | ||
@@ -150,3 +150,2 @@ */ | ||
* @param {string} xml xml | ||
* @param {signature} signature context of XML signature | ||
* @param {SignatureVerifierOptions} opts cert declares the X509 certificate | ||
@@ -153,0 +152,0 @@ * @return {boolean} verification result |
@@ -16,3 +16,3 @@ /** | ||
/** | ||
* @param {object/string} meta (either xml string or configuation in object) | ||
* @param {object/string} meta (either xml string or configuration in object) | ||
* @return {object} prototypes including public functions | ||
@@ -19,0 +19,0 @@ */ |
@@ -16,3 +16,3 @@ /// <reference types="node" /> | ||
/** | ||
* @param {string | Buffer} metadata xml | ||
* @param {string | Buffer} xml | ||
* @param {object} extraParse for custom metadata extractor | ||
@@ -19,0 +19,0 @@ */ |
@@ -15,4 +15,4 @@ /// <reference types="node" /> | ||
entityID?: string; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
wantAuthnRequestsSigned?: boolean; | ||
@@ -27,4 +27,4 @@ nameIDFormat?: string[]; | ||
entityID?: string; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
authnRequestsSigned?: boolean; | ||
@@ -73,4 +73,4 @@ wantAssertionsSigned?: boolean; | ||
logoutRequestTemplate?: SAMLDocumentTemplate; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
transformationAlgorithms?: string[]; | ||
@@ -95,4 +95,4 @@ nameIDFormat?: string[]; | ||
privateKeyPass?: string; | ||
signingCert?: string | Buffer; | ||
encryptCert?: string | Buffer; /** todo */ | ||
signingCert?: string | Buffer | (string | Buffer)[]; | ||
encryptCert?: string | Buffer | (string | Buffer)[]; | ||
nameIDFormat?: string[]; | ||
@@ -99,0 +99,0 @@ singleSignOnService?: SSOService[]; |
@@ -103,3 +103,3 @@ /// <reference types="node" /> | ||
* @desc Read private key from pem-formatted string | ||
* @param {string | Buffer} keyString pem-formattted string | ||
* @param {string | Buffer} keyString pem-formatted string | ||
* @param {string} protected passphrase of the key | ||
@@ -118,2 +118,3 @@ * @return {string} string in pem format | ||
export declare function isNonEmptyArray(a: any): boolean; | ||
export declare function castArrayOpt<T>(a?: T | T[]): T[]; | ||
export declare function notEmpty<TValue>(value: TValue | null | undefined): value is TValue; | ||
@@ -120,0 +121,0 @@ declare const utility: { |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
493202
9083