Fix incorrect hl[] line highlights in oauth2-scopes.md
Several code example sections referenced wrong line numbers, causing
the wrong code lines to be highlighted:
- "OAuth2 Security scheme": hl[63:66] started on DUMMY_HASH line and
missed the scopes= dict on line 67; fixed to hl[65:68]
- "JWT token with scopes": hl[157] highlighted the wrong HTTPException
(bad password error); fixed to hl[159:163] (create_access_token
with scope data)
- "Use SecurityScopes": hl[106] was a blank line; fixed to hl[108]
- "Use the scopes": hl[106,...] was blank line + incomplete exception
block; fixed to hl[108:119]
- "Declare scopes in path operations": hl[141] and hl[172] were blank
lines; fixed to hl[143:145,173:176]
- "Verify username and data shape": hl[117:129] started mid-exception
block; fixed to hl[120:132]
- "Verify the scopes": hl[130:136] included unrelated user-lookup
lines and cut off mid-exception; fixed to hl[133:140]
- Global view: updated to reflect all the above corrections
@ -62,7 +62,7 @@ For OAuth2 they are just strings.
First, let's quickly see the parts that change from the examples in the main **Tutorial - User Guide** for [OAuth2 with Password (and hashing), Bearer with JWT tokens](../../tutorial/security/oauth2-jwt.md). Now using OAuth2 scopes:
First, let's quickly see the parts that change from the examples in the main **Tutorial - User Guide** for [OAuth2 with Password (and hashing), Bearer with JWT tokens](../../tutorial/security/oauth2-jwt.md). Now using OAuth2 scopes:
@ -164,7 +164,7 @@ We create an `HTTPException` that we can reuse (`raise`) later at several points
In this exception, we include the scopes required (if any) as a string separated by spaces (using `scope_str`). We put that string containing the scopes in the `WWW-Authenticate` header (this is part of the spec).
In this exception, we include the scopes required (if any) as a string separated by spaces (using `scope_str`). We put that string containing the scopes in the `WWW-Authenticate` header (this is part of the spec).