Documentation
¶
Overview ¶
create.go — `drift account create`. Two-step signup:
- Initiate — POST /signup/initiate with {username, password, email}. Password travels in plaintext over TLS; the auth service bcrypts on receipt before persisting. The CLI does NOT bcrypt — that keeps signup symmetric with login (which has always sent plaintext) and lets the server enforce its own password rules on the actual plaintext rather than on a hash.
- Verify — user enters the 6-digit OTP from email, CLI POSTs /signup/verify, server materialises the account and returns the JWT pair.
Password length and username shape are validated client-side as a UX nicety (so a typo doesn't round-trip the email-OTP step before failing). The server validates the same rules on receipt.
login.go — `drift account login`. POSTs `{username, password, device_id}` to /login; on success, persists the JWT pair to `~/.drift/session.json` (mode 0600). The device_id is a stable per-workstation random ID (see common/session.go :: GetOrCreateDeviceID) — refresh tokens are bound to it, so a stolen session.json without the matching device_id can't refresh.
Three ways to supply the password:
- Interactive (default) — `drift account login` prompts for it with terminal echo disabled.
- --password-stdin — `echo $PASS | drift account login -u alice --password-stdin`. The password never appears as a process argument; doesn't show up in `ps`, shell history, or process-listing logs. The pattern gh / docker login / kubectl / doctl / op all use. Recommended for CI.
- --password (-p) — kept for backward compatibility but prints a deprecation warning. The password ends up in shell history and `ps` output. Migrate to --password-stdin.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchUsage ¶
func FetchUsage() (usageResponse, error)
FetchUsage calls GET /ops/plan/usage and returns the parsed response.
func GetAccountCmd ¶
GetAccountCmd returns the "drift account" command group. Subcommands: signup, login.
func GetCreateCmd ¶
func GetLoginCmd ¶
func GetPlanCmd ¶
GetPlanCmd returns the "drift plan drift.yaml" command, which runs a pre-flight check of a manifest against the user's current plan quota.
Types ¶
This section is empty.