| 1 | #!/usr/bin/env python3 |
| 2 | """Provision a first-party OIDC client through the dashboard's host-only CLI.""" |
| 3 | import json |
| 4 | import subprocess |
| 5 | import sys |
| 6 | |
| 7 | data = json.load(sys.stdin) |
| 8 | if data["request"]["kind"] != "client": |
| 9 | raise ValueError("unsupported Snowglobe input") |
| 10 | result = 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 | ) |
| 14 | sys.stdout.write(result.stdout) |