@@ -36,14 +36,14 @@ def integration_latency(self) -> Optional[int]:
36
36
def get_context (self ) -> Dict [str , Any ]:
37
37
"""Retrieve the authorization context details injected by a Lambda Authorizer.
38
38
39
- Example
40
- --------
39
+ Example
40
+ --------
41
41
42
42
```python
43
- ctx: dict = ...request_context.authorizer.get_context()
43
+ ctx: dict = ...request_context.authorizer.get_context()
44
44
45
- tenant_id = ctx.get("tenant_id")
46
- ```
45
+ tenant_id = ctx.get("tenant_id")
46
+ ```
47
47
48
48
Returns:
49
49
--------
@@ -203,24 +203,24 @@ def get_lambda(self) -> Optional[Dict[str, Any]]:
203
203
"""Lambda authorization context details"""
204
204
return self .get ("lambda" )
205
205
206
- def get_context (self ) -> Optional [ Dict [str , Any ] ]:
206
+ def get_context (self ) -> Dict [str , Any ]:
207
207
"""Retrieve the authorization context details injected by a Lambda Authorizer.
208
208
209
- Example
210
- --------
209
+ Example
210
+ --------
211
211
212
212
```python
213
- ctx: dict = ...request_context.authorizer.get_context()
213
+ ctx: dict = ...request_context.authorizer.get_context()
214
214
215
- tenant_id = ctx.get("tenant_id")
216
- ```
215
+ tenant_id = ctx.get("tenant_id")
216
+ ```
217
217
218
218
Returns:
219
219
--------
220
220
Dict[str, Any]
221
221
A dictionary containing Lambda authorization context details.
222
222
"""
223
- return self .get ("lambda" , {})
223
+ return self .get ("lambda" , {}) or {}
224
224
225
225
@property
226
226
def iam (self ) -> Optional [RequestContextV2AuthorizerIam ]:
0 commit comments