Sha256: 1e7a3f28be602866351b7545891bdeee80c92e197359a3575bcc885661a0e06b

Contents?: true

Size: 1.56 KB

Versions: 10

Compression:

Stored size: 1.56 KB

Contents

/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2016 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.
 */
#pragma once

#include <string>

namespace couchbase::core::sasl::mechanism::scram
{

/**
 * Apply https://www.ietf.org/rfc/rfc4013.txt to the input string
 *
 * The input string is supposed to be UTF-8 (but given that we don't
 * support bucket names with multibyte characters, we only support
 * single-byte UTF-8 characters ;-))
 *
 * @param string The string to run stringprep with the SASL profile on
 * @return a sasl_prep'd string
 * @throws std::runtime_error if we encounter a multibyte character
 */
const std::string&
sasl_prep(const std::string& string);

/**
 * According to https://www.ietf.org/rfc/rfc5802.txt all occurrences
 * of ',' and '=' needs to be transferred as =2C and =3D.
 *
 * @param username the username to encode
 * @return the escaped string
 */
std::string
encode_username(const std::string& username);

} // namespace couchbase::core::sasl::mechanism::scram

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
couchbase-3.5.3 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.5.2 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.5.1 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.5.0 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.4.5 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.4.4 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.4.3 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.4.2 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.4.1 ext/couchbase/core/sasl/scram-sha/stringutils.h
couchbase-3.4.0 ext/couchbase/core/sasl/scram-sha/stringutils.h