Sha256: 8553ce812617e679bdcab113809caa6363ee0a03053afe6a4667affbe249cb61

Contents?: true

Size: 1.54 KB

Versions: 35

Compression:

Stored size: 1.54 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::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::sasl::mechanism::scram

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
couchbase-3.3.0 ext/couchbase/couchbase/sasl/scram-sha/stringutils.h
couchbase-3.2.0-universal-darwin-20 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.2.0 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.1.1 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.1.1-universal-darwin-20 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.1.0 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.3 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.3-universal-darwin-20 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.2 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.1-universal-darwin-19 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.1 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0-universal-darwin-19 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.beta.1-universal-darwin-19 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.beta.1 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.alpha.5-x86_64-linux ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.alpha.5-universal-darwin-19 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.alpha.5-x86_64-darwin-19 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.alpha.5 ext/couchbase/cbsasl/scram-sha/stringutils.h
couchbase-3.0.0.alpha.4-x86_64-linux ext/couchbase/cbsasl/scram-sha/stringutils.h