Sha256: 4c55fc27656231472b2af948087fc25f497353df019f9ddc3a1dc334047315e2

Contents?: true

Size: 1.16 KB

Versions: 32

Compression:

Stored size: 1.16 KB

Contents

/*
 *     Copyright 2018 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

#include <cbsasl/plain/plain.h>

namespace couchbase::sasl::mechanism::plain
{

std::pair<error, std::string_view>
ClientBackend::start()
{
    auto usernm = usernameCallback();
    auto passwd = passwordCallback();

    buffer.push_back(0);
    std::copy(usernm.begin(), usernm.end(), std::back_inserter(buffer));
    buffer.push_back(0);
    std::copy(passwd.begin(), passwd.end(), std::back_inserter(buffer));

    return std::make_pair<error, std::string_view>(error::OK, { buffer.data(), buffer.size() });
}

} // namespace couchbase::sasl::mechanism::plain

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
couchbase-3.0.0.alpha.3-x86_64-linux ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.3-x86_64-darwin-19 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.3-universal-darwin-19 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.3 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.2-x86_64-linux ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.2-x86_64-darwin-19 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.2-universal-darwin-19 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.2 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.1-x86_64-linux ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.1-x86_64-darwin-19 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.1-universal-darwin-19 ext/couchbase/cbsasl/plain/plain.cc
couchbase-3.0.0.alpha.1 ext/couchbase/cbsasl/plain/plain.cc