How to execute N1QL queries against a SASL password protected bucket

Looks like the way to go is something like this:

public function queryN1QL(\CouchbaseN1qlQuery $query, $params = NULL, $json_array = FALSE) {
    $this->enableN1ql();
    try {
      $query->options["creds"] = [(object) ["user" => "couch", "pass" => "couch"]];
      return $this->bucket->query($query, $params, $json_array);
    }
    catch (\Exception $e) {
      [...]
    }
  }

I say something because I was not able to make this work, I am getting the deadly:

creds has to be of type array of { user, pass }

That seems to have been reported here:

https://issues.couchbase.com/browse/MB-16964

Related posts:

Any hint on how to do this on the PHP SDK?

Thanks!