Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 63 for scope (0.38 sec)

  1. fastapi/security/oauth2.py

            data = {}
            data["scopes"] = []
            for scope in form_data.scopes:
                data["scopes"].append(scope)
            if form_data.client_id:
                data["client_id"] = form_data.client_id
            if form_data.client_secret:
                data["client_secret"] = form_data.client_secret
            return data
        ```
    
        Note that for OAuth2 the scope `items:read` is a single scope in an opaque string.
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  2. tests/test_tutorial/test_security/test_tutorial005_an.py

        fake_users_db,
        get_password_hash,
        verify_password,
    )
    
    client = TestClient(app)
    
    
    def get_access_token(username="johndoe", password="secret", scope=None):
        data = {"username": username, "password": password}
        if scope:
            data["scope"] = scope
        response = client.post("/token", data=data)
        content = response.json()
        access_token = content.get("access_token")
        return access_token
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  3. docs/em/docs/advanced/security/oauth2-scopes.md

                        * ๐Ÿ”— โš™๏ธ `oauth2_scheme`.
                        *  `security_scopes` ๐Ÿ”ข ๐Ÿ†Ž `SecurityScopes`:
                            * ๐Ÿ‘‰ `security_scopes` ๐Ÿ”ข โœ”๏ธ ๐Ÿ  `scopes` โฎ๏ธ `list` โš— ๐ŸŒ ๐Ÿ‘ซ โ†” ๐Ÿ“ฃ ๐Ÿ”›,:
                                * `security_scopes.scopes` ๐Ÿ”œ ๐Ÿ”Œ `["me", "items"]` *โžก ๐Ÿ› ๏ธ* `read_own_items`.
                                * `security_scopes.scopes` ๐Ÿ”œ ๐Ÿ”Œ `["me"]` *โžก ๐Ÿ› ๏ธ* `read_users_me`, โ†ฉ๏ธ โšซ๏ธ ๐Ÿ“ฃ ๐Ÿ”— `get_current_active_user`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 21:21:35 GMT 2024
    - 11.1K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/custom-request-and-route.md

    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "ๆŠ€ๆœฏ็ป†่Š‚"
    
        `Request` ็š„ `request.scope` ๅฑžๆ€งๆ˜ฏๅŒ…ๅซๅ…ณ่”่ฏทๆฑ‚ๅ…ƒๆ•ฐๆฎ็š„ๅญ—ๅ…ธใ€‚
    
        `Request` ็š„ `request.receive` ๆ–นๆณ•ๆ˜ฏ**ๆŽฅๆ”ถ**่ฏทๆฑ‚ไฝ“็š„ๅ‡ฝๆ•ฐใ€‚
    
        `scope` ๅญ—ๅ…ธไธŽ `receive` ๅ‡ฝๆ•ฐ้ƒฝๆ˜ฏ ASGI ่ง„่Œƒ็š„ๅ†…ๅฎนใ€‚
    
        `scope` ไธŽ `receive` ไนŸๆ˜ฏๅˆ›ๅปบๆ–ฐ็š„ `Request` ๅฎžไพ‹ๆ‰€้œ€็š„ใ€‚
    
    Plain Text
    - Registered: Sun Mar 31 07:19:09 GMT 2024
    - Last Modified: Sat Mar 30 22:45:40 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial005_py39.py

        client = TestClient(app)
        return client
    
    
    def get_access_token(
        *, username="johndoe", password="secret", scope=None, client: TestClient
    ):
        data = {"username": username, "password": password}
        if scope:
            data["scope"] = scope
        response = client.post("/token", data=data)
        content = response.json()
        access_token = content.get("access_token")
        return access_token
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  6. docs_src/security/tutorial005_an.py

                raise credentials_exception
            token_scopes = payload.get("scopes", [])
            token_data = TokenData(scopes=token_scopes, username=username)
        except (JWTError, ValidationError):
            raise credentials_exception
        user = get_user(fake_users_db, username=token_data.username)
        if user is None:
            raise credentials_exception
        for scope in security_scopes.scopes:
            if scope not in token_data.scopes:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/security/simple-oauth2.md

    ไธ่ฟ‡ไนŸไธ็”จๆ‹…ๅฟƒ๏ผŒๅ‰็ซฏไปๅฏไปฅๆ˜พ็คบ็ปˆ็ซฏ็”จๆˆทๆ‰€้œ€็š„ๅ็งฐใ€‚
    
    ๆ•ฐๆฎๅบ“ๆจกๅž‹ไนŸๅฏไปฅไฝฟ็”จๆ‰€้œ€็š„ๅ็งฐใ€‚
    
    ไฝ†ๅฏนไบŽ็™ปๅฝ•*่ทฏๅพ„ๆ“ไฝœ*๏ผŒๅˆ™่ฆไฝฟ็”จๅ…ผๅฎน่ง„่Œƒ็š„ `username` ๅ’Œ `password`๏ผŒ๏ผˆไพ‹ๅฆ‚๏ผŒๅฎž็ŽฐไธŽ API ๆ–‡ๆกฃ้›†ๆˆ๏ผ‰ใ€‚
    
    ่ฏฅ่ง„่Œƒ่ฆๆฑ‚ๅฟ…้กปไปฅ่กจๅ•ๆ•ฐๆฎๅฝขๅผๅ‘้€ `username` ๅ’Œ `password`๏ผŒๅ› ๆญค๏ผŒไธ่ƒฝไฝฟ็”จ JSON ๅฏน่ฑกใ€‚
    
    ### `Scope`๏ผˆไฝœ็”จๅŸŸ๏ผ‰
    
    OAuth2 ่ฟ˜ๆ”ฏๆŒๅฎขๆˆท็ซฏๅ‘้€**`scope`**่กจๅ•ๅญ—ๆฎตใ€‚
    
    ่™ฝ็„ถ่กจๅ•ๅญ—ๆฎต็š„ๅ็งฐๆ˜ฏ `scope`๏ผˆๅ•ๆ•ฐ๏ผ‰๏ผŒไฝ†ๅฎž้™…ไธŠ๏ผŒๅฎƒๆ˜ฏไปฅ็ฉบๆ ผๅˆ†้š”็š„๏ผŒ็”ฑๅคšไธช**scope**็ป„ๆˆ็š„้•ฟๅญ—็ฌฆไธฒใ€‚
    
    **ไฝœ็”จๅŸŸ**ๅชๆ˜ฏไธๅธฆ็ฉบๆ ผ็š„ๅญ—็ฌฆไธฒใ€‚
    
    ๅธธ็”จไบŽๅฃฐๆ˜ŽๆŒ‡ๅฎšๅฎ‰ๅ…จๆƒ้™๏ผŒไพ‹ๅฆ‚๏ผš
    
    * ๅธธ่ง็”จไพ‹ไธบ๏ผŒ`users:read` ๆˆ– `users:write`
    * ่„ธไนฆๅ’Œ Instagram ไฝฟ็”จ `instagram_basic`
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/custom-request-and-route.md

    ```
    
    !!! note "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`, that's a function to "receive" the body of the request.
    
        The `scope` `dict` and `receive` function are both part of the ASGI specification.
    
        And those two things, `scope` and `receive`, are what is needed to create a new `Request` instance.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  9. docs/em/docs/tutorial/security/simple-oauth2.md

    & ๐Ÿ‘† ๐Ÿ’ฝ ๐Ÿท ๐Ÿ’ช โš™๏ธ ๐Ÿ™† ๐ŸŽ ๐Ÿ“› ๐Ÿ‘† ๐Ÿ’š.
    
    โœ‹๏ธ ๐Ÿ’ณ *โžก ๐Ÿ› ๏ธ*, ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ ๐Ÿ‘‰ ๐Ÿ“› ๐Ÿ”— โฎ๏ธ ๐Ÿ”Œ (& ๐Ÿ’ช, ๐Ÿ–ผ, โš™๏ธ ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ ๐Ÿงพ โš™๏ธ).
    
    ๐Ÿ”Œ ๐Ÿ‡ต๐Ÿ‡ธ ๐Ÿ‘ˆ `username` & `password` ๐Ÿ”œ ๐Ÿ“จ ๐Ÿ“จ ๐Ÿ’ฝ (, ๐Ÿ™…โ€โ™‚ ๐ŸŽป ๐Ÿ“ฅ).
    
    ### `scope`
    
    ๐Ÿ”Œ ๐Ÿ’ฌ ๐Ÿ‘ˆ ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ’ช ๐Ÿ“จ โž•1๏ธโƒฃ ๐Ÿ“จ ๐Ÿ‘ "`scope`".
    
    ๐Ÿ“จ ๐Ÿ‘ ๐Ÿ“› `scope` (โญ), โœ‹๏ธ โšซ๏ธ ๐Ÿค™ ๐Ÿ“ ๐ŸŽป โฎ๏ธ "โ†”" ๐ŸŽ ๐Ÿš€.
    
    ๐Ÿ”  "โ†”" ๐ŸŽป (๐Ÿต ๐Ÿš€).
    
    ๐Ÿ‘ซ ๐Ÿ›Ž โš™๏ธ ๐Ÿ“ฃ ๐ŸŽฏ ๐Ÿ’‚โ€โ™‚ โœ”, ๐Ÿ–ผ:
    
    * `users:read` โš–๏ธ `users:write` โš  ๐Ÿ–ผ.
    * `instagram_basic` โš™๏ธ ๐Ÿ‘ฑ๐Ÿ“” / ๐Ÿ‘ฑ๐Ÿ“”.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  10. docs/em/docs/how-to/custom-request-and-route.md

    ```Python hl_lines="18-26"
    {!../../../docs_src/custom_request_and_route/tutorial001.py!}
    ```
    
    !!! note "๐Ÿ“ก โ„น"
         `Request` โœ”๏ธ `request.scope` ๐Ÿ”ข, ๐Ÿ‘ˆ ๐Ÿ `dict` โš— ๐Ÿ—ƒ ๐Ÿ”— ๐Ÿ“จ.
    
         `Request` โœ”๏ธ `request.receive`, ๐Ÿ‘ˆ ๐Ÿ”ข "๐Ÿ“จ" ๐Ÿ’ช ๐Ÿ“จ.
    
         `scope` `dict` & `receive` ๐Ÿ”ข ๐Ÿ‘ฏโ€โ™‚๏ธ ๐Ÿ• ๐Ÿ”ซ ๐Ÿ”ง.
    
         & ๐Ÿ‘ˆ 2๏ธโƒฃ ๐Ÿ‘œ, `scope` & `receive`, โšซ๏ธโ” ๐Ÿ’ช โœ ๐Ÿ†• `Request` ๐Ÿ‘.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top