Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 91 for username (0.22 sec)

  1. tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py

    @needs_py39
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    @needs_py39
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  2. internal/config/identity/ldap/ldap.go

    	if err = l.LDAP.LookupBind(conn); err != nil {
    		return "", err
    	}
    
    	// Check if the passed in username is a valid DN.
    	if !l.ParsesAsDN(username) {
    		// We consider it as a login username and attempt to check it exists in
    		// the directory.
    		bindDN, err := l.LDAP.LookupUserDN(conn, username)
    		if err != nil {
    			if strings.Contains(err.Error(), "User DN not found for") {
    				return "", nil
    			}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 25 15:50:16 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  3. cmd/bucket-policy.go

    	currTime := UTCNow()
    
    	var (
    		username = cred.AccessKey
    		claims   = cred.Claims
    		groups   = cred.Groups
    	)
    
    	if cred.IsTemp() || cred.IsServiceAccount() {
    		// For derived credentials, check the parent user's permissions.
    		username = cred.ParentUser
    	}
    
    	principalType := "Anonymous"
    	if username != "" {
    		principalType = "User"
    		if len(claims) > 0 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 8K bytes
    - Viewed (0)
  4. 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
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_forms/test_tutorial001.py

    
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_forms/test_tutorial001_an.py

    
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
        assert response.json() == {"username": "Foo"}
    
    
    def test_post_body_form_no_password(client: TestClient):
        response = client.post("/login/", data={"username": "Foo"})
        assert response.status_code == 422
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (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: Optional[str] = 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()):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.9K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/security/first-steps.md

    Então, vamos rever de um ponto de vista simplificado:
    
    * O usuário digita o `username` e a `senha` no frontend e aperta `Enter`.
    * O frontend (rodando no browser do usuário) manda o `username` e a `senha` para uma URL específica na sua API (declarada com `tokenUrl="token"`).
    * A API checa aquele `username` e `senha`, e responde com um "token" (nós não implementamos nada disso ainda).
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  9. tests/test_security_oauth2_optional.py

            }
        },
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = 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()):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  10. tests/test_filter_pydantic_sub_model_pv2.py

                        },
                    },
                    "ModelB": {
                        "title": "ModelB",
                        "required": ["username"],
                        "type": "object",
                        "properties": {"username": {"title": "Username", "type": "string"}},
                    },
                    "ValidationError": {
                        "title": "ValidationError",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.3K bytes
    - Viewed (0)
Back to top