Skip to content

feat: add --mode uuid|word to random alias creation. Closes #51 - #58

Merged
mexcool merged 2 commits into
mainfrom
feat/alias-create-mode
Mar 26, 2026
Merged

feat: add --mode uuid|word to random alias creation. Closes #51#58
mexcool merged 2 commits into
mainfrom
feat/alias-create-mode

Conversation

@mexcool

@mexcool mexcool commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds --mode flag (uuid or word) to sl alias create --random, forwarded as ?mode= query parameter to the SimpleLogin POST /api/alias/random/new endpoint.
  • Validates the flag value and includes help text examples.
  • Adds a dedicated test (TestClient_CreateRandomAlias_WithMode) verifying the query parameter is sent correctly.

Changed files

  • internal/api/client.goCreateRandomAlias now accepts a mode parameter and appends it to the URL.
  • cmd/alias/create.go — new --mode flag with validation; passed through on the --random path only.
  • internal/api/client_test.go — updated existing test call site; added new test for mode query parameter.

Test plan

  • go build ./... passes
  • go vet ./... passes
  • go test ./... passes (including new TestClient_CreateRandomAlias_WithMode)

@mexcool
mexcool merged commit 5314449 into main Mar 26, 2026
1 check passed
@mexcool
mexcool deleted the feat/alias-create-mode branch March 26, 2026 21:30
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