Qpid Proton C++ API  0.18.1
sasl.hpp
Go to the documentation of this file.
1 #ifndef PROTON_SASL_HPP
2 #define PROTON_SASL_HPP
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include "./internal/export.hpp"
26 #include "./internal/config.hpp"
27 #include "./internal/object.hpp"
28 
29 #include <proton/sasl.h>
30 
31 #include <string>
32 
35 
36 namespace proton {
37 
39 class sasl {
41  sasl(pn_sasl_t* s) : object_(s) {}
43 
44 #if PN_CPP_HAS_DELETED_FUNCTIONS
45  sasl() = delete;
46 #else
47  sasl();
48 #endif
49 
50  public:
52  enum outcome {
53  NONE = PN_SASL_NONE,
54  OK = PN_SASL_OK,
55  AUTH = PN_SASL_AUTH,
56  SYS = PN_SASL_SYS,
57  PERM = PN_SASL_PERM,
58  TEMP = PN_SASL_TEMP
59  };
60 
62  PN_CPP_EXTERN enum outcome outcome() const;
63 
65  PN_CPP_EXTERN std::string user() const;
66 
68  PN_CPP_EXTERN std::string mech() const;
69 
71  private:
72  pn_sasl_t* const object_;
73 
74  friend class transport;
76 };
77 
78 } // proton
79 
80 #endif // PROTON_SASL_HPP
Failed due to a system error.
Definition: sasl.hpp:56
Failed due to unrecoverable error.
Definition: sasl.hpp:57
std::string mech() const
Get the mechanism.
SASL information.
Definition: sasl.hpp:39
Failed due to bad credentials.
Definition: sasl.hpp:55
std::string user() const
Get the user name.
Authentication succeeded.
Definition: sasl.hpp:54
Failed due to transient error.
Definition: sasl.hpp:58
Negotiation not completed.
Definition: sasl.hpp:53
enum outcome outcome() const
Get the outcome.
A network channel supporting an AMQP connection.
Definition: transport.hpp:37
outcome
The result of the SASL negotiation.
Definition: sasl.hpp:52
The main Proton namespace.
Definition: annotation_key.hpp:33