Search Options

Results per page
Sort
Preferred Languages
Advance

Results 101 - 110 of 790 for users2 (0.05 sec)

  1. tests/update_has_one_test.go

    	CheckUser(t, user2, user)
    
    	user.Account.Number += "new"
    	if err := DB.Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user3 User
    	DB.Preload("Account").Find(&user3, "id = ?", user.ID)
    
    	CheckUser(t, user2, user3)
    	lastUpdatedAt := user2.Account.UpdatedAt
    	time.Sleep(time.Second)
    
    	if err := DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&user).Error; err != nil {
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Jul 14 06:55:54 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  2. logger/sql_test.go

    		Result        string
    	}{
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
    			NumericRegexp: nil,
    			Vars:          []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.\"com", myrole, pwd},
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Mar 21 08:00:02 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  3. docs/ja/docs/tutorial/security/get-current-user.md

    ## ユーザーの取得
    
    `get_current_user` は作成した(偽物の)ユーティリティ関数を使って、 `str` としてトークンを受け取り、先ほどのPydanticの `User` モデルを返却します:
    
    {* ../../docs_src/security/tutorial002.py hl[19:22,26:27] *}
    
    ## 現在のユーザーの注入
    
    ですので、 `get_current_user` に対して同様に *path operation* の中で `Depends` を利用できます。
    
    {* ../../docs_src/security/tutorial002.py hl[31] *}
    
    Pydanticモデルの `User` として、 `current_user` の型を宣言することに注意してください。
    
    その関数の中ですべての入力補完や型チェックを行う際に役に立ちます。
    
    /// tip | 豆知識
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  4. docs/es/docs/tutorial/security/get-current-user.md

    ## Obtener el usuario { #get-the-user }
    
    `get_current_user` usará una función de utilidad (falsa) que creamos, que toma un token como un `str` y devuelve nuestro modelo de Pydantic `User`:
    
    {* ../../docs_src/security/tutorial002_an_py310.py hl[19:22,26:27] *}
    
    ## Inyectar al usuario actual { #inject-the-current-user }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  5. tests/test_security_api_key_query_description.py

    app = FastAPI()
    
    api_key = APIKeyQuery(name="key", description="API Key Query")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        return current_user
    
    
    client = TestClient(app)
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2K bytes
    - Viewed (0)
  6. tests/test_security_http_base_optional.py

    client = TestClient(app)
    
    
    def test_security_http_base():
        response = client.get("/users/me", headers={"Authorization": "Other foobar"})
        assert response.status_code == 200, response.text
        assert response.json() == {"scheme": "Other", "credentials": "foobar"}
    
    
    def test_security_http_base_no_credentials():
        response = client.get("/users/me")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  7. clause/limit_test.go

    				Offset: 20,
    			}},
    			"SELECT * FROM `users` LIMIT ? OFFSET ?",
    			[]interface{}{limit10, 20},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{Limit: &limit0}},
    			"SELECT * FROM `users` LIMIT ?",
    			[]interface{}{limit0},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{Limit: &limit0}, clause.Limit{Offset: 0}},
    			"SELECT * FROM `users` LIMIT ?",
    			[]interface{}{limit0},
    		},
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Tue Feb 06 02:54:40 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  8. tests/test_security_http_basic_realm.py

    app = FastAPI()
    
    security = HTTPBasic(realm="simple")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPBasicCredentials = Security(security)):
        return {"username": credentials.username, "password": credentials.password}
    
    
    client = TestClient(app)
    
    
    def test_security_http_basic():
        response = client.get("/users/me", auth=("john", "secret"))
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  9. tests/test_security_api_key_query_optional.py

    api_key = APIKeyQuery(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: Optional[User] = Depends(get_current_user)):
        if current_user is None:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  10. tests/test_security_api_key_cookie_optional.py

    api_key = APIKeyCookie(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    def read_current_user(current_user: User = Depends(get_current_user)):
        if current_user is None:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
Back to top