mvdan / bitw

Minimalist BitWarden client
BSD 3-Clause "New" or "Revised" License
169 stars 15 forks source link

Fix reading apiurl/identyurl from configuration. #20

Closed Mic92 closed 4 years ago

mvdan commented 4 years ago

I think the CI failures are because the secrets aren't available to PRs. I'll take a look.

mvdan commented 4 years ago

Sorry, but I'll have to revert the ini config commit. I've confirmed that it was the cause of the failures. See testdata/scripts/config.txt; the keys aren't case insensitive.

Of course, we could make them case insensitive if we really want. I'm not sure what's most common with ini files. But such a change would need to make sure the tests aren't broken.

Mic92 commented 4 years ago

They were case-sensitive on my system. Without the patch I cannot set apiurl or identityurl. The tests must be incorrect. This is my configuration:

email = joerg@higgsboson.tk
apiURL = https://bitwarden.thalheim.io/api
identityURL = https://bitwarden.thalheim.io/identity

without the patch it returns:

error: unknown config key: "apiurl"
mvdan commented 4 years ago

OK, I see what you're saying now. The tests don't cover this scenario, because the user/password is always supplied via env vars. There's indeed a bug here.

mvdan commented 4 years ago

@Mic92 that bug should now be fixed, and I've adapted the tests to still pass.