Skip to content

Commit 457ac78

Browse files
committed
shiro 格式化代码
1 parent 6803921 commit 457ac78

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

cetty-shiro/src/cetty/shiro/authc/Authenticator.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ using namespace cetty::shiro::realm;
2727
const std::string Authenticator::HASHEDCREDENTIALSMATCHER = "hashed_credentials_matcher";
2828
const std::string Authenticator::SIMPLECREDENTIALSMATCHER = "simple_credentials_matcher";
2929

30-
Authenticator::Authenticator(): credentialsMatcher(NULL) {
30+
Authenticator::Authenticator()
31+
: credentialsMatcher(NULL) {
3132
ConfigCenter::instance().configure(&config);
3233
init();
3334
}

include/cetty/shiro/SecurityManager.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ class SecurityManager {
6161
typedef boost::function<void (const AuthenticationInfoPtr&)> AuthenticateCallback;
6262
typedef boost::function3<void, bool, const std::string&, const std::string&> AuthorizeCallback;
6363

64+
public:
65+
static SecurityManager& instance();
66+
6467
public:
6568
SecurityManager();
6669
virtual ~SecurityManager();
6770

68-
static SecurityManager& instance();
69-
7071
/// login by user name and password
7172
void login(const AuthenticationToken& token, const LoginCallback& callback);
7273
void logout(const std::string& sessionId);
@@ -83,7 +84,6 @@ class SecurityManager {
8384
const PermissionPtr& permission,
8485
const AuthorizeCallback& callback) const;
8586

86-
8787
SessionManager* getSessionManager();
8888
Authenticator& getAuthenticator();
8989
Authorizer& getAuthorizer();

include/cetty/shiro/authc/Authenticator.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ class Authenticator {
131131
AuthenticatorConfig config;
132132

133133
/**
134-
* List of realms that will be iterated through when a user authenticates
135-
* notice the lifecycle of AuthenticationRealm.
136-
*/
134+
* List of realms that will be iterated through when a user authenticates
135+
* notice the lifecycle of AuthenticationRealm.
136+
*/
137137
AuthenticatingRealmPtr realm;
138138

139139
/**

include/cetty/shiro/authc/CredentialsMatcher.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ class AuthenticationToken;
4545
* @since 0.1
4646
*/
4747

48-
class CredentialsMatcher{
48+
class CredentialsMatcher {
4949
public:
50-
virtual bool match(const AuthenticationToken& token, const AuthenticationInfo& info) = 0;
50+
virtual ~CredentialsMatcher() {}
5151

52-
virtual ~CredentialsMatcher(){}
52+
virtual bool match(const AuthenticationToken& token,
53+
const AuthenticationInfo& info) = 0;
5354
};
5455

5556
}

0 commit comments

Comments
 (0)