REST API List buckets
When using /pools/default/buckets to get a list of buckets, there is unexpected behavior that tripped me up a bit.
This behavior can be proven with just a browser.
If you have ONLY buckets WITH passwords, no authentication is required. Response is a list of all buckets Good.
If you have ONLY buckets WITHOUT passwords, authentication is required. Response is a list of all buckets. Good.
If you have a mixture of buckets WITH *and* WITHOUT passwords, you get a list of only non-passworded buckets if you have not previously entered credentials in the browser, and a list of all buckets if you have.
In .Net I am using HttpWebRequest, and specifying Credentials. But, I only get back a list of non-passworded buckets, not all buckets.
Because the web response doesn't do an authentication step, HttpWebRequest does not establish an authenticated connection. So there is no way to get a full list of buckets, even though I have the credentials needed!
If there are only passworded buckets, then authentication is performed and HttpWebRequest provides the list just fine.
Desired behavior from my point of view, is that if there are any passworded buckets, then authentication would be required, rather than getting back an incomplete list of buckets.
I understand others could see it differently, and want it the way it is.
Just want to throw out the request and see what others think.
I haven't tried it, but I suspect couchbase-cli.exe has the same problem, of not being able to list all buckets, even if credentials are supplied.
In the meantime, it works for me to have all my buckets be passworded. So, I'm OK. Just wanted to throw this info out to the public, since I got tripped up by it.