mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
feat: update samlp definition file
This commit is contained in:
36
samlp/samlp.d.ts
vendored
36
samlp/samlp.d.ts
vendored
@@ -13,11 +13,15 @@ declare module "samlp" {
|
||||
|
||||
export function auth(options: IdPOptions): express.Handler;
|
||||
export function logout(options: IdPOptions): express.Handler;
|
||||
export function parseRequest(req: express.Request, callback: (err: any, data: any) => void): void;
|
||||
export function getSamlResponse(options: IdPOptions, user: any, callback: (err: any, samlResponse: any) => void): void;
|
||||
export function parseRequest(req: express.Request, callback: (err: any, data: SamlRequest) => void): void;
|
||||
export function getSamlResponse(options: IdPOptions, user: any, callback: (err: any, samlResponse: string) => void): void;
|
||||
export function sendError(options: IdPOptions): express.Handler;
|
||||
export function metadata(options: IdPMetadataOptions): express.Handler;
|
||||
|
||||
|
||||
export type DigestAlgorithmType = 'sha1' | 'sha256';
|
||||
export type SignatureAlgorithmType = 'rsa-sha1' | 'rsa-sha256';
|
||||
|
||||
export interface IdPOptions {
|
||||
issuer: string;
|
||||
cert: string | Buffer;
|
||||
@@ -26,8 +30,8 @@ declare module "samlp" {
|
||||
recipient?: string;
|
||||
destination?: string;
|
||||
RelayState?: string;
|
||||
digestAlgorithm?: 'sha1' | 'sha256';
|
||||
signatureAlgorithm?: 'rsa-sha1' | 'rsa-sha256';
|
||||
digestAlgorithm?: DigestAlgorithmType;
|
||||
signatureAlgorithm?: SignatureAlgorithmType;
|
||||
signResponse?: boolean;
|
||||
encryptionCert?: string | Buffer;
|
||||
encryptionPublicKey?: string | Buffer;
|
||||
@@ -35,14 +39,16 @@ declare module "samlp" {
|
||||
keyEncryptionAlgorighm?: string;
|
||||
lifetimeInSeconds?: number;
|
||||
authnContextClassRef?: string;
|
||||
profileMapper?: PassportProfileMapper;
|
||||
inResponseTo?: string;
|
||||
profileMapper?: ProfileMapperConstructor;
|
||||
getUserFromRequest?: (req: express.Request) => any;
|
||||
getPostURL: (audience: string, authnRequestDom: any, req: express.Request, callback: (err: any, url: string) => void) => void;
|
||||
}
|
||||
|
||||
export interface IdPMetadataOptions {
|
||||
issuer: string;
|
||||
cert: string | Buffer;
|
||||
profileMapper?: PassportProfileMapper;
|
||||
profileMapper?: ProfileMapperConstructor;
|
||||
redirectEndpointPath?: string;
|
||||
postEndpointPath?: string;
|
||||
logoutEndpointPaths?: {
|
||||
@@ -51,12 +57,26 @@ declare module "samlp" {
|
||||
};
|
||||
}
|
||||
|
||||
export class PassportProfileMapper {
|
||||
constructor(pu: passport.Profile);
|
||||
export interface SamlRequest {
|
||||
id?: string;
|
||||
issuer?: string;
|
||||
assertionConsumerServiceURL?: string;
|
||||
destination?: string;
|
||||
forceAuthn?: string;
|
||||
}
|
||||
|
||||
|
||||
export interface ProfileMapper {
|
||||
metadata: MetadataItem[];
|
||||
getClaims(): any;
|
||||
getNameIdentifier(): any;
|
||||
}
|
||||
export interface ProfileMapperConstructor {
|
||||
(pu: passport.Profile): ProfileMapper;
|
||||
prototype: ProfileMapper;
|
||||
}
|
||||
export var PassportProfileMapper: ProfileMapperConstructor;
|
||||
|
||||
export interface MetadataItem {
|
||||
id: string;
|
||||
optional: boolean;
|
||||
|
||||
Reference in New Issue
Block a user