Comparing version 2.5.0-rc4 to 2.5.0
@@ -71,3 +71,3 @@ "use strict"; | ||
var rawSamlRequest = void 0; | ||
if (spSetting.loginRequestTemplate) { | ||
if (spSetting.loginRequestTemplate && customTagReplacement) { | ||
var info = customTagReplacement(spSetting.loginRequestTemplate.context); | ||
@@ -172,3 +172,3 @@ id = utility_1.get(info, 'id', null); | ||
}; | ||
if (idpSetting.loginResponseTemplate) { | ||
if (idpSetting.loginResponseTemplate && customTagReplacement) { | ||
template = customTagReplacement(idpSetting.loginResponseTemplate.context); | ||
@@ -194,3 +194,3 @@ rawSamlResponse = utility_1.get(template, 'context', null); | ||
// console.debug('sp wants assertion signed'); | ||
rawSamlResponse = libsaml_1.default.constructSAMLSignature(__assign({}, config, { rawSamlMessage: rawSamlResponse, referenceTagXPath: "/*[local-name(.)='Response']/*[local-name(.)='Assertion']", signatureConfig: { | ||
rawSamlResponse = libsaml_1.default.constructSAMLSignature(__assign({}, config, { rawSamlMessage: rawSamlResponse, transformationAlgorithms: spSetting.transformationAlgorithms, referenceTagXPath: "/*[local-name(.)='Response']/*[local-name(.)='Assertion']", signatureConfig: { | ||
prefix: 'ds', | ||
@@ -252,3 +252,3 @@ location: { reference: "/*[local-name(.)='Response']/*[local-name(.)='Assertion']/*[local-name(.)='Issuer']", action: 'after' }, | ||
var rawSamlRequest = void 0; | ||
if (initSetting.logoutRequestTemplate) { | ||
if (initSetting.logoutRequestTemplate && customTagReplacement) { | ||
var template = customTagReplacement(initSetting.logoutRequestTemplate.context); | ||
@@ -255,0 +255,0 @@ id = utility_1.get(template, 'id', null); |
@@ -47,3 +47,3 @@ "use strict"; | ||
var octetString = samlRequest + relayState + sigAlg; | ||
return baseUrl + pvPair(queryParam, octetString, noParams) + pvPair(urlParams.signature, encodeURIComponent(libsaml_1.default.constructMessageSignature(queryParam + '=' + octetString, entitySetting.privateKey, entitySetting.privateKeyPass, null, entitySetting.requestSignatureAlgorithm))); | ||
return baseUrl + pvPair(queryParam, octetString, noParams) + pvPair(urlParams.signature, encodeURIComponent(libsaml_1.default.constructMessageSignature(queryParam + '=' + octetString, entitySetting.privateKey, entitySetting.privateKeyPass, undefined, entitySetting.requestSignatureAlgorithm))); | ||
} | ||
@@ -65,3 +65,3 @@ return baseUrl + pvPair(queryParam, samlRequest + relayState, noParams); | ||
var rawSamlRequest = void 0; | ||
if (spSetting.loginRequestTemplate) { | ||
if (spSetting.loginRequestTemplate && customTagReplacement) { | ||
var info = customTagReplacement(spSetting.loginRequestTemplate); | ||
@@ -122,3 +122,3 @@ id = utility_1.get(info, 'id', null); | ||
}; | ||
if (initSetting.logoutRequestTemplate) { | ||
if (initSetting.logoutRequestTemplate && customTagReplacement) { | ||
var info = customTagReplacement(initSetting.logoutRequestTemplate, requiredTags); | ||
@@ -161,3 +161,3 @@ id = utility_1.get(info, 'id', null); | ||
var rawSamlResponse = void 0; | ||
if (initSetting.logoutResponseTemplate) { | ||
if (initSetting.logoutResponseTemplate && customTagReplacement) { | ||
var template = customTagReplacement(initSetting.logoutResponseTemplate); | ||
@@ -164,0 +164,0 @@ id = utility_1.get(template, 'id', null); |
@@ -210,3 +210,3 @@ "use strict"; | ||
.join(' | '); | ||
return __assign({}, result, (_a = {}, _a[key] = utility_1.uniq(xpath_1.select(multiXPaths, targetDoc).map(function (n) { return n.nodeValue; })), _a)); | ||
return __assign({}, result, (_a = {}, _a[key] = utility_1.uniq(xpath_1.select(multiXPaths, targetDoc).map(function (n) { return n.nodeValue; }).filter(utility_1.notEmpty)), _a)); | ||
} | ||
@@ -213,0 +213,0 @@ // eo special case: multiple path |
@@ -117,5 +117,7 @@ "use strict"; | ||
function getSigningScheme(sigAlg) { | ||
var algAlias = nrsaAliasMapping[sigAlg]; | ||
if (!(algAlias === undefined)) { | ||
return algAlias; | ||
if (sigAlg) { | ||
var algAlias = nrsaAliasMapping[sigAlg]; | ||
if (!(algAlias === undefined)) { | ||
return algAlias; | ||
} | ||
} | ||
@@ -122,0 +124,0 @@ return nrsaAliasMapping[signatureAlgorithms.RSA_SHA1]; // default value |
@@ -113,3 +113,3 @@ "use strict"; | ||
Metadata.prototype.getSingleLogoutService = function (binding) { | ||
if (utility_1.isString(binding)) { | ||
if (binding && utility_1.isString(binding)) { | ||
var bindType_1 = urn_1.namespace.binding[binding]; | ||
@@ -116,0 +116,0 @@ var singleLogoutService = this.meta.singleLogoutService; |
@@ -63,3 +63,3 @@ "use strict"; | ||
|| moduleResolver(SchemaValidators.LIBXML) | ||
|| moduleResolver(SchemaValidators.XMLLINT); | ||
|| moduleResolver(SchemaValidators.XMLLINT) || ''; | ||
xsd = 'saml-schema-protocol-2.0.xsd'; | ||
@@ -66,0 +66,0 @@ if (!(selectedValidator === SchemaValidators.JAVAC)) return [3 /*break*/, 2]; |
@@ -217,2 +217,6 @@ "use strict"; | ||
exports.isNonEmptyArray = isNonEmptyArray; | ||
function notEmpty(value) { | ||
return value !== null && value !== undefined; | ||
} | ||
exports.notEmpty = notEmpty; | ||
var utility = { | ||
@@ -219,0 +223,0 @@ isString: isString, |
{ | ||
"name": "samlify", | ||
"version": "2.5.0-rc4", | ||
"version": "2.5.0", | ||
"description": "High-level API for Single Sign On (SAML 2.0)", | ||
@@ -36,3 +36,2 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@authenio/xml-encryption": "^0.11.2", | ||
"camelcase": "^5.2.0", | ||
@@ -48,2 +47,7 @@ "deflate-js": "^0.2.3", | ||
}, | ||
"optionalDependencies": { | ||
"@authenio/xml-encryption": "^0.11.2", | ||
"libxml-xsd": "^0.5.2", | ||
"node-xmllint": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -50,0 +54,0 @@ "@types/camelcase": "^5.2.0", |
@@ -21,8 +21,4 @@ # samlify · | ||
Starting from v2.5, schema validation becomes selectable and optional, we restrict to apply it in your production environment, you can only ignore schema validation in development mode. When you install samlify in your current project, please assign the environment variable `SAML_VALIDATOR` to either `javac`, `xmllint` or `libxml`. | ||
Starting from v2.5, multiple schema validators have become available. All three of `@authenio/xsd-schema-validator`, `libxml-xsd` and `node-xmllint`are included as 'optional' dependencies, and will be preferentially used in that order. If one has failed to install, the next in the list will be used. | ||
```console | ||
$ SAML_VALIDATOR=javac yarn add samlify | ||
``` | ||
For those using Windows, `windows-build-tools` should be installed globally before installing samlify if you are using `libxml` validator. | ||
@@ -29,0 +25,0 @@ |
@@ -21,3 +21,3 @@ /** | ||
*/ | ||
function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext { | ||
function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext { | ||
const metadata = { idp: entity.idp.entityMeta, sp: entity.sp.entityMeta }; | ||
@@ -30,3 +30,3 @@ const spSetting = entity.sp.entitySetting; | ||
let rawSamlRequest: string; | ||
if (spSetting.loginRequestTemplate) { | ||
if (spSetting.loginRequestTemplate && customTagReplacement) { | ||
const info = customTagReplacement(spSetting.loginRequestTemplate.context); | ||
@@ -83,3 +83,3 @@ id = get(info, 'id', null); | ||
*/ | ||
async function base64LoginResponse(requestInfo: any = {}, entity: any, user: any = {}, customTagReplacement: (template: string) => BindingContext, encryptThenSign: boolean = false): Promise<BindingContext> { | ||
async function base64LoginResponse(requestInfo: any = {}, entity: any, user: any = {}, customTagReplacement?: (template: string) => BindingContext, encryptThenSign: boolean = false): Promise<BindingContext> { | ||
const idpSetting = entity.idp.entitySetting; | ||
@@ -123,3 +123,3 @@ const spSetting = entity.sp.entitySetting; | ||
}; | ||
if (idpSetting.loginResponseTemplate) { | ||
if (idpSetting.loginResponseTemplate && customTagReplacement) { | ||
const template = customTagReplacement(idpSetting.loginResponseTemplate.context); | ||
@@ -147,2 +147,3 @@ rawSamlResponse = get(template, 'context', null); | ||
rawSamlMessage: rawSamlResponse, | ||
transformationAlgorithms: spSetting.transformationAlgorithms, | ||
referenceTagXPath: "/*[local-name(.)='Response']/*[local-name(.)='Assertion']", | ||
@@ -222,3 +223,3 @@ signatureConfig: { | ||
let rawSamlRequest: string; | ||
if (initSetting.logoutRequestTemplate) { | ||
if (initSetting.logoutRequestTemplate && customTagReplacement) { | ||
const template = customTagReplacement(initSetting.logoutRequestTemplate.context); | ||
@@ -225,0 +226,0 @@ id = get(template, 'id', null); |
@@ -65,3 +65,3 @@ /** | ||
const octetString = samlRequest + relayState + sigAlg; | ||
return baseUrl + pvPair(queryParam, octetString, noParams) + pvPair(urlParams.signature, encodeURIComponent(libsaml.constructMessageSignature(queryParam + '=' + octetString, entitySetting.privateKey, entitySetting.privateKeyPass, null, entitySetting.requestSignatureAlgorithm))); | ||
return baseUrl + pvPair(queryParam, octetString, noParams) + pvPair(urlParams.signature, encodeURIComponent(libsaml.constructMessageSignature(queryParam + '=' + octetString, entitySetting.privateKey, entitySetting.privateKeyPass, undefined, entitySetting.requestSignatureAlgorithm))); | ||
} | ||
@@ -85,3 +85,3 @@ return baseUrl + pvPair(queryParam, samlRequest + relayState, noParams); | ||
let rawSamlRequest: string; | ||
if (spSetting.loginRequestTemplate) { | ||
if (spSetting.loginRequestTemplate && customTagReplacement) { | ||
const info = customTagReplacement(spSetting.loginRequestTemplate); | ||
@@ -141,3 +141,3 @@ id = get(info, 'id', null); | ||
}; | ||
if (initSetting.logoutRequestTemplate) { | ||
if (initSetting.logoutRequestTemplate && customTagReplacement) { | ||
const info = customTagReplacement(initSetting.logoutRequestTemplate, requiredTags); | ||
@@ -179,3 +179,3 @@ id = get(info, 'id', null); | ||
let rawSamlResponse: string; | ||
if (initSetting.logoutResponseTemplate) { | ||
if (initSetting.logoutResponseTemplate && customTagReplacement) { | ||
const template = customTagReplacement(initSetting.logoutResponseTemplate); | ||
@@ -182,0 +182,0 @@ id = get(template, 'id', null); |
@@ -18,2 +18,3 @@ /** | ||
import { isString } from './utility'; | ||
import { BindingContext } from './entity'; | ||
@@ -50,3 +51,3 @@ /** | ||
...entitySetting.loginResponseTemplate, | ||
context: libsaml.replaceTagsByValue(entitySetting.loginResponseTemplate.context, replacement), | ||
context: libsaml.replaceTagsByValue(entitySetting.loginResponseTemplate!.context, replacement), | ||
}; | ||
@@ -74,3 +75,3 @@ } else { | ||
user: { [key: string]: any }, | ||
customTagReplacement?: (...args: any[]) => any, | ||
customTagReplacement?: (template: string) => BindingContext, | ||
encryptThenSign?: boolean, | ||
@@ -77,0 +78,0 @@ ) { |
@@ -58,3 +58,3 @@ /** | ||
binding = 'redirect', | ||
customTagReplacement?: (...args: any[]) => any, | ||
customTagReplacement?: (template: string) => BindingContext, | ||
): BindingContext | PostBindingContext { | ||
@@ -61,0 +61,0 @@ const nsBinding = namespace.binding; |
import { DOMParser } from 'xmldom'; | ||
import { select } from 'xpath'; | ||
import { uniq, last, zipObject } from './utility'; | ||
import { select, SelectedValue } from 'xpath'; | ||
import { uniq, last, zipObject, notEmpty } from './utility'; | ||
import camelCase from 'camelcase'; | ||
@@ -222,3 +222,3 @@ const dom = DOMParser; | ||
...result, | ||
[key]: uniq(select(multiXPaths, targetDoc).map((n: Node) => n.nodeValue)) | ||
[key]: uniq(select(multiXPaths, targetDoc).map((n: Node) => n.nodeValue).filter(notEmpty)) | ||
}; | ||
@@ -289,3 +289,3 @@ } | ||
const node = select(baseXPath, targetDoc); | ||
let value = null; | ||
let value: string | string[] | null = null; | ||
if (node.length === 1) { | ||
@@ -352,3 +352,3 @@ value = node[0].toString(); | ||
if (attributes.length === 0) { | ||
let attributeValue = null; | ||
let attributeValue: SelectedValue[] | Array<(string | null)> | null = null; | ||
const node = select(baseXPath, targetDoc); | ||
@@ -360,3 +360,3 @@ if (node.length === 1) { | ||
if (node.length > 1) { | ||
attributeValue = node.map((n: Node) => n.firstChild.nodeValue); | ||
attributeValue = node.map((n: Node) => n.firstChild!.nodeValue); | ||
} | ||
@@ -363,0 +363,0 @@ return { |
@@ -83,3 +83,3 @@ import { inflateString, base64Decode } from './utility'; | ||
const parseResult: { samlContent: string, extract: any, sigAlg: string } = { | ||
const parseResult: { samlContent: string, extract: any, sigAlg: (string | null) } = { | ||
samlContent: xmlString, | ||
@@ -139,3 +139,3 @@ sigAlg: null, | ||
let extractorFields = []; | ||
let extractorFields: ExtractorFields = []; | ||
@@ -142,0 +142,0 @@ // validate the xml first |
@@ -10,3 +10,3 @@ /** | ||
import { algorithms, wording, namespace } from './urn'; | ||
import { select } from 'xpath'; | ||
import { select, SelectedValue } from 'xpath'; | ||
import { MetadataInterface } from './metadata'; | ||
@@ -17,3 +17,3 @@ import * as nrsa from 'node-rsa'; | ||
import { extract } from './extractor'; | ||
import { getValidatorModule } from './schema-validator'; | ||
import { getValidatorModule, SchemaValidator } from './schema-validator'; | ||
import camelCase from 'camelcase'; | ||
@@ -163,5 +163,7 @@ | ||
function getSigningScheme(sigAlg?: string): string | null { | ||
const algAlias = nrsaAliasMapping[sigAlg]; | ||
if (!(algAlias === undefined)) { | ||
return algAlias; | ||
if (sigAlg) { | ||
const algAlias = nrsaAliasMapping[sigAlg]; | ||
if (!(algAlias === undefined)) { | ||
return algAlias; | ||
} | ||
} | ||
@@ -318,4 +320,4 @@ return nrsaAliasMapping[signatureAlgorithms.RSA_SHA1]; // default value | ||
// select the signature node | ||
let selection = []; | ||
let assertionNode = null; | ||
let selection: any = []; | ||
let assertionNode: string | null = null; | ||
const messageSignatureNode = select(messageSignatureXpath, doc); | ||
@@ -355,3 +357,3 @@ const assertionSignatureNode = select(assertionSignatureXpath, doc); | ||
// flattens the nested array of Certificates from each KeyDescriptor | ||
metadataCert = flattenDeep(metadataCert as []); | ||
metadataCert = flattenDeep(metadataCert); | ||
} | ||
@@ -518,3 +520,3 @@ metadataCert = metadataCert.map(utility.normalizeCerString); | ||
*/ | ||
encryptAssertion(sourceEntity, targetEntity, xml: string) { | ||
encryptAssertion(sourceEntity, targetEntity, xml?: string) { | ||
// Implement encryption after signature if it has | ||
@@ -608,3 +610,3 @@ return new Promise<string>((resolve, reject) => { | ||
try { | ||
await mod.validate(input); | ||
await mod!.validate(input); | ||
return Promise.resolve(); | ||
@@ -619,5 +621,5 @@ } catch (e) { | ||
// load the validator module before the function runtime | ||
let mod = null; | ||
let mod: SchemaValidator | null = null; | ||
(async () => mod = await getValidatorModule())(); | ||
export default libSaml(); |
@@ -84,3 +84,3 @@ /** | ||
if (signingCert) { | ||
descriptors.KeyDescriptor.push(libsaml.createKeySection('signing', signingCert).KeyDescriptor); | ||
descriptors.KeyDescriptor!.push(libsaml.createKeySection('signing', signingCert).KeyDescriptor); | ||
} else { | ||
@@ -91,3 +91,3 @@ //console.warn('Construct service provider - missing signing certificate'); | ||
if (encryptCert) { | ||
descriptors.KeyDescriptor.push(libsaml.createKeySection('encryption', encryptCert).KeyDescriptor); | ||
descriptors.KeyDescriptor!.push(libsaml.createKeySection('encryption', encryptCert).KeyDescriptor); | ||
} else { | ||
@@ -98,3 +98,3 @@ //console.warn('Construct service provider - missing encrypt certificate'); | ||
if (isNonEmptyArray(nameIDFormat)) { | ||
nameIDFormat.forEach(f => descriptors.NameIDFormat.push(f)); | ||
nameIDFormat.forEach(f => descriptors.NameIDFormat!.push(f)); | ||
} | ||
@@ -113,3 +113,3 @@ | ||
} | ||
descriptors.SingleLogoutService.push([{ _attr: attr }]); | ||
descriptors.SingleLogoutService!.push([{ _attr: attr }]); | ||
}); | ||
@@ -129,3 +129,3 @@ } | ||
} | ||
descriptors.AssertionConsumerService.push([{ _attr: attr }]); | ||
descriptors.AssertionConsumerService!.push([{ _attr: attr }]); | ||
}); | ||
@@ -132,0 +132,0 @@ } else { |
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
constructor(xml: string | Buffer, extraParse = []) { | ||
constructor(xml: string | Buffer, extraParse: any = []) { | ||
this.xmlString = xml.toString(); | ||
@@ -138,3 +138,3 @@ this.meta = extract(this.xmlString, extraParse.concat([ | ||
public getSingleLogoutService(binding: string | undefined): string | object { | ||
if (isString(binding)) { | ||
if (binding && isString(binding)) { | ||
const bindType = namespace.binding[binding]; | ||
@@ -141,0 +141,0 @@ let singleLogoutService = this.meta.singleLogoutService; |
@@ -10,3 +10,3 @@ import * as fs from 'fs'; | ||
interface SchemaValidator { | ||
export interface SchemaValidator { | ||
validate: (xml: string) => Promise<string>; | ||
@@ -30,3 +30,3 @@ } | ||
|| moduleResolver(SchemaValidators.LIBXML) | ||
|| moduleResolver(SchemaValidators.XMLLINT); | ||
|| moduleResolver(SchemaValidators.XMLLINT) || ''; | ||
@@ -33,0 +33,0 @@ const xsd = 'saml-schema-protocol-2.0.xsd'; |
@@ -85,2 +85,3 @@ import { LoginResponseTemplate } from './libsaml'; | ||
encryptCert?: string | Buffer; | ||
transformationAlgorithms?: string[]; | ||
} | ||
@@ -87,0 +88,0 @@ |
@@ -27,3 +27,3 @@ /** | ||
*/ | ||
export function flattenDeep(input: []) { | ||
export function flattenDeep(input: any[]) { | ||
return Array.isArray(input) | ||
@@ -38,3 +38,3 @@ ? input.reduce( (a, b) => a.concat(flattenDeep(b)) , []) | ||
*/ | ||
export function last(input: []) { | ||
export function last(input: any[]) { | ||
return input.slice(-1)[0]; | ||
@@ -173,3 +173,3 @@ } | ||
*/ | ||
export function readPrivateKey(keyString: string | Buffer, passphrase: string, isOutputString?: boolean) { | ||
export function readPrivateKey(keyString: string | Buffer, passphrase: string | undefined, isOutputString?: boolean) { | ||
return isString(passphrase) ? this.convertToString(pki.privateKeyToPem(pki.decryptRsaPrivateKey(String(keyString), passphrase)), isOutputString) : keyString; | ||
@@ -190,2 +190,6 @@ } | ||
export function notEmpty<TValue>(value: TValue | null | undefined): value is TValue { | ||
return value !== null && value !== undefined; | ||
} | ||
const utility = { | ||
@@ -192,0 +196,0 @@ isString, |
@@ -8,4 +8,4 @@ function verifyTime(utcNotBefore?: string, utcNotOnOrAfter?: string): boolean { | ||
let notBeforeLocal = null; | ||
let notOnOrAfterLocal = null; | ||
let notBeforeLocal: Date | null = null; | ||
let notOnOrAfterLocal: Date | null = null; | ||
@@ -21,4 +21,4 @@ if (utcNotBefore && !utcNotOnOrAfter) { | ||
notBeforeLocal = new Date(utcNotBefore); | ||
notOnOrAfterLocal = new Date(utcNotOnOrAfter); | ||
notBeforeLocal = new Date(utcNotBefore!); | ||
notOnOrAfterLocal = new Date(utcNotOnOrAfter!); | ||
return +notBeforeLocal <= +now && now < notOnOrAfterLocal; | ||
@@ -25,0 +25,0 @@ } |
@@ -15,2 +15,3 @@ { | ||
"removeComments": false, | ||
"strictNullChecks": true, | ||
"paths": {}, | ||
@@ -17,0 +18,0 @@ "lib": [ |
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext; | ||
declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext; | ||
/** | ||
@@ -23,3 +23,3 @@ * @desc Generate a base64 encoded login response | ||
*/ | ||
declare function base64LoginResponse(requestInfo: any, entity: any, user: any, customTagReplacement: (template: string) => BindingContext, encryptThenSign?: boolean): Promise<BindingContext>; | ||
declare function base64LoginResponse(requestInfo: any, entity: any, user?: any, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean): Promise<BindingContext>; | ||
/** | ||
@@ -26,0 +26,0 @@ * @desc Generate a base64 encoded logout request |
@@ -9,2 +9,3 @@ /** | ||
import { FlowResult } from './flow'; | ||
import { BindingContext } from './entity'; | ||
/** | ||
@@ -33,3 +34,3 @@ * Identity prvider can be configured using either metadata importing or idpSetting | ||
[key: string]: any; | ||
}, customTagReplacement?: (...args: any[]) => any, encryptThenSign?: boolean): Promise<{ | ||
}, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean): Promise<{ | ||
entityEndpoint: string | string[]; | ||
@@ -36,0 +37,0 @@ type: string; |
@@ -28,3 +28,3 @@ /** | ||
*/ | ||
createLoginRequest(idp: IdentityProvider, binding?: string, customTagReplacement?: (...args: any[]) => any): BindingContext | PostBindingContext; | ||
createLoginRequest(idp: IdentityProvider, binding?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext | PostBindingContext; | ||
/** | ||
@@ -31,0 +31,0 @@ * @desc Validation of the parsed the URL parameters |
@@ -76,3 +76,3 @@ /** | ||
declare const _default: { | ||
createXPath: (local: any, isExtractAll?: boolean) => string; | ||
createXPath: (local: any, isExtractAll?: boolean | undefined) => string; | ||
getQueryParamByType: (type: string) => "SAMLRequest" | "SAMLResponse"; | ||
@@ -84,3 +84,3 @@ defaultLoginRequestTemplate: { | ||
context: string; | ||
attributes: any[]; | ||
attributes: never[]; | ||
}; | ||
@@ -125,3 +125,3 @@ defaultLogoutRequestTemplate: { | ||
*/ | ||
verifySignature(xml: string, opts: SignatureVerifierOptions): any[]; | ||
verifySignature(xml: string, opts: SignatureVerifierOptions): (string | boolean | null)[]; | ||
/** | ||
@@ -142,3 +142,3 @@ * @desc Helper function to create the key section in metadata (abstraction for signing and encrypt use) | ||
*/ | ||
constructMessageSignature(octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string): any; | ||
constructMessageSignature(octetString: string, key: string, passphrase?: string | undefined, isBase64?: boolean | undefined, signingAlgorithm?: string | undefined): any; | ||
/** | ||
@@ -152,3 +152,3 @@ * @desc Verifies message signature | ||
*/ | ||
verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string): any; | ||
verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string | undefined): any; | ||
/** | ||
@@ -167,3 +167,3 @@ * @desc Get the public key in string format | ||
*/ | ||
encryptAssertion(sourceEntity: any, targetEntity: any, xml: string): Promise<string>; | ||
encryptAssertion(sourceEntity: any, targetEntity: any, xml?: string | undefined): Promise<string>; | ||
/** | ||
@@ -170,0 +170,0 @@ * @desc Decrypt the assertion section in Response |
@@ -19,3 +19,3 @@ /// <reference types="node" /> | ||
*/ | ||
constructor(xml: string | Buffer, extraParse?: any[]); | ||
constructor(xml: string | Buffer, extraParse?: any); | ||
/** | ||
@@ -22,0 +22,0 @@ * @desc Get the metadata in xml format |
@@ -1,2 +0,2 @@ | ||
interface SchemaValidator { | ||
export interface SchemaValidator { | ||
validate: (xml: string) => Promise<string>; | ||
@@ -3,0 +3,0 @@ } |
@@ -95,2 +95,3 @@ /// <reference types="node" /> | ||
encryptCert?: string | Buffer; | ||
transformationAlgorithms?: string[]; | ||
} | ||
@@ -97,0 +98,0 @@ export interface IdentityProviderSettings { |
@@ -13,3 +13,3 @@ /// <reference types="node" /> | ||
*/ | ||
export declare function flattenDeep(input: []): any; | ||
export declare function flattenDeep(input: any[]): any; | ||
/** | ||
@@ -20,3 +20,3 @@ * @desc Alternative to lodash.last | ||
*/ | ||
export declare function last(input: []): never; | ||
export declare function last(input: any[]): any; | ||
/** | ||
@@ -110,3 +110,3 @@ * @desc Alternative to lodash.uniq | ||
*/ | ||
export declare function readPrivateKey(keyString: string | Buffer, passphrase: string, isOutputString?: boolean): any; | ||
export declare function readPrivateKey(keyString: string | Buffer, passphrase: string | undefined, isOutputString?: boolean): any; | ||
/** | ||
@@ -120,2 +120,3 @@ * @desc Inline syntax sugar | ||
export declare function isNonEmptyArray(a: any): boolean; | ||
export declare function notEmpty<TValue>(value: TValue | null | undefined): value is TValue; | ||
declare const utility: { | ||
@@ -122,0 +123,0 @@ isString: typeof isString; |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
534574
7645
1
12
58
+ Addedbindings@1.5.0(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedlibxml-xsd@0.5.2(transitive)
+ Addedlibxmljs-mt@0.16.1(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-xmllint@1.0.0(transitive)
- Removed@authenio/xml-encryption@^0.11.2