same work as PR: https://github.com/ceph/ceph/pull/9193, https://github.com/ceph/ceph/pull/9161
Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
#define CEPH_AUTHTYPES_H
#include "Crypto.h"
-#include "msg/msg_types.h"
-
-#include "common/config.h"
#include "common/entity_name.h"
class Cond;
*
*/
-#include "common/debug.h"
-#include "Auth.h"
#include "AuthAuthorizeHandler.h"
#include "cephx/CephxAuthorizeHandler.h"
#include "none/AuthNoneAuthorizeHandler.h"
-#include "AuthMethodList.h"
#include "common/Mutex.h"
-#define dout_subsys ceph_subsys_auth
-
AuthAuthorizeHandler *AuthAuthorizeHandlerRegistry::get_handler(int protocol)
{
if (!supported.is_supported_auth(protocol)) {
#include "Auth.h"
#include "AuthMethodList.h"
#include "include/types.h"
-
+#include "common/Mutex.h"
// Different classes of session crypto handling
#define SESSION_CRYPTO_NONE 0
#include <errno.h>
#include "AuthClientHandler.h"
-#include "KeyRing.h"
-
-#include "messages/MAuth.h"
-#include "messages/MAuthReply.h"
-
#include "cephx/CephxClientHandler.h"
#include "none/AuthNoneClientHandler.h"
#include "auth/Auth.h"
-
-#include "common/Mutex.h"
-#include "common/Cond.h"
#include "common/RWLock.h"
-#include "common/Timer.h"
-
class CephContext;
struct MAuthReply;
class AuthClientHandler;
*/
#include <algorithm>
-
-#include "common/Mutex.h"
-#include "common/config.h"
#include "common/debug.h"
#include "include/str_list.h"
#include "AuthServiceHandler.h"
#include "cephx/CephxServiceHandler.h"
#include "none/AuthNoneServiceHandler.h"
-#include "AuthMethodList.h"
-#include "common/config.h"
#define dout_subsys ceph_subsys_auth
#define CEPH_AUTHSERVICEHANDLER_H
#include "include/types.h"
-#include "common/config.h"
#include "Auth.h"
class CephContext;
#include "cephx/CephxSessionHandler.h"
#include "none/AuthNoneSessionHandler.h"
#include "unknown/AuthUnknownSessionHandler.h"
-#include "common/config.h"
#define dout_subsys ceph_subsys_auth
#define CEPH_AUTHSESSIONHANDLER_H
#include "include/types.h"
-#include "common/config.h"
-#include "msg/Message.h"
#include "Auth.h"
#define SESSION_SIGNATURE_FAILURE -1
class CephContext;
class KeyServer;
+class Message;
struct AuthSessionHandler {
protected:
#include "common/Clock.h"
#include "common/armor.h"
#include "common/ceph_crypto.h"
-#include "common/config.h"
-#include "common/debug.h"
#include "common/hex.h"
#include "common/safe_io.h"
#include "include/ceph_fs.h"
#include "include/compat.h"
-
+#include "common/Formatter.h"
+#include "common/debug.h"
#include <errno.h>
int get_random_bytes(char *buf, int len)
#include "include/types.h"
#include "include/utime.h"
#include "include/memory.h"
-
-#include "common/Formatter.h"
#include "include/buffer.h"
#include <string>
class CephContext;
class CryptoHandler;
class CryptoKeyContext;
+namespace ceph { class Formatter; }
+
/*
* some per-key context that is specific to a particular crypto backend
#include <memory>
#include <sstream>
#include <algorithm>
-
-#include "auth/AuthMethodList.h"
-#include "auth/Crypto.h"
#include "auth/KeyRing.h"
-#include "common/ConfUtils.h"
#include "common/config.h"
#include "common/debug.h"
#include "common/errno.h"
-#include "include/str_list.h"
#include "common/Formatter.h"
#define dout_subsys ceph_subsys_auth
#ifndef CEPH_KEYRING_H
#define CEPH_KEYRING_H
-#include "common/config.h"
-
-#include "auth/Crypto.h"
#include "auth/Auth.h"
+class CephContext;
class KeyRing : public KeyStore {
map<EntityName, EntityAuth> keys;
-#include <errno.h>
#include <map>
-#include "common/config.h"
#include "common/debug.h"
-#include "include/str_list.h"
-
-#include "Crypto.h"
#include "auth/RotatingKeyRing.h"
#include "auth/KeyRing.h"
#ifndef CEPH_ROTATINGKEYRING_H
#define CEPH_ROTATINGKEYRING_H
-#include "common/config.h"
#include "common/Mutex.h"
-
-#include "auth/Crypto.h"
#include "auth/Auth.h"
/*
*/
class KeyRing;
+class CephContext;
class RotatingKeyRing : public KeyStore {
CephContext *cct;
-
-#include "../KeyRing.h"
-
#include "CephxProtocol.h"
#include "CephxAuthorizeHandler.h"
+#include "common/dout.h"
#define dout_subsys ceph_subsys_auth
#ifndef CEPH_CEPHXAUTHORIZEHANDLER_H
#define CEPH_CEPHXAUTHORIZEHANDLER_H
-#include "../AuthAuthorizeHandler.h"
+#include "auth/AuthAuthorizeHandler.h"
class CephContext;
#include "CephxClientHandler.h"
#include "CephxProtocol.h"
-#include "../KeyRing.h"
-
+#include "auth/KeyRing.h"
#include "common/config.h"
+#include "common/dout.h"
#define dout_subsys ceph_subsys_auth
#undef dout_prefix
#ifndef CEPH_CEPHXCLIENTHANDLER_H
#define CEPH_CEPHXCLIENTHANDLER_H
-#include "../AuthClientHandler.h"
+#include "auth/AuthClientHandler.h"
#include "CephxProtocol.h"
+#include "auth/RotatingKeyRing.h"
class CephContext;
+class KeyRing;
class CephxClientHandler : public AuthClientHandler {
bool starting;
*/
#include "common/config.h"
-
#include "CephxKeyServer.h"
-#include "common/Timer.h"
-
+#include "common/dout.h"
#include <sstream>
#define dout_subsys ceph_subsys_auth
#ifndef CEPH_KEYSSERVER_H
#define CEPH_KEYSSERVER_H
-#include "common/config.h"
-
#include "auth/KeyRing.h"
#include "CephxProtocol.h"
-
-#include "common/Timer.h"
+#include "CephxKeyServer.h"
+#include "common/Mutex.h"
class CephContext;
#define CEPHX_REQUEST_TYPE_MASK 0x0F00
#define CEPHX_CRYPT_ERR 1
-#include "../Auth.h"
-#include "../RotatingKeyRing.h"
-#include "common/debug.h"
-
+#include "auth/Auth.h"
#include <errno.h>
#include <sstream>
#include "CephxServiceHandler.h"
#include "CephxProtocol.h"
-
-#include "../Auth.h"
-
-#include "mon/Monitor.h"
-
+#include "CephxKeyServer.h"
#include <errno.h>
#include <sstream>
#include "common/config.h"
-#include "include/assert.h"
+#include "common/debug.h"
#define dout_subsys ceph_subsys_auth
#undef dout_prefix
#ifndef CEPH_CEPHXSERVICEHANDLER_H
#define CEPH_CEPHXSERVICEHANDLER_H
-#include "../AuthServiceHandler.h"
-#include "../Auth.h"
+#include "auth/AuthServiceHandler.h"
+#include "auth/Auth.h"
class KeyServer;
#include <sstream>
#include "common/config.h"
-#include "include/assert.h"
#include "include/ceph_features.h"
-
+#include "msg/Message.h"
+
#define dout_subsys ceph_subsys_auth
int CephxSessionHandler::_calc_signature(Message *m, uint64_t *psig)
*/
-#include "../AuthSessionHandler.h"
-#include "../Auth.h"
+#include "auth/AuthSessionHandler.h"
+#include "auth/Auth.h"
class CephContext;
+class Message;
class CephxSessionHandler : public AuthSessionHandler {
uint64_t features;
#ifndef CEPH_AUTHNONEAUTHORIZEHANDLER_H
#define CEPH_AUTHNONEAUTHORIZEHANDLER_H
-#include "../AuthAuthorizeHandler.h"
+#include "auth/AuthAuthorizeHandler.h"
class CephContext;
#ifndef CEPH_AUTHNONECLIENTHANDLER_H
#define CEPH_AUTHNONECLIENTHANDLER_H
-#include "../AuthClientHandler.h"
+#include "auth/AuthClientHandler.h"
#include "AuthNoneProtocol.h"
-
-class CephContext;
-
+#include "common/ceph_context.h"
+#include "common/config.h"
+
class AuthNoneClientHandler : public AuthClientHandler {
public:
AuthNoneClientHandler(CephContext *cct_, RotatingKeyRing *rkeys)
#ifndef CEPH_AUTHNONEPROTOCOL_H
#define CEPH_AUTHNONEPROTOCOL_H
-#include "../Auth.h"
+#include "auth/Auth.h"
struct AuthNoneAuthorizer : public AuthAuthorizer {
AuthNoneAuthorizer() : AuthAuthorizer(CEPH_AUTH_NONE) { }
#ifndef CEPH_AUTHNONESERVICEHANDLER_H
#define CEPH_AUTHNONESERVICEHANDLER_H
-#include "../AuthServiceHandler.h"
-#include "../Auth.h"
+#include "auth/AuthServiceHandler.h"
+#include "auth/Auth.h"
class CephContext;
*
*/
-#include "../AuthSessionHandler.h"
-#include "../Auth.h"
-
-#define dout_subsys ceph_subsys_auth
+#include "auth/AuthSessionHandler.h"
+#include "msg/Message.h"
class CephContext;
*/
#include "AuthUnknownAuthorizeHandler.h"
-#include "common/debug.h"
-
-#define dout_subsys ceph_subsys_auth
bool AuthUnknownAuthorizeHandler::verify_authorizer(CephContext *cct, KeyStore *keys,
bufferlist& authorizer_data, bufferlist& authorizer_reply,
#ifndef CEPH_AUTHUNKNOWNAUTHORIZEHANDLER_H
#define CEPH_AUTHUNKNOWNAUTHORIZEHANDLER_H
-#include "../AuthAuthorizeHandler.h"
+#include "auth/AuthAuthorizeHandler.h"
class CephContext;
#ifndef CEPH_AUTHUNKNOWNCLIENTHANDLER_H
#define CEPH_AUTHUNKNOWNCLIENTHANDLER_H
-#include "../AuthClientHandler.h"
+#include "auth/AuthClientHandler.h"
#include "AuthUnknownProtocol.h"
class CephContext;
#ifndef CEPH_AUTHUNKNOWNPROTOCOL_H
#define CEPH_AUTHUNKNOWNPROTOCOL_H
-#include "../Auth.h"
+#include "auth/Auth.h"
struct AuthUnknownAuthorizer : public AuthAuthorizer {
AuthUnknownAuthorizer() : AuthAuthorizer(CEPH_AUTH_UNKNOWN) { }
#ifndef CEPH_AUTHUNKNOWNSERVICEHANDLER_H
#define CEPH_AUTHUNKNOWNSERVICEHANDLER_H
-#include "../AuthServiceHandler.h"
-#include "../Auth.h"
+#include "auth/AuthServiceHandler.h"
+#include "auth/Auth.h"
class CephContext;
*
*/
-#include "../AuthSessionHandler.h"
-#include "../Auth.h"
+#include "auth/AuthSessionHandler.h"
+#include "msg/Message.h"
#define dout_subsys ceph_subsys_auth
#include "common/ConfUtils.h"
#include "common/ceph_argparse.h"
-
+#include "common/config.h"
#include "global/global_context.h"
#include "global/global_init.h"