auth: AuthClientHandler const cleanup

get_protocol(), build_request(), build_rotating_request(), and
build_authorizer() can all be declared const now.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2014-04-09 14:11:49 -07:00
parent 9af10b2c9a
commit 3ccef66276
5 changed files with 21 additions and 21 deletions

View File

@ -58,16 +58,16 @@ public:
validate_tickets();
}
virtual int get_protocol() = 0;
virtual int get_protocol() const = 0;
virtual void reset() = 0;
virtual void prepare_build_request() = 0;
virtual int build_request(bufferlist& bl) = 0;
virtual int build_request(bufferlist& bl) const = 0;
virtual int handle_response(int ret, bufferlist::iterator& iter) = 0;
virtual bool build_rotating_request(bufferlist& bl) = 0;
virtual bool build_rotating_request(bufferlist& bl) const = 0;
virtual AuthAuthorizer *build_authorizer(uint32_t service_id) const = 0;
virtual AuthAuthorizer *build_authorizer(uint32_t service_id) = 0;
virtual void validate_tickets() = 0;
virtual bool need_tickets() = 0;

View File

@ -27,7 +27,7 @@
#define dout_prefix *_dout << "cephx client: "
int CephxClientHandler::build_request(bufferlist& bl)
int CephxClientHandler::build_request(bufferlist& bl) const
{
ldout(cct, 10) << "build_request" << dendl;
@ -172,7 +172,7 @@ int CephxClientHandler::handle_response(int ret, bufferlist::iterator& indata)
AuthAuthorizer *CephxClientHandler::build_authorizer(uint32_t service_id)
AuthAuthorizer *CephxClientHandler::build_authorizer(uint32_t service_id) const
{
RWLock::RLocker l(lock);
ldout(cct, 10) << "build_authorizer for service " << ceph_entity_type_name(service_id) << dendl;
@ -180,7 +180,7 @@ AuthAuthorizer *CephxClientHandler::build_authorizer(uint32_t service_id)
}
bool CephxClientHandler::build_rotating_request(bufferlist& bl)
bool CephxClientHandler::build_rotating_request(bufferlist& bl) const
{
ldout(cct, 10) << "build_rotating_request" << dendl;
CephXRequestHeader header;

View File

@ -22,10 +22,10 @@ class CephContext;
class CephxClientHandler : public AuthClientHandler {
bool starting;
/* envelope protocol parameters */
uint64_t server_challenge;
CephXTicketManager tickets;
CephXTicketHandler* ticket_handler;
@ -51,13 +51,13 @@ public:
server_challenge = 0;
}
void prepare_build_request();
int build_request(bufferlist& bl);
int build_request(bufferlist& bl) const;
int handle_response(int ret, bufferlist::iterator& iter);
bool build_rotating_request(bufferlist& bl);
bool build_rotating_request(bufferlist& bl) const;
int get_protocol() { return CEPH_AUTH_CEPHX; }
int get_protocol() const { return CEPH_AUTH_CEPHX; }
AuthAuthorizer *build_authorizer(uint32_t service_id);
AuthAuthorizer *build_authorizer(uint32_t service_id) const;
void validate_tickets();
bool need_tickets();

View File

@ -28,13 +28,13 @@ public:
void reset() { }
void prepare_build_request() {}
int build_request(bufferlist& bl) { return 0; }
int build_request(bufferlist& bl) const { return 0; }
int handle_response(int ret, bufferlist::iterator& iter) { return 0; }
bool build_rotating_request(bufferlist& bl) { return false; }
bool build_rotating_request(bufferlist& bl) const { return false; }
int get_protocol() { return CEPH_AUTH_NONE; }
int get_protocol() const { return CEPH_AUTH_NONE; }
AuthAuthorizer *build_authorizer(uint32_t service_id) {
AuthAuthorizer *build_authorizer(uint32_t service_id) const {
RWLock::RLocker l(lock);
AuthNoneAuthorizer *auth = new AuthNoneAuthorizer();
if (auth) {

View File

@ -28,13 +28,13 @@ public:
void reset() { }
void prepare_build_request() {}
int build_request(bufferlist& bl) { return 0; }
int build_request(bufferlist& bl) const { return 0; }
int handle_response(int ret, bufferlist::iterator& iter) { return 0; }
bool build_rotating_request(bufferlist& bl) { return false; }
bool build_rotating_request(bufferlist& bl) const { return false; }
int get_protocol() { return CEPH_AUTH_UNKNOWN; }
int get_protocol() const { return CEPH_AUTH_UNKNOWN; }
AuthAuthorizer *build_authorizer(uint32_t service_id) {
AuthAuthorizer *build_authorizer(uint32_t service_id) const {
RWLock::RLocker l(lock);
AuthUnknownAuthorizer *auth = new AuthUnknownAuthorizer();
if (auth) {