Skip to content

[deckhouse-cli] add docs and htpasswd - #446

Open
ldmonster wants to merge 3 commits into
mainfrom
feat/mirror-bundle-docs
Open

[deckhouse-cli] add docs and htpasswd#446
ldmonster wants to merge 3 commits into
mainfrom
feat/mirror-bundle-docs

Conversation

@ldmonster

@ldmonster ldmonster commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

New command: d8 tools htpasswd

A drop-in analog of Apache htpasswd that manages password files and hashes passwords without requiring the external htpasswd binary (apache2-utils / httpd-tools). Its primary purpose is generating a bcrypt hash for d8 iam user create / d8 iam user reset-password --password-hash, replacing the previous README recipe that shelled out to htpasswd -BinC 10 "" | cut -d: -f2 | tr -d '\n':

HASH="$(echo -n 'Test12345!' | d8 tools htpasswd -ni)"
d8 iam user reset-password test-user --password-hash "$HASH"

Full htpasswd parity:

  • Operations: create (-c), delete (-D), verify (-v), print-to-stdout (-n); atomic file writes that preserve other entries and comments.
  • Password input: batch (-b), stdin (-i), interactive prompt with confirmation.
  • Algorithms: bcrypt (-B), apr1-MD5 (-m), SHA-256/512 crypt (-2/-5), plus the insecure legacy schemes DES crypt (-d), SHA-1 (-s), plaintext (-p). Flag bundling (-nbB) and digit flags (-2/-5) work as in htpasswd.
  • Parameters: bcrypt -C cost, SHA -r rounds.

Two intentional, documented deviations from Apache htpasswd:

  • Default is bcrypt at cost 10 (htpasswd defaults to apr1 at cost 5), so the output is strong and directly usable by d8 iam user.
  • With -n and no username, the bare hash is printed (htpasswd always requires a username and prints user:hash) — exactly what --password-hash consumes.

bcrypt output uses the $2y$ identifier for byte-level parity with htpasswd.

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
@ldmonster ldmonster self-assigned this Aug 17, 2026
@ldmonster ldmonster added the enhancement New feature or request label Aug 17, 2026
@ldmonster ldmonster changed the title [deckhouse-cli] add docs and httpasswd [deckhouse-cli] add docs and htpasswd Aug 17, 2026
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant