Implementation:A5c ai Babysitter bootstrap auth
| Knowledge Sources | |
|---|---|
| Domains | Kubernetes, Authentication, Security |
| Last Updated | 2026-10-23 00:00 GMT |
Overview
Concrete tool for bootstrapping Kubernetes authentication credentials for a Kradle environment.
Description
The bootstrapAuth function generates admin credentials and a Kubernetes Secret manifest for a Kradle deployment. It creates a <namespace>-bootstrap-auth Secret containing ADMIN_USERNAME, ADMIN_PASSWORD, ADMIN_TOKEN_SEED, and AUTH_MODE.
For local-dev mode, the password defaults to admin if not specified. For all other modes, an opaque password is generated via randomBytes(18) in base64url. An opaque token seed is always generated.
Usage
- Kradle deployment Step 5: Bootstrap auth credentials after environment installation.
Code Reference
Source Location
- Repository: Babysitter
- File: packages/kradle/installer/src/sdk/auth.ts:L26-52
Signature
function bootstrapAuth(config: CloudConfig): AuthBootstrapResult;
// AuthBootstrapResult: {
// secretName: string,
// username: string,
// password: string,
// tokenSeed: string,
// manifests: KubernetesManifest[],
// env: Record<string, string>
// }
Import
import { bootstrapAuth } from "@a5c-ai/kradle/installer";
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config.namespace | string | Yes | Target namespace |
| config.auth.adminUsername | string | Yes | Admin username |
| config.auth.defaultAdminPassword | string | No | Admin password (auto-generated if absent and not local-dev) |
| config.auth.mode | string | Yes | Auth mode (local-dev or other) |
Outputs
| Name | Type | Description |
|---|---|---|
| AuthBootstrapResult | object | Secret name, username, password, token seed, K8s Secret manifest, env vars |
Usage Examples
Bootstrap Auth
import { loadCloudConfig, bootstrapAuth } from "@a5c-ai/kradle/installer";
const config = await loadCloudConfig({ environment: "staging" });
const auth = bootstrapAuth(config);
console.log("Secret:", auth.secretName);
console.log("Username:", auth.username);
console.log("Password:", auth.password); // auto-generated
console.log("Manifests:", auth.manifests); // K8s Secret manifest
Local Dev (Default Password)
const config = await loadCloudConfig({ environment: "minikube" });
// config.auth.mode = "local-dev"
const auth = bootstrapAuth(config);
console.log(auth.password); // "admin"