Skip to content

Commit 2961d7c

Browse files
Adding example on how to work with optional security routes
1 parent 3d86eff commit 2961d7c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/core/event_handler/api_gateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ Security schemes are declared at the top-level first. You can reference them glo
11051105

11061106
=== "Global security schemes and optional security per route"
11071107

1108-
```python title="security_schemes_global_and_optional.py" hl_lines="20 35-44"
1108+
```python title="security_schemes_global_and_optional.py" hl_lines="22 37-46"
11091109
--8<-- "examples/event_handler_rest/src/security_schemes_global_and_optional.py"
11101110
```
11111111

examples/event_handler_rest/src/security_schemes_global_and_optional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
app = APIGatewayRestResolver(enable_validation=True)
1515

1616

17-
@app.get("/protected", security=[{"oauth": ["admin"]}]) # (1)!
17+
@app.get("/protected", security=[{"oauth": ["admin"]}])
1818
def protected() -> dict:
1919
return {"hello": "world"}
2020

0 commit comments

Comments
 (0)