MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _write_bundle

Function _write_bundle

python/openshell/sandbox_test.py:506–523  ·  view source on GitHub ↗
(
    gateway_dir: Path,
    *,
    access_token: str = "fresh",
    refresh_token: str = "r-orig",
    expires_at: int | None = None,
    issuer: str = "https://idp.example/realms/openshell",
    client_id: str = "openshell-cli",
)

Source from the content-addressed store, hash-verified

504
505
506def _write_bundle(
507 gateway_dir: Path,
508 *,
509 access_token: str = "fresh",
510 refresh_token: str = "r-orig",
511 expires_at: int | None = None,
512 issuer: str = "https://idp.example/realms/openshell",
513 client_id: str = "openshell-cli",
514) -> None:
515 bundle: dict[str, Any] = {
516 "access_token": access_token,
517 "refresh_token": refresh_token,
518 "issuer": issuer,
519 "client_id": client_id,
520 }
521 if expires_at is not None:
522 bundle["expires_at"] = expires_at
523 (gateway_dir / "oidc_token.json").write_text(json.dumps(bundle))
524
525
526DEFAULT_ISSUER = "https://idp.example/realms/openshell"

Calls

no outgoing calls

Tested by

no test coverage detected