sasl.hpp
Go to the documentation of this file.
#ifndef PROTON_SASL_HPP
#define PROTON_SASL_HPP
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 "./internal/export.hpp"
#include "./internal/config.hpp"
#include "./internal/object.hpp"
#include <proton/sasl.h>
#include <string>
namespace proton {
class sasl {
sasl(pn_sasl_t* s) : object_(s) {}
#if PN_CPP_HAS_DELETED_FUNCTIONS
sasl() = delete;
#else
sasl();
#endif
public:
enum outcome {
NONE = PN_SASL_NONE,
OK = PN_SASL_OK,
AUTH = PN_SASL_AUTH,
SYS = PN_SASL_SYS,
PERM = PN_SASL_PERM,
TEMP = PN_SASL_TEMP
};
PN_CPP_EXTERN enum outcome outcome() const;
PN_CPP_EXTERN std::string user() const;
PN_CPP_EXTERN std::string mech() const;
private:
pn_sasl_t* const object_;
friend class transport;
};
} // proton
#endif // PROTON_SASL_HPP
proton::sasl
SASL information.
Definition: sasl.hpp:39
proton::sasl::user
std::string user() const
Get the user name.
proton::sasl::mech
std::string mech() const
Get the mechanism.
proton::sasl::outcome
outcome
The result of the SASL negotiation.
Definition: sasl.hpp:52
proton::sasl::OK
@ OK
Authentication succeeded.
Definition: sasl.hpp:54
proton::sasl::TEMP
@ TEMP
Failed due to transient error.
Definition: sasl.hpp:58
proton::sasl::SYS
@ SYS
Failed due to a system error.
Definition: sasl.hpp:56
proton::sasl::AUTH
@ AUTH
Failed due to bad credentials.
Definition: sasl.hpp:55
proton::sasl::NONE
@ NONE
Negotiation not completed.
Definition: sasl.hpp:53
proton::sasl::PERM
@ PERM
Failed due to unrecoverable error.
Definition: sasl.hpp:57
proton::transport
A network channel supporting an AMQP connection.
Definition: transport.hpp:37
proton
The main Proton namespace.
Definition: annotation_key.hpp:33