Skip to content

Commit

Permalink
AUTH: optimize header file dependency.
Browse files Browse the repository at this point in the history
same work as PR: ceph#9193, ceph#9161

Signed-off-by: Xiaowei Chen <[email protected]>
  • Loading branch information
shawn committed May 20, 2016
1 parent 91e3fd6 commit 077af13
Show file tree
Hide file tree
Showing 39 changed files with 46 additions and 102 deletions.
3 changes: 0 additions & 3 deletions src/auth/Auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#define CEPH_AUTHTYPES_H

#include "Crypto.h"
#include "msg/msg_types.h"

#include "common/config.h"
#include "common/entity_name.h"

class Cond;
Expand Down
5 changes: 0 additions & 5 deletions src/auth/AuthAuthorizeHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@
*
*/

#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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/auth/AuthAuthorizeHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#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
Expand Down
5 changes: 0 additions & 5 deletions src/auth/AuthClientHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
#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"

Expand Down
5 changes: 0 additions & 5 deletions src/auth/AuthClientHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@


#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;
Expand Down
3 changes: 0 additions & 3 deletions src/auth/AuthMethodList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
*/

#include <algorithm>

#include "common/Mutex.h"
#include "common/config.h"
#include "common/debug.h"
#include "include/str_list.h"

Expand Down
2 changes: 0 additions & 2 deletions src/auth/AuthServiceHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include "AuthServiceHandler.h"
#include "cephx/CephxServiceHandler.h"
#include "none/AuthNoneServiceHandler.h"
#include "AuthMethodList.h"
#include "common/config.h"

#define dout_subsys ceph_subsys_auth

Expand Down
1 change: 0 additions & 1 deletion src/auth/AuthServiceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define CEPH_AUTHSERVICEHANDLER_H

#include "include/types.h"
#include "common/config.h"
#include "Auth.h"

class CephContext;
Expand Down
1 change: 0 additions & 1 deletion src/auth/AuthSessionHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "cephx/CephxSessionHandler.h"
#include "none/AuthNoneSessionHandler.h"
#include "unknown/AuthUnknownSessionHandler.h"
#include "common/config.h"

#define dout_subsys ceph_subsys_auth

Expand Down
3 changes: 1 addition & 2 deletions src/auth/AuthSessionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#define CEPH_AUTHSESSIONHANDLER_H

#include "include/types.h"
#include "common/config.h"
#include "msg/Message.h"
#include "Auth.h"

#define SESSION_SIGNATURE_FAILURE -1
Expand All @@ -27,6 +25,7 @@

class CephContext;
class KeyServer;
class Message;

struct AuthSessionHandler {
protected:
Expand Down
5 changes: 2 additions & 3 deletions src/auth/Crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
#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)
Expand Down
4 changes: 2 additions & 2 deletions src/auth/Crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
#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
Expand Down
5 changes: 0 additions & 5 deletions src/auth/KeyRing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@
#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
Expand Down
4 changes: 1 addition & 3 deletions src/auth/KeyRing.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
#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;
Expand Down
5 changes: 0 additions & 5 deletions src/auth/RotatingKeyRing.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#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"

Expand Down
4 changes: 1 addition & 3 deletions src/auth/RotatingKeyRing.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
#ifndef CEPH_ROTATINGKEYRING_H
#define CEPH_ROTATINGKEYRING_H

#include "common/config.h"
#include "common/Mutex.h"

#include "auth/Crypto.h"
#include "auth/Auth.h"

/*
* mediate access to a service's keyring and rotating secrets
*/

class KeyRing;
class CephContext;

class RotatingKeyRing : public KeyStore {
CephContext *cct;
Expand Down
4 changes: 1 addition & 3 deletions src/auth/cephx/CephxAuthorizeHandler.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

#include "../KeyRing.h"

#include "CephxProtocol.h"
#include "CephxAuthorizeHandler.h"
#include "common/dout.h"

#define dout_subsys ceph_subsys_auth

Expand Down
2 changes: 1 addition & 1 deletion src/auth/cephx/CephxAuthorizeHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef CEPH_CEPHXAUTHORIZEHANDLER_H
#define CEPH_CEPHXAUTHORIZEHANDLER_H

#include "../AuthAuthorizeHandler.h"
#include "auth/AuthAuthorizeHandler.h"

class CephContext;

Expand Down
4 changes: 2 additions & 2 deletions src/auth/cephx/CephxClientHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#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
Expand Down
4 changes: 3 additions & 1 deletion src/auth/cephx/CephxClientHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
#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;
Expand Down
4 changes: 1 addition & 3 deletions src/auth/cephx/CephxKeyServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
*/

#include "common/config.h"

#include "CephxKeyServer.h"
#include "common/Timer.h"

#include "common/dout.h"
#include <sstream>

#define dout_subsys ceph_subsys_auth
Expand Down
6 changes: 2 additions & 4 deletions src/auth/cephx/CephxKeyServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
#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;

Expand Down
5 changes: 1 addition & 4 deletions src/auth/cephx/CephxProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@
#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>

Expand Down
8 changes: 2 additions & 6 deletions src/auth/cephx/CephxServiceHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@

#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
Expand Down
4 changes: 2 additions & 2 deletions src/auth/cephx/CephxServiceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef CEPH_CEPHXSERVICEHANDLER_H
#define CEPH_CEPHXSERVICEHANDLER_H

#include "../AuthServiceHandler.h"
#include "../Auth.h"
#include "auth/AuthServiceHandler.h"
#include "auth/Auth.h"

class KeyServer;

Expand Down
4 changes: 2 additions & 2 deletions src/auth/cephx/CephxSessionHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#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)
Expand Down
5 changes: 3 additions & 2 deletions src/auth/cephx/CephxSessionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
*/


#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;
Expand Down
2 changes: 1 addition & 1 deletion src/auth/none/AuthNoneAuthorizeHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef CEPH_AUTHNONEAUTHORIZEHANDLER_H
#define CEPH_AUTHNONEAUTHORIZEHANDLER_H

#include "../AuthAuthorizeHandler.h"
#include "auth/AuthAuthorizeHandler.h"

class CephContext;

Expand Down
8 changes: 4 additions & 4 deletions src/auth/none/AuthNoneClientHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#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)
Expand Down
2 changes: 1 addition & 1 deletion src/auth/none/AuthNoneProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef CEPH_AUTHNONEPROTOCOL_H
#define CEPH_AUTHNONEPROTOCOL_H

#include "../Auth.h"
#include "auth/Auth.h"

struct AuthNoneAuthorizer : public AuthAuthorizer {
AuthNoneAuthorizer() : AuthAuthorizer(CEPH_AUTH_NONE) { }
Expand Down
4 changes: 2 additions & 2 deletions src/auth/none/AuthNoneServiceHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef CEPH_AUTHNONESERVICEHANDLER_H
#define CEPH_AUTHNONESERVICEHANDLER_H

#include "../AuthServiceHandler.h"
#include "../Auth.h"
#include "auth/AuthServiceHandler.h"
#include "auth/Auth.h"

class CephContext;

Expand Down
Loading

0 comments on commit 077af13

Please sign in to comment.