mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
add CustomAuthorizerCallback & AuthResponse
This commit is contained in:
Vendored
+41
-1
@@ -187,6 +187,45 @@ interface ProxyResult {
|
||||
body: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* API Gateway CustomAuthorizer AuthResponse.
|
||||
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
|
||||
*/
|
||||
interface AuthResponse {
|
||||
principalId: string;
|
||||
policyDocument: PolicyDocument;
|
||||
context?: AuthResponseContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.
|
||||
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
|
||||
*/
|
||||
interface PolicyDocument {
|
||||
Version: string;
|
||||
Statement: [Statement];
|
||||
}
|
||||
|
||||
/**
|
||||
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
|
||||
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
|
||||
*/
|
||||
interface Statement {
|
||||
Action: string;
|
||||
Effect: string;
|
||||
Resource: string | [string];
|
||||
}
|
||||
|
||||
/**
|
||||
* API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement.
|
||||
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
|
||||
*/
|
||||
interface AuthResponseContext {
|
||||
stringKey: string;
|
||||
numberKey: number;
|
||||
booleanKey: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* AWS Lambda handler function.
|
||||
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
|
||||
@@ -197,7 +236,7 @@ interface ProxyResult {
|
||||
*/
|
||||
export type Handler = (event: any, context: Context, callback?: Callback) => void;
|
||||
export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void;
|
||||
export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Context, callback?: Callback) => void;
|
||||
export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Context, callback?: CustomAuthorizerCallback) => void;
|
||||
|
||||
/**
|
||||
* Optional callback parameter.
|
||||
@@ -208,5 +247,6 @@ export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Co
|
||||
*/
|
||||
export type Callback = (error?: Error, result?: any) => void;
|
||||
export type ProxyCallback = (error?: Error, result?: ProxyResult) => void;
|
||||
export type CustomAuthorizerCallback = (error?: Error, result?: AuthResponse) => void;
|
||||
|
||||
export as namespace AWSLambda;
|
||||
|
||||
Reference in New Issue
Block a user