Kevin Kirsche
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
3 deletions
-
fastapi/param_functions.py
-
fastapi/security/oauth2.py
|
|
@ -2298,7 +2298,7 @@ def Security( # noqa: N802 |
|
|
|
dependency. |
|
|
|
|
|
|
|
The term "scope" comes from the OAuth2 specification, it seems to be |
|
|
|
intentionaly vague and interpretable. It normally refers to permissions, |
|
|
|
intentionally vague and interpretable. It normally refers to permissions, |
|
|
|
in cases to roles. |
|
|
|
|
|
|
|
These scopes are integrated with OpenAPI (and the API docs at `/docs`). |
|
|
|
|
|
@ -52,7 +52,7 @@ class OAuth2PasswordRequestForm: |
|
|
|
``` |
|
|
|
|
|
|
|
Note that for OAuth2 the scope `items:read` is a single scope in an opaque string. |
|
|
|
You could have custom internal logic to separate it by colon caracters (`:`) or |
|
|
|
You could have custom internal logic to separate it by colon characters (`:`) or |
|
|
|
similar, and get the two parts `items` and `read`. Many applications do that to |
|
|
|
group and organize permissions, you could do it as well in your application, just |
|
|
|
know that that it is application specific, it's not part of the specification. |
|
|
@ -194,7 +194,7 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm): |
|
|
|
``` |
|
|
|
|
|
|
|
Note that for OAuth2 the scope `items:read` is a single scope in an opaque string. |
|
|
|
You could have custom internal logic to separate it by colon caracters (`:`) or |
|
|
|
You could have custom internal logic to separate it by colon characters (`:`) or |
|
|
|
similar, and get the two parts `items` and `read`. Many applications do that to |
|
|
|
group and organize permissions, you could do it as well in your application, just |
|
|
|
know that that it is application specific, it's not part of the specification. |
|
|
|