DefinitelyTyped/types/aws-lambda/common
Simon Buchan 53c3baddff
[aws-lambda] New API Gateway Authorizer types, deprecating old… (#42420)
* [aws-lambda] Deprecate CustomAuthorizer*, new APIGateway*Authorizer*

Noticed this testing #42419.

When integrating a custom authorizer, you actually have two options,
creating a token or a request authorizer, which changes what payload
you will get. You nearly certainly know which you will be called with!

Just deprecating the old version as it's kinda broken in a way thats
hard to fix without breaking someone, but we want to guide devs to the
new version.

It is possible to fix the existing type by adding a bunch of
`foo?: never` fields to each alternative so existing accesses don't,
error but this makes things more complex, and confusing for the common
case.

Other ideas welcome!

* [aws-lambda] Add api-gateway authorizer parameters.

Fixes #34069, #42418

Ended up a bit messy, might be a bit much.

* [aws-lambda] Bump minimum typescript to 3.0

Required to fix failing $ExpectError in tests.
Surely nobody is still using pre-3.0?

* [aws-lambda] Enforcea API Gateway authorizer context narrowing

And implement the changes that API gateway does on the proxy request context for it.

Also rename TAuthorizer to TAuthorizerContext to be more clear that they should be the same type across both authorizer and proxy.

Some cleanups and fixes for names.
2020-03-02 09:50:45 -08:00
..
api-gateway.d.ts [aws-lambda] New API Gateway Authorizer types, deprecating old… (#42420) 2020-03-02 09:50:45 -08:00
cloudfront.d.ts