Search Options

Results per page
Sort
Preferred Languages
Advance

Results 101 - 110 of 1,756 for securityv1 (0.28 sec)

  1. tests/test_security_http_basic_optional.py

    from base64 import b64encode
    from typing import Optional
    
    from fastapi import FastAPI, Security
    from fastapi.security import HTTPBasic, HTTPBasicCredentials
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBasic(auto_error=False)
    
    
    @app.get("/users/me")
    def read_current_user(credentials: Optional[HTTPBasicCredentials] = Security(security)):
        if credentials is None:
            return {"msg": "Create an account first"}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/security/oauth2-scopes.md

    ```Python hl_lines="153"
    {!../../../docs_src/security/tutorial005.py!}
    ```
    
    ## 在*路径操作*与依赖项中声明作用域
    
    接下来,为*路径操作*  `/users/me/items/` 声明作用域 `items`。
    
    为此,要从 `fastapi` 中导入并使用 `Security` 。
    
    `Security` 声明依赖项的方式和 `Depends` 一样,但 `Security` 还能接收作用域(字符串)列表类型的参数 `scopes`。
    
    此处使用与 `Depends` 相同的方式,把依赖项函数 `get_current_active_user` 传递给 `Security`。
    
    同时,还传递了作用域**列表**,本例中只传递了一个作用域:`items`(此处支持传递更多作用域)。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 22:43:35 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  3. tests/test_security_api_key_cookie_optional.py

    from typing import Optional
    
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyCookie
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    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
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. tests/test_security_api_key_query_optional.py

    from typing import Optional
    
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyQuery
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    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
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  5. tests/integration/security/testdata/authz/conditions.yaml.tmpl

    apiVersion: security.istio.io/v1beta1
    kind: AuthorizationPolicy
    metadata:
      name: {{ .To.ServiceName }}-request-headers
    spec:
      selector:
        matchLabels:
          app: "{{ .To.ServiceName }}"
      rules:
      - to:
        - operation:
            paths: [ "/request-headers" ]
        when:
        - key: request.headers[x-foo]
          values: [ "foo" ]
      - to:
          - operation:
              paths: [ "/request-headers-notValues" ]
        when:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon May 08 07:03:01 UTC 2023
    - 4K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/JAASAuthenticator.java

    import java.util.Map;
    
    import javax.security.auth.Subject;
    import javax.security.auth.callback.Callback;
    import javax.security.auth.callback.CallbackHandler;
    import javax.security.auth.callback.NameCallback;
    import javax.security.auth.callback.PasswordCallback;
    import javax.security.auth.callback.UnsupportedCallbackException;
    import javax.security.auth.login.Configuration;
    import javax.security.auth.login.LoginContext;
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Sun Jul 01 13:12:10 UTC 2018
    - 8.1K bytes
    - Viewed (0)
  7. tests/common/jwt/jwt_token.go

    const (
    	// Payload {
    	//  "exp": 4715782722,
    	//  "groups": [
    	//    "group-1"
    	//  ],
    	//  "iat": 1562182722,
    	//  "iss": "******@****.***",
    	//  "sub": "sub-1"
    	// }
    	// Generated by: security/tools/jwt/samples/gen-jwt.py tests/common/jwt/key.pem -jwks=tests/common/jwt/jwks.json
    	// --expire=3153600000 --iss=******@****.*** --sub=sub-1 --listclaim groups "group-1"
    	// nolint: lll
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 08 23:36:51 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  8. platforms/software/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/verification/AbstractSignatureVerificationIntegrationTest.groovy

    import org.gradle.integtests.fixtures.executer.GradleExecuter
    import org.gradle.security.fixtures.KeyServer
    import org.gradle.security.fixtures.SigningFixtures
    import org.gradle.security.fixtures.SimpleKeyRing
    import org.gradle.security.internal.Fingerprint
    
    import static org.gradle.security.fixtures.SigningFixtures.createSimpleKeyRing
    import static org.gradle.security.fixtures.SigningFixtures.createSimpleKeyRingFromResource
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 20 13:00:32 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  9. security/pkg/k8s/tokenreview/k8sauthn.go

    	tokenReview := &k8sauth.TokenReview{
    		Spec: k8sauth.TokenReviewSpec{
    			Token: targetToken,
    		},
    	}
    	if aud != nil {
    		tokenReview.Spec.Audiences = aud
    	}
    	reviewRes, err := kubeClient.AuthenticationV1().TokenReviews().Create(context.TODO(), tokenReview, metav1.CreateOptions{})
    	if err != nil {
    		return security.KubernetesInfo{}, err
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Feb 13 17:12:41 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  10. platforms/jvm/ear/src/integTest/resources/org/gradle/plugins/ear/application_1_3.dtd

    ejb | java | web), alt-dd?)> <!-- The role-name element contains the name of a security role. The name must conform to the lexical rules for an NMTOKEN. Used in: security-role --> <!ELEMENT role-name (#PCDATA)> <!-- The security-role element contains the definition of a security role. The definition consists of an optional description of the security role, and the security role name. Used in: application Example: <security-role> <description> This role includes all employees who are authorized to access...
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Jun 02 14:55:02 UTC 2023
    - 8.5K bytes
    - Viewed (0)
Back to top