Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,396 for user4 (0.05 sec)

  1. docs/zh/docs/tutorial/security/get-current-user.md

    ## 获取用户
    
    `get_current_user` 使用创建的(伪)工具函数,该函数接收 `str` 类型的令牌,并返回 Pydantic 的 `User` 模型:
    
    ```Python hl_lines="19-22  26-27"
    {!../../../docs_src/security/tutorial002.py!}
    ```
    
    ## 注入当前用户
    
    在*路径操作* 的 `Depends` 中使用 `get_current_user`:
    
    ```Python hl_lines="31"
    {!../../../docs_src/security/tutorial002.py!}
    ```
    
    注意,此处把 `current_user` 的类型声明为 Pydantic 的 `User` 模型。
    
    这有助于在函数内部使用代码补全和类型检查。
    
    !!! tip "提示"
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 22:46:46 UTC 2024
    - 3.5K bytes
    - Viewed (0)
  2. tests/associations_has_one_test.go

    )
    
    func TestHasOneAssociation(t *testing.T) {
    	user := *GetUser("hasone", Config{Account: true})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	CheckUser(t, user, user)
    
    	// Find
    	var user2 User
    	DB.Find(&user2, "id = ?", user.ID)
    	DB.Model(&user2).Association("Account").Find(&user2.Account)
    	CheckUser(t, user2, user)
    
    	// Count
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/security/get-current-user.md

        {!> ../../../docs_src/security/tutorial002_py310.py!}
        ```
    
    Pydantic 모델인 `User`로 `current_user`의 타입을 선언하는 것을 알아야 합니다.
    
    이것은 모든 완료 및 타입 검사를 통해 함수 내부에서 우리를 도울 것입니다.
    
    !!! tip "팁"
        요청 본문도 Pydantic 모델로 선언된다는 것을 기억할 것입니다.
    
        여기서 **FastAPI**는 `Depends`를 사용하고 있기 때문에 혼동되지 않습니다.
    
    !!! check "확인"
        이 의존성 시스템이 설계된 방식은 모두 `User` 모델을 반환하는 다양한 의존성(다른 "의존적인")을 가질 수 있도록 합니다.
    
        해당 타입의 데이터를 반환할 수 있는 의존성이 하나만 있는 것으로 제한되지 않습니다.
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  4. docs/de/docs/tutorial/security/get-current-user.md

        ```
    
    ## Den Benutzer holen
    
    `get_current_user` wird eine von uns erstellte (gefakte) Hilfsfunktion verwenden, welche einen Token vom Typ `str` entgegennimmt und unser Pydantic-`User`-Modell zurückgibt:
    
    === "Python 3.10+"
    
        ```Python hl_lines="19-22  26-27"
        {!> ../../../docs_src/security/tutorial002_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 18:08:05 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/security/get-current-user.md

    `get_current_user` は作成した(偽物の)ユーティリティ関数を使って、 `str` としてトークンを受け取り、先ほどのPydanticの `User` モデルを返却します:
    
    ```Python hl_lines="19-22  26-27"
    {!../../../docs_src/security/tutorial002.py!}
    ```
    
    ## 現在のユーザーの注入
    
    ですので、 `get_current_user` に対して同様に *path operation* の中で `Depends` を利用できます。
    
    ```Python hl_lines="31"
    {!../../../docs_src/security/tutorial002.py!}
    ```
    
    Pydanticモデルの `User` として、 `current_user` の型を宣言することに注意してください。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sun Jan 28 18:36:35 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  6. docs/en/docs/fastapi-people.md

    Hey! 👋
    
    This is me:
    
    {% if people %}
    <div class="user-list user-list-center">
    {% for user in people.maintainers %}
    
    <div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">Answers: {{ user.answers }}</div><div class="count">Pull Requests: {{ user.prs }}</div></div>
    {% endfor %}
    
    </div>
    {% endif %}
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 16 23:54:24 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  7. tests/prepared_stmt_test.go

    	defer cancel()
    	txCtx := tx.WithContext(ctx)
    
    	user := *GetUser("prepared_stmt", Config{})
    
    	txCtx.Create(&user)
    
    	var result1 User
    	if err := txCtx.Find(&result1, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    	}
    
    	time.Sleep(time.Second)
    
    	var result2 User
    	if err := tx.Find(&result2, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  8. helm/minio/templates/_helper_create_user.txt

        rm -f $MINIO_ACCESSKEY_SECRETKEY_TMP
        return 1
      fi
      USER=$(head -1 $MINIO_ACCESSKEY_SECRETKEY_TMP)
      # Create the user if it does not exist
      if ! checkUserExists ; then
        echo "Creating user '$USER'"
        cat $MINIO_ACCESSKEY_SECRETKEY_TMP | ${MC} admin user add myminio
      else
        echo "User '$USER' already exists."
      fi
      #clean up credentials files.
      rm -f $MINIO_ACCESSKEY_SECRETKEY_TMP
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Dec 12 23:43:32 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  9. subprojects/core-api/src/main/java/org/gradle/api/file/FilePermissions.java

     *     <li>OTHER (world) permissions: what actions all other users (non-owner, non-group) can perform on the file/directory</li>
     * </ul>
     * <p>
     * For further details on specific permission for a certain class of user see {@link UserClassFilePermissions}, but in essence
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Mar 06 12:31:43 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  10. docs_src/security/tutorial004_an_py39.py

        access_token = create_access_token(
            data={"sub": user.username}, expires_delta=access_token_expires
        )
        return Token(access_token=access_token, token_type="bearer")
    
    
    @app.get("/users/me/", response_model=User)
    async def read_users_me(
        current_user: Annotated[User, Depends(get_current_active_user)],
    ):
        return current_user
    
    
    @app.get("/users/me/items/")
    async def read_own_items(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Mon May 20 17:37:28 UTC 2024
    - 4.2K bytes
    - Viewed (0)
Back to top