Skip to content

feat: add --email and --ssh-key flags to signup command#171

Closed
AlephNotation wants to merge 2 commits intomainfrom
feat/signup-email-ssh-flags
Closed

feat: add --email and --ssh-key flags to signup command#171
AlephNotation wants to merge 2 commits intomainfrom
feat/signup-email-ssh-flags

Conversation

@AlephNotation
Copy link
Copy Markdown
Contributor

Summary

Adds --email and --ssh-key flags to vers signup so users and agents can specify credentials explicitly instead of relying on auto-detection.

Usage

# Fully explicit (no auto-detection, no stdin)
vers signup --email me@co.com --ssh-key ~/.ssh/id_ed25519.pub --org myorg

# Just override email, auto-detect SSH key
vers signup --email me@co.com

# Just override SSH key, read email from git config
vers signup --ssh-key /path/to/key.pub

Validation

  • Email: RFC 5322 format via net/mail.ParseAddress
  • SSH key file:
    • File exists and is not a directory
    • Not too large (16KB limit — catches accidental private key files)
    • Valid key type prefix (ssh-ed25519, ssh-rsa, ecdsa-sha2-*, sk-*)
    • Has base64 key data field

Tests

  • internal/auth/shellauth_test.go — 12 test cases for SSH key validation (valid keys, missing files, empty, wrong type, oversized, private key detection)
  • cmd/signup_test.go — flag existence and defaults

- --email: specify email directly instead of reading from git config
- --ssh-key: path to SSH public key file instead of auto-detecting
- Validates email format (RFC 5322) and SSH key structure (type, base64 data, size)
- Tests for SSH key validation: valid keys, missing files, empty, wrong type, too large, private key
@AlephNotation
Copy link
Copy Markdown
Contributor Author

obsoleted by #172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant