2
Definitions required for Authentication plugin
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Definitions required for Authentication plugin
6
* Copyright (C) 2008 Sun Microsystems
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; version 2 of the License.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
5
22
#ifndef DRIZZLED_PLUGIN_AUTHENTICATION_H
6
23
#define DRIZZLED_PLUGIN_AUTHENTICATION_H
8
typedef struct authentication_st
10
bool (*authenticate)(THD *thd, const char *password);
27
#include "drizzled/plugin.h"
28
#include "drizzled/plugin/plugin.h"
32
class SecurityContext;
37
class Authentication : public Plugin
40
Authentication(const Authentication &);
41
Authentication& operator=(const Authentication &);
43
explicit Authentication(std::string name_arg)
44
: Plugin(name_arg, "Authentication")
46
virtual ~Authentication() {}
48
virtual bool authenticate(const SecurityContext &sctx,
49
const std::string &passwd)= 0;
51
static bool addPlugin(plugin::Authentication *auth);
52
static void removePlugin(plugin::Authentication *auth);
53
static bool isAuthenticated(const SecurityContext &sctx,
54
const std::string &password);
57
} /* namespace plugin */
58
} /* namespace drizzled */
13
60
#endif /* DRIZZLED_PLUGIN_AUTHENTICATION_H */