Results of 1 - 5 of about 5 for scope (0.008 sec.)
- OAuth2 scopes 12814
- OAuth2 scopes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use OAuth2 scopes directly with FastAPI , they are integrated to work seamlessly. This would
...permission system, following the OAuth2 standard, integrated into your OpenAPI application (and the API docs). OAuth2 with scopes is the mechanism used by many big authentication providers, like Facebook, Google, GitHub, Microsoft, Twitter, etc. They...ications. Every time you "log in with" Facebook, Google, GitHub, Microsoft, Twitter, that application is using OAuth2 with scopes. In this section you will see how to manage authentication and authorization with the same OAuth2 with scopes in your Fas...ning This is a more or less advanced section. If you are just starting, you can skip it. You don't necessarily need OAuth2 scopes, and you can handle authentication and authorization however you want. But OAuth2 with scopes can be nicely integrated in... - https://man.mtool.work/fastapi/0.115/advanced/security/oauth2-scopes/
- Custom Request and APIRoute class 8714
- Custom Request and APIRoute class Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some cases, you may want to override the logic used by the Request and APIRout
...get_route_handler () async def custom_route_handler ( request : Request ) -> Response : request = GzipRequest ( request . scope , request . receive ) return await original_route_handler ( request ) return custom_route_handler app = FastAPI () app . r...get_route_handler () async def custom_route_handler ( request : Request ) -> Response : request = GzipRequest ( request . scope , request . receive ) return await original_route_handler ( request ) return custom_route_handler app = FastAPI () app . r...m_numbers ( numbers : List [ int ] = Body ()): return { "sum" : sum ( numbers )} Technical Details A Request has a request.scope attribute, that's just a Python dict containing the metadata related to the request. A Request also has a request.receive... - https://man.mtool.work/fastapi/0.115/how-to/custom-request-and-route/
- Behind a Proxy 8475
- Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration
...() @app . get ( "/app" ) def read_main ( request : Request ): return { "message" : "Hello World" , "root_path" : request . scope . get ( "root_path" )} And the proxy would be "stripping" the path prefix on the fly before transmitting the request to th...cking the current root_path You can get the current root_path used by your application for each request, it is part of the scope dictionary (that's part of the ASGI spec). Here we are including it in the message just for demonstration purposes. Python...() @app . get ( "/app" ) def read_main ( request : Request ): return { "message" : "Hello World" , "root_path" : request . scope . get ( "root_path" )} Then, if you start Uvicorn with: $ fastapi run main.py --root-path /api/v1 <span style="color: gree... - https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
- Simple OAuth2 with Password and Bearer 7997
- Simple OAuth2 with Password and Bearer Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Now let's build from the previous chapter and add the missing parts to have
...I documentation system). The spec also states that the username and password must be sent as form data (so, no JSON here). scope The spec also says that the client can send another form field " scope ". The form field name is scope (in singular), but...it is actually a long string with "scopes" separated by spaces. Each "scope" is just a string (without spaces). They are normally used to declare specific security...nstagram_basic is used by Facebook / Instagram. https://www.googleapis.com/auth/drive is used by Google. Info In OAuth2 a "scope" is just a string that declares a specific permission required. It doesn't matter if it has other characters like : or if... - https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
- WebSockets 7923
- WebSockets When defining WebSockets, you normally declare a parameter of type WebSocket and with it you can read data from the client and send data to it. It is provided directly by Starlette, but you can import it from fastapi : from fasta
...e a parameter that takes an HTTPConnection instead of a Request or a WebSocket . ::: fastapi.WebSocket options: members: - scope - app - url - base_url - headers - query_params - path_params - cookies - client - state - url_for - client_state - applic... - https://man.mtool.work/fastapi/0.115/reference/websockets/
PREV
1
NEXT