Skip to content

Commit 08aaff4

Browse files
Addressing Heitor's feedback
1 parent 9f5dee0 commit 08aaff4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

aws_lambda_powertools/utilities/data_classes/api_gateway_proxy_event.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ def integration_latency(self) -> Optional[int]:
3636
def get_context(self) -> Dict[str, Any]:
3737
"""Retrieve the authorization context details injected by a Lambda Authorizer.
3838
39-
Example
40-
--------
39+
Example
40+
--------
4141
4242
```python
43-
ctx: dict = ...request_context.authorizer.get_context()
43+
ctx: dict = ...request_context.authorizer.get_context()
4444
45-
tenant_id = ctx.get("tenant_id")
46-
```
45+
tenant_id = ctx.get("tenant_id")
46+
```
4747
4848
Returns:
4949
--------
@@ -203,24 +203,24 @@ def get_lambda(self) -> Optional[Dict[str, Any]]:
203203
"""Lambda authorization context details"""
204204
return self.get("lambda")
205205

206-
def get_context(self) -> Optional[Dict[str, Any]]:
206+
def get_context(self) -> Dict[str, Any]:
207207
"""Retrieve the authorization context details injected by a Lambda Authorizer.
208208
209-
Example
210-
--------
209+
Example
210+
--------
211211
212212
```python
213-
ctx: dict = ...request_context.authorizer.get_context()
213+
ctx: dict = ...request_context.authorizer.get_context()
214214
215-
tenant_id = ctx.get("tenant_id")
216-
```
215+
tenant_id = ctx.get("tenant_id")
216+
```
217217
218218
Returns:
219219
--------
220220
Dict[str, Any]
221221
A dictionary containing Lambda authorization context details.
222222
"""
223-
return self.get("lambda", {})
223+
return self.get("lambda", {}) or {}
224224

225225
@property
226226
def iam(self) -> Optional[RequestContextV2AuthorizerIam]:

0 commit comments

Comments
 (0)