-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
56 lines (56 loc) · 1.81 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import * as express from 'express';
import * as passport from 'passport';
export declare type VersionOptions = 'CAS1.0' | 'CAS2.0' | 'CAS3.0';
export interface StrategyOptions<REQ extends boolean = boolean> {
version?: VersionOptions;
casBaseURL: string;
serviceBaseURL: string;
serviceURL?: string;
validateURL?: string;
useSaml?: boolean;
passReqToCallback?: REQ;
agentOptions?: any;
}
export interface AuthenticateOptions extends passport.AuthenticateOptions {
loginParams?: {
[key: string]: string | undefined;
};
}
export interface Profile {
user: string;
attributes?: {
[key: string]: any;
};
}
declare type VerifyUser = object | false;
declare type VerifyInfo = {
message?: string;
} | string;
export declare type VerifyUserInfo = {
user: VerifyUser;
info?: VerifyInfo;
};
export declare type VerifyCallback = (err: any, user?: VerifyUser, info?: VerifyInfo) => void;
export declare type VerifyFunction = (profile: string | Profile, done: VerifyCallback) => void;
export declare type VerifyFunctionWithRequest = (req: express.Request, profile: string | Profile, done: VerifyCallback) => void;
export declare class Strategy extends passport.Strategy {
name: string;
version: VersionOptions;
casBaseURL: string;
serviceBaseURL: string;
validateURL?: string;
serviceURL?: string;
useSaml: boolean;
private _client;
private _verify;
private _passReqToCallback;
constructor(options: StrategyOptions<false>, verify: VerifyFunction);
constructor(options: StrategyOptions<true>, verify: VerifyFunctionWithRequest);
private verify;
private validateCAS1;
private validateSAML;
private validateCAS23;
private service;
authenticate(req: express.Request, options?: AuthenticateOptions): void;
}
export {};