- Sort Score
- Result 10 results
- Languages All
Results 81 - 90 of 1,087 for tolen (0.04 sec)
-
security/pkg/nodeagent/caclient/credentials.go
if t == nil { return nil, nil } token, err := t.GetToken() if err != nil { return nil, err } if token == "" { return nil, nil } return map[string]string{ "authorization": "Bearer " + token, }, nil } // Allow the token provider to be used regardless of transport security; callers can determine whether // this is safe themselves.
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Thu May 16 22:12:28 UTC 2024 - 2.4K bytes - Viewed (0) -
tests/test_security_oauth2_password_bearer_optional.py
from fastapi.testclient import TestClient app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token", auto_error=False) @app.get("/items/") async def read_items(token: Optional[str] = Security(oauth2_scheme)): if token is None: return {"msg": "Create an account first"} return {"token": token} client = TestClient(app) def test_no_token(): response = client.get("/items")
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.1K bytes - Viewed (0) -
docs_src/security/tutorial002_an_py310.py
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: str | None = None full_name: str | None = None disabled: bool | None = None def fake_decode_token(token): return User( username=token + "fakedecoded", email="******@****.***", full_name="John Doe" ) async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 761 bytes - Viewed (0) -
staging/src/k8s.io/api/authentication/v1beta1/generated.proto
// Status is filled in by the server and indicates whether the token can be authenticated. // +optional optional TokenReviewStatus status = 3; } // TokenReviewSpec is a description of the token authentication request. message TokenReviewSpec { // Token is the opaque bearer token. // +optional optional string token = 1; // Audiences is a list of the identifiers that the resource server presented
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Mar 28 15:34:11 UTC 2024 - 5.3K bytes - Viewed (0) -
tests/test_tutorial/test_header_params/test_tutorial003.py
@pytest.mark.parametrize( "path,headers,expected_status,expected_response", [ ("/items", None, 200, {"X-Token values": None}), ("/items", {"x-token": "foo"}, 200, {"X-Token values": ["foo"]}), ( "/items", [("x-token", "foo"), ("x-token", "bar")], 200, {"X-Token values": ["foo", "bar"]}, ), ], ) def test(path, headers, expected_status, expected_response):
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Fri Jan 12 14:52:00 UTC 2024 - 4.1K bytes - Viewed (0) -
docs_src/security/tutorial002.py
from pydantic import BaseModel app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None def fake_decode_token(token): return User( username=token + "fakedecoded", email="******@****.***", full_name="John Doe" )
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 755 bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial012_an.py
response = client.get("/items/", headers={"X-Token": "invalid"}) assert response.status_code == 400, response.text assert response.json() == {"detail": "X-Token header invalid"} def test_get_invalid_one_users(): response = client.get("/users/", headers={"X-Token": "invalid"}) assert response.status_code == 400, response.text assert response.json() == {"detail": "X-Token header invalid"}
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 8.4K bytes - Viewed (0) -
src/log/slog/example_logvaluer_secret_test.go
package slog_test import ( "log/slog" "log/slog/internal/slogtest" "os" ) // A token is a secret value that grants permissions. type Token string // LogValue implements slog.LogValuer. // It avoids revealing the token. func (Token) LogValue() slog.Value { return slog.StringValue("REDACTED_TOKEN") } // This example demonstrates a Value that replaces itself
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 04 18:32:54 UTC 2023 - 906 bytes - Viewed (0) -
cmd/kubeadm/test/cmd/join_test.go
} } func TestCmdJoinDiscoveryToken(t *testing.T) { var initTest = []struct { name string args string expected bool }{ {"valid discovery token", "--discovery-token=foobar", false}, {"valid discovery token url", "--discovery-token=token://asdf:asdf", false}, } kubeadmPath := getKubeadmPath() for _, rt := range initTest { t.Run(rt.name, func(t *testing.T) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Apr 08 21:47:16 UTC 2020 - 6.6K bytes - Viewed (0) -
docs_src/security/tutorial002_an.py
app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") class User(BaseModel): username: str email: Union[str, None] = None full_name: Union[str, None] = None disabled: Union[bool, None] = None def fake_decode_token(token): return User( username=token + "fakedecoded", email="******@****.***", full_name="John Doe" )
Registered: Mon Jun 17 08:32:26 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 815 bytes - Viewed (0)