Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 301 for usernames (0.12 seconds)

  1. docs/en/docs/tutorial/security/oauth2-jwt.md

    When `authenticate_user` is called with a username that doesn't exist in the database, we still run `verify_password` against a dummy hash.
    
    This ensures the endpoint takes roughly the same amount of time to respond whether the username is valid or not, preventing **timing attacks** that could be used to enumerate existing usernames.
    
    /// note
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 10.7K bytes
    - Click Count (0)
  2. docs/ko/docs/advanced/security/oauth2-scopes.md

    ## `username`과 데이터 형태 검증하기 { #verify-the-username-and-data-shape }
    
    `username`을 얻었는지 확인하고, 스코프를 추출합니다.
    
    그런 다음 Pydantic 모델로 데이터를 검증합니다(`ValidationError` 예외를 잡습니다). JWT 토큰을 읽거나 Pydantic으로 데이터를 검증하는 과정에서 오류가 나면, 앞에서 만든 `HTTPException`을 raise합니다.
    
    이를 위해 Pydantic 모델 `TokenData`에 새 속성 `scopes`를 추가합니다.
    
    Pydantic으로 데이터를 검증하면, 예를 들어 스코프가 정확히 `str`의 `list`이고 `username`이 `str`인지 등을 보장할 수 있습니다.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 15.7K bytes
    - Click Count (0)
  3. src/test/java/org/codelibs/fess/exception/FessUserNotFoundExceptionTest.java

            String username = null;
            FessUserNotFoundException exception = new FessUserNotFoundException(username);
    
            assertNotNull(exception);
            assertEquals("User is not found: null", exception.getMessage());
            assertNull(exception.getCause());
        }
    
        @Test
        public void test_constructor_withSpecialCharacters() {
            // Test with username containing special characters
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 6.8K bytes
    - Click Count (0)
  4. docs/en/docs/advanced/security/http-basic-auth.md

        * It contains the `username` and `password` sent.
    
    {* ../../docs_src/security/tutorial006_an_py310.py hl[4,8,12] *}
    
    When you try to open the URL for the first time (or click the "Execute" button in the docs) the browser will ask you for your username and password:
    
    <img src="/img/tutorial/security/image12.png">
    
    ## Check the username { #check-the-username }
    
    Here's a more complete example.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5K bytes
    - Click Count (0)
  5. docs_src/security/tutorial005_an_py310.py

    
    def get_password_hash(password):
        return password_hash.hash(password)
    
    
    def get_user(db, username: str):
        if username in db:
            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def authenticate_user(fake_db, username: str, password: str):
        user = get_user(fake_db, username)
        if not user:
            verify_password(password, DUMMY_HASH)
            return False
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 18:10:35 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  6. tests/test_security_oauth2.py

            }
        }
    )
    
    
    class User(BaseModel):
        username: str
    
    
    # Here we use string annotations to test them
    def get_current_user(oauth_header: "str" = Security(reusable_oauth2)):
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    # Here we use string annotations to test them
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 9.8K bytes
    - Click Count (0)
  7. tests/test_security_oauth2_optional_description.py

            }
        },
        description="OAuth2 security scheme",
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str | None = Security(reusable_oauth2)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 9.9K bytes
    - Click Count (0)
  8. tests/test_schema_compat_pydantic_v2.py

        class User(BaseModel):
            username: str
            role: PlatformRole | OtherRole
    
        @app.get("/users")
        async def get_user() -> User:
            return {"username": "alice", "role": "admin"}
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_get(client: TestClient):
        response = client.get("/users")
        assert response.json() == {"username": "alice", "role": "admin"}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 23 12:36:49 GMT 2026
    - 4.1K bytes
    - Click Count (0)
  9. tests/test_tutorial/test_body_multiple_params/test_tutorial004.py

                        },
                        "User": {
                            "title": "User",
                            "required": ["username"],
                            "type": "object",
                            "properties": {
                                "username": {"title": "Username", "type": "string"},
                                "full_name": {
                                    "title": "Full Name",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 10K bytes
    - Click Count (0)
  10. docs_src/security/tutorial007_py310.py

                status_code=status.HTTP_401_UNAUTHORIZED,
                detail="Incorrect username or password",
                headers={"WWW-Authenticate": "Basic"},
            )
        return credentials.username
    
    
    @app.get("/users/me")
    def read_current_user(username: str = Depends(get_current_username)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 1.1K bytes
    - Click Count (0)
Back to Top