#include <boost/intrusive_ptr.hpp>
+#include "auth/Auth.h"
#include "common/RefCountedObj.h"
#include "common/config.h"
#include "common/debug.h"
int rx_buffers_version;
map<ceph_tid_t,pair<bufferlist,int> > rx_buffers;
+ // authentication state
+ // FIXME make these private after ms_handle_authorizer is removed
+public:
+ AuthCapsInfo peer_caps_info;
+ EntityName peer_name;
+ uint64_t peer_global_id = 0;
+
friend class boost::intrusive_ptr<Connection>;
friend class PipeConnection;
*/
virtual void mark_disposable() = 0;
+ AuthCapsInfo& get_peer_caps_info() {
+ return peer_caps_info;
+ }
+ const EntityName& get_peer_entity_name() {
+ return peer_name;
+ }
+ uint64_t get_peer_global_id() {
+ return peer_global_id;
+ }
int get_peer_type() const { return peer_type; }
void set_peer_type(int t) { peer_type = t; }
* @defgroup Authentication
* @{
*/
+ /**
+ * handle successful authentication (msgr2)
+ *
+ * Authenticated result/state will be attached to the Connection.
+ *
+ * return 1 for success
+ * return 0 for no action (let another Dispatcher handle it)
+ * return <0 for failure (failure to parse caps, for instance)
+ */
+ virtual int ms_handle_authentication(Connection *con) {
+ return 0;
+ }
+
/**
* Retrieve the AuthAuthorizer for the given peer type. It might not
* provide one if it knows there is no AuthAuthorizer for that type.
return true;
}
+ int ms_handle_authentication(Connection *con) override {
+ return 1;
+ }
+
void reply_message(Message *m) {
MPing *rm = new MPing();
m->get_connection()->send_message(rm);
return true;
}
+ int ms_handle_authentication(Connection *con) override {
+ return 1;
+ }
+
void reply_message(const Message *m, Payload& pl) {
pl.who = Payload::PONG;
bufferlist bl;
isvalid = true;
return true;
}
+ int ms_handle_authentication(Connection *con) override {
+ return 1;
+ }
};