The Rest API generate results do not align with the documentation

After starting the local API Server with bw serve I try to use the API according to this documentation.
When using the /generate command the documentation does not hold up to the results.

/generate → 14 chars, upper, lower, number, specials → default(?), fine
/generate?special=false → 14 chars, numbers, specials → wtf?
/generate?number=true → 14 chars, numbers, specials → wtf?

most of the combinations do not make any sense.
In general:

  • all false values are ignored completly
  • I cannot generate a PW without special characters and numbers.
  • I checked the admin policy for password generation and there is nothing required.
  • The parameters that do work as expected are all things around passphrase and the length parameter.

Do I use an outdated API doc? Are the endpoint parameters broken? Did I miss anything else?

Thank you for your input.

Ok after updating the bw cli to the current version (winget didn’t apply any updates. maybe because it was running in the background all the time.) it looks a little bit different.

/generate → 14 chars, upper, lower, number → default(?), fine
/generate?special=false → 14 chars, numbers, specials → wtf?
/generate?number=true → 14 chars, numbers → fine
/generate?lowercase=false → 14 chars, lower, numbers
/generate?uppercase=false → 14 chars, upper, numbers
so

  • the boolean values are still not used correctly for any parameter
  • specials are now only added when the parameter exists (regardless of the value)
  • numbers are always added into the mix

Better but still not as documented.

Hi @ccarpo , thanks for bringing this back up! It appears to be related to Vault HTTP API doesn't respect many boolean parameter values · Issue #4387 · bitwarden/clients · GitHub which I’ve reopened. Can you please add the information you shared here and any additional details you may have to the issue?

Thank you!

Thank you very much bringing this bug to my attention. I’ll continue there.