1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2009 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_AUTHNONECLIENTHANDLER_H
16 #define CEPH_AUTHNONECLIENTHANDLER_H
18 #include "auth/AuthClientHandler.h"
19 #include "AuthNoneProtocol.h"
20 #include "common/ceph_context.h"
21 #include "common/config.h"
23 class AuthNoneClientHandler : public AuthClientHandler {
25 AuthNoneClientHandler(CephContext *cct_, RotatingKeyRing *rkeys)
26 : AuthClientHandler(cct_) {}
28 void reset() override { }
30 void prepare_build_request() override {}
31 int build_request(bufferlist& bl) const override { return 0; }
32 int handle_response(int ret, bufferlist::iterator& iter) override { return 0; }
33 bool build_rotating_request(bufferlist& bl) const override { return false; }
35 int get_protocol() const override { return CEPH_AUTH_NONE; }
37 AuthAuthorizer *build_authorizer(uint32_t service_id) const override {
38 RWLock::RLocker l(lock);
39 AuthNoneAuthorizer *auth = new AuthNoneAuthorizer();
41 auth->build_authorizer(cct->_conf->name, global_id);
46 bool need_tickets() override { return false; }
48 void set_global_id(uint64_t id) override {
49 RWLock::WLocker l(lock);
53 void validate_tickets() override {}