Skip to content

Commit a459e31

Browse files
committed
test: vendor the OAuth conformance fixture
sandbox_test.py read core's sdk/conformance/oauth-client-credentials.json through a path outside the package. Copy it to tests/fixtures. The conformance:check task added with the build tooling compares it with core at the pinned tag. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 00df36e commit a459e31

3 files changed

Lines changed: 47 additions & 3 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"request": {
3+
"grant_type": "client_credentials",
4+
"client_id": "service-client",
5+
"client_secret": "conformance-secret",
6+
"scopes": ["sandbox:read", "sandbox:write"],
7+
"scope": "sandbox:read sandbox:write",
8+
"audience": "openshell-gateway",
9+
"forbidden_implicit_scopes": ["openid", "profile", "email"]
10+
},
11+
"expiry": {
12+
"leeway_seconds": 30,
13+
"valid_expires_in": 120,
14+
"invalid_expires_in": [0, -1, "NaN", null]
15+
},
16+
"discovery": {
17+
"configured_issuer": "https://issuer.example.com",
18+
"matching_issuer": "https://issuer.example.com/",
19+
"mismatched_issuer": "https://attacker.example.com",
20+
"redirect_statuses": [301, 302, 307, 308]
21+
},
22+
"limits": {
23+
"max_response_bytes": 1048576
24+
},
25+
"urls": {
26+
"allowed": [
27+
"https://issuer.example.com",
28+
"http://localhost:8080",
29+
"http://127.0.0.1:8080",
30+
"http://127.42.0.1:8080",
31+
"http://[::1]:8080"
32+
],
33+
"rejected": [
34+
"http://issuer.example.com",
35+
"https://user@issuer.example.com",
36+
"https://issuer.example.com/#fragment"
37+
]
38+
},
39+
"redaction": {
40+
"secret": "conformance-secret",
41+
"supplier_error": "supplier-sensitive-detail",
42+
"provider_body": "provider-sensitive-detail"
43+
}
44+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
SPDX-License-Identifier: Apache-2.0

‎tests/sandbox_test.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ def _request_sandbox(request: Any) -> str:
7676

7777
def _client_credentials_fixture() -> dict[str, Any]:
7878
return json.loads(
79-
(
80-
Path(__file__).parents[2] / "sdk/conformance/oauth-client-credentials.json"
81-
).read_text()
79+
(Path(__file__).parent / "fixtures/oauth-client-credentials.json").read_text()
8280
)
8381

8482

0 commit comments

Comments
 (0)