Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add index.d.ts file #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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;
}
}