Details
Description
One of our prospects working with PHP SDK found a potential bug. He tried a password with a colon (":") character, and it doesn't seem to work from a test PHP script.
Steps to reproduce:
- Create a user with at least "read" permissions to a bucket and a password with a ":" character. For this test, I created "admin" user with "zzz:zzz" password on 'travel-sample' bucket.
- Try running a N1QL query against the bucket via N1QL REST API. Here is a URL to test from Postman app for Chrome or similar REST client:
- Try reading from the same bucket with a PHP script. Below is the sample script:
<?php
|
#$cluster = new CouchbaseCluster("couchbase://10.211.55.2"); # Connect from Parallels Desktop VM |
$cluster = new CouchbaseCluster("couchbase://127.0.0.1"); # Connect from Parallels Desktop VM |
#$cluster->authenticateAs("admin1", "password"); |
$cluster->authenticateAs("admin", "zzz:zzz"); |
$bucket = $cluster->openBucket('travel-sample'); |
$query = CouchbaseN1qlQuery::fromString('SELECT `name` FROM `travel-sample` WHERE `name` IS NOT NULL LIMIT 10'); |
$result = $bucket->query($query);
|
|
foreach ($result->rows as $row)
|
{
|
var_dump($row);
|
}
|
?>
|
|