1#!/usr/bin/env python3
2"""Provision a first-party OIDC client through the dashboard's host-only CLI."""
3import json
4import subprocess
5import sys
6
7data = json.load(sys.stdin)
8if data["request"]["kind"] != "client":
9 raise ValueError("unsupported Snowglobe input")
10result = subprocess.run(
11 ["podman", "exec", "-i", "studio-dashboard", "/bin/home-dashboard", "--oidc-client"],
12 input=json.dumps(data), text=True, check=True, capture_output=True,
13)
14sys.stdout.write(result.stdout)