Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Interface for lib/saml (Banno/node-saml). It differs from the original
* designed for auth0/node-saml to include the enhancements for supporting
* a full SAML 2.0 Response in all signing modes.
*/
declare module '@banno/saml' {
export interface SamlAttributes {
[key: string]: string;
}

export interface KeyInfoProvider {
getKeyInfo(key: string, prefix: string): string;
}

export interface SamlOpts {
authnContextClassRef?: string;
attributes?: SamlAttributes;
audiences?: string | string[];
cert: Buffer;
digestAlgorithm?: string;
encryptionAlgorithm?: string;
encryptionCert?: Buffer;
encryptionPublicKey?: Buffer;
holderOfKeyProofSecret?: string;
includeAttributeNameFormat?: boolean;
inResponseTo?: string;
issuer?: string;
key: Buffer;
keyEncryptionAlgorighm?: string; // sic https://github.com/auth0/node-xml-encryption/issues/17
keyInfoProvider?: KeyInfoProvider;
lifetimeInSeconds?: number;
nameIdentifier?: string;
nameIdentifierFormat?: string;
prefix?: string;
recipient?: string;
sessionIndex?: string;
signatureAlgorithm?: string;
signatureNamespacePrefix?: string;
subjectConfirmationMethod?: string;
typedAttributes?: boolean;
uid?: string;
responseUid?: string;
xpathToNodeBeforeSignature?: string;
createSignedSamlResponse?: boolean;
responseSigningLevel?: string;
destination?: string;
}

export namespace Saml11 {
function create(opts: SamlOpts, cb?: (err: Error | null, result: any[], proofSecret: Buffer) => void): any;
}

export namespace Saml20 {
function create(opts: SamlOpts, cb?: (err: Error | null, signed: string) => void): any;
}
}