diff options
| author | Michael Goulish <mgoulish@apache.org> | 2010-10-20 08:03:36 +0000 |
|---|---|---|
| committer | Michael Goulish <mgoulish@apache.org> | 2010-10-20 08:03:36 +0000 |
| commit | bcb149706cdace4a333a811969e473451d9ab331 (patch) | |
| tree | 6ad1e5797a8696968b91bdcf511eeac4bf4cb54f /cpp/src/qpid/Sasl.h | |
| parent | 346e5a55b9152ab603bf8b15bd7718beb9d6ff76 (diff) | |
| download | qpid-python-bcb149706cdace4a333a811969e473451d9ab331.tar.gz | |
SASLizing Interbroker Links
-------------------------------------------------------------
1. Brokers already knew how to handle the server side of SASLized
links, but not the client side. So we promoted the client-side
SASL code from the client library to the common library so that
the broker could also use it. This affected SaslFactory.{h,cpp}
and Sasl.h
TODO -- can the server-side and client-side code be unified here?
2. Some of the SASL verbs in broker/ConnectionHandler.cpp are
expanded: start, secure, tune.
3. broker/SecureConnection is altered to get the client-broker and
the server-broker to agree on when the security layer should be
inserted.
4. the python tool qpid-route is modified so that, in the "route add"
command, you can specify the security mechanism for SASL to use.
TODO -- should we also pass in {min,max}SSF ?
5. Changes in broker/LinkRegistry to allow the information input by
qpid-route to be passed up to where it is needed.
6. A bash script test run by "make check" that creates a SASLized
federation link and sends some messages down it.
TODO - write a python unit test instead of a bash script. I
think I uncovered a bug in the python code when I tried.
7. NOTE - testing for this feature does not work with versions of
SASL earlier than 2.1.22, becuase I can't tell SASL to use a
SASL database file in a nonstandard location. The test is
disabled for earlier versions.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1024541 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/Sasl.h')
| -rw-r--r-- | cpp/src/qpid/Sasl.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/cpp/src/qpid/Sasl.h b/cpp/src/qpid/Sasl.h new file mode 100644 index 0000000000..9a9d61b037 --- /dev/null +++ b/cpp/src/qpid/Sasl.h @@ -0,0 +1,60 @@ +#ifndef QPID_SASL_H +#define QPID_SASL_H + +/* + * + * 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 <memory> +#include <string> +#include "qpid/sys/IntegerTypes.h" + +namespace qpid { + +namespace sys { +class SecurityLayer; +struct SecuritySettings; +} + +/** + * Interface to SASL support. This class is implemented by platform-specific + * SASL providers. + */ +class Sasl +{ + public: + /** + * Start SASL negotiation with the broker. + * + * @param mechanisms Comma-separated list of the SASL mechanism the + * client supports. + * @param externalSecuritySettings security related details from the underlying transport + */ + virtual std::string start(const std::string& mechanisms, + const qpid::sys::SecuritySettings* externalSecuritySettings = 0) = 0; + virtual std::string step(const std::string& challenge) = 0; + virtual std::string getMechanism() = 0; + virtual std::string getUserId() = 0; + virtual std::auto_ptr<qpid::sys::SecurityLayer> getSecurityLayer(uint16_t maxFrameSize) = 0; + virtual ~Sasl() {} +}; +} // namespace qpid + +#endif /*!QPID_SASL_H*/ |
