You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform tests automatically detect and use the appropriate authentication method:
8485
+
Platform tests automatically detect and use the appropriate authentication method via `_base_headers()` helper function.
8508
8486
8509
-
```python
8510
-
from tests.platform.helper import _base_headers
8511
-
8512
-
# Headers automatically include OIDC token or API key
8513
-
headers = _base_headers()
8514
-
response = requests.get(url, headers=headers)
8515
-
```
8516
-
8517
-
The authentication selection follows this priority:
8487
+
Authentication priority:
8518
8488
1.**OIDC** (if `OIDC_TEST_ISSUER` and related vars are set)
8519
8489
2.**API Key** (if `FELDERA_API_KEY` is set)
8520
8490
3.**No Auth** (for local testing without authentication)
@@ -8533,6 +8503,27 @@ env:
8533
8503
```
8534
8504
8535
8505
This ensures consistent authentication across both "Runtime Integration Tests" and "Platform Integration Tests (OSS Docker Image)" workflows that run in parallel.
8506
+
8507
+
### OIDC Usage Beyond Testing
8508
+
8509
+
The OIDC infrastructure is designed to be reusable outside of the test suite:
8510
+
8511
+
#### Demo Runners and External Tools
8512
+
8513
+
External tools can reuse the OIDC infrastructure by calling `setup_token_cache()` followed by `_get_effective_api_key()` to get cached tokens or fallback API keys.
8514
+
8515
+
#### Token Caching for Multiple Processes
8516
+
8517
+
The token caching system is designed to work across multiple processes:
8518
+
8519
+
1. **First Process**: Calls `setup_token_cache()` → fetches and caches token in environment
8520
+
2. **Subsequent Processes**: Call `setup_token_cache()` → reuses cached token if still valid
8521
+
3. **Automatic Refresh**: Fetches new token only when cached token expires
8522
+
8523
+
This pattern is used by:
8524
+
- **Pytest Test Runs**: Master node fetches token, workers reuse it
8525
+
- **Demo Runners**: `demo/all-packaged/run.py` uses the same caching mechanism
8526
+
- **CI Workflows**: Multiple demos in sequence reuse the same token
0 commit comments